Skip to content

Commit 1b10595

Browse files
acardonactrueden
authored andcommitted
ImgMath: static methods for computing into an image that gets created anew
to contain the result of the pixel-wise computations.
1 parent c56b2d5 commit 1b10595

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/main/java/net/imglib2/algorithm/math/ImgMath.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import net.imglib2.algorithm.math.abstractions.Util;
66
import net.imglib2.converter.Converter;
77
import net.imglib2.img.array.ArrayImgFactory;
8+
import net.imglib2.type.NativeType;
89
import net.imglib2.type.numeric.RealType;
910
import net.imglib2.type.numeric.real.FloatType;
1011

@@ -98,6 +99,16 @@ static public final < O extends RealType< O > > RandomAccessibleInterval< O > co
9899
return new Compute( operation ).into( target, converter );
99100
}
100101

102+
static public final < O extends NativeType< O > & RealType< O > > RandomAccessibleInterval< O > computeIntoImg( final IFunction operation )
103+
{
104+
return compute( operation ).intoImg();
105+
}
106+
107+
static public final < O extends NativeType< O > & RealType< O > > RandomAccessibleInterval< O > computeIntoArrayImg( final IFunction operation )
108+
{
109+
return compute( operation ).intoArrayImg();
110+
}
111+
101112
static public final Add add( final Object o1, final Object o2 )
102113
{
103114
return new Add( o1, o2 );

0 commit comments

Comments
 (0)