Permalink
Browse files

Add methods for binary operations

  • Loading branch information...
awalter17 committed Oct 18, 2016
1 parent a50ee7c commit 82bb16c0a55d36c0f365d5ac8a03a17b432221fc
Showing with 32 additions and 0 deletions.
  1. +32 −0 src/main/java/net/imglib2/roi/Regions.java
@@ -36,9 +36,16 @@
import net.imglib2.IterableInterval;
import net.imglib2.RandomAccessible;
import net.imglib2.RandomAccessibleInterval;
import net.imglib2.RealRandomAccessibleRealInterval;
import net.imglib2.roi.operators.RealBinaryExclusiveOr;
import net.imglib2.roi.operators.RealBinaryIntersection;
import net.imglib2.roi.operators.RealBinaryNot;
import net.imglib2.roi.operators.RealBinarySubtraction;
import net.imglib2.roi.operators.RealBinaryUnion;
import net.imglib2.roi.util.IterableRandomAccessibleRegion;
import net.imglib2.roi.util.SamplingIterableInterval;
import net.imglib2.type.BooleanType;
import net.imglib2.type.logic.BoolType;
public class Regions
{
@@ -58,4 +65,29 @@
else
return IterableRandomAccessibleRegion.create( region );
}
public static RealRandomAccessibleRealInterval< BoolType > intersect( RealRandomAccessibleRealInterval< BoolType > leftOperand, RealRandomAccessibleRealInterval< BoolType > rightOperand )
{
return new RealBinaryIntersection( leftOperand, rightOperand );
}
public static RealRandomAccessibleRealInterval< BoolType > not( RealRandomAccessibleRealInterval< BoolType > operand )
{
return new RealBinaryNot( operand );
}
public static RealRandomAccessibleRealInterval< BoolType > subtract( RealRandomAccessibleRealInterval< BoolType > leftOperand, RealRandomAccessibleRealInterval< BoolType > rightOperand )
{
return new RealBinarySubtraction( leftOperand, rightOperand );
}
public static RealRandomAccessibleRealInterval< BoolType > union( RealRandomAccessibleRealInterval< BoolType > leftOperand, RealRandomAccessibleRealInterval< BoolType > rightOperand )
{
return new RealBinaryUnion( leftOperand, rightOperand );
}
public static RealRandomAccessibleRealInterval< BoolType > xor( RealRandomAccessibleRealInterval< BoolType > leftOperand, RealRandomAccessibleRealInterval< BoolType > rightOperand )
{
return new RealBinaryExclusiveOr( leftOperand, rightOperand );
}
}

0 comments on commit 82bb16c

Please sign in to comment.