Skip to content

Commit 29089c5

Browse files
committed
ImgMath: add static methods to wrap a Number and a RandomAccessibleInterval.
Useful for e.g. copying an image into another, or filling an image with a number: compute(img(source)).into(target) compute(number(255)).into(target)
1 parent 1a6cf7e commit 29089c5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,4 +232,14 @@ static public final Else ELSE( final Object o )
232232
{
233233
return new Else( o );
234234
}
235+
236+
static public final < T extends RealType< T > > ImgSource< T > img( final RandomAccessibleInterval< T > rai )
237+
{
238+
return new ImgSource< T >( rai );
239+
}
240+
241+
static public final NumberSource number( final Number number )
242+
{
243+
return new NumberSource( number );
244+
}
235245
}

0 commit comments

Comments
 (0)