//load ImageJ
%classpath config resolver scijava.public https://maven.scijava.org/content/groups/public
%classpath add mvn net.imagej imagej 2.0.0-rc-67
//create ImageJ object
ij = new net.imagej.ImageJ()
Added new repo: scijava.public
net.imagej.ImageJ@4248b215
This Op
pads any input image according to a passed Dimensions
object. Let's see how this Op
is called:
ij.op().help("padInput")
Available operations: (RandomAccessibleInterval out) = net.imagej.ops.filter.pad.PadInput( RandomAccessibleInterval in, Dimensions paddedDimensions, OutOfBoundsFactory obf?)
Let's look at the parameters here:
RandomAccessibleInterval in
: the input imageDimensions paddedDimensions
: the Dimensions
of the padded output image. The Op
will create an image with dimensions matching this argument, placing the input image at the center.OutOfBoundsFactory obf
: an optional parameter that can tell the Op
how to populate the padded section of the output. If no OutOfBoundsFactory
is given then the pad is populated with zeroes.input = ij.scifio().datasetIO().open("http://imagej.net/images/clown.png")
ij.notebook().display(input)
import net.imglib2.FinalDimensions
FinalDimensions dims = new FinalDimensions(800, 600, 3)
padded = ij.op().run("padInput", input, dims)
ij.notebook().display(padded)