//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@7b00c550
This Op
wraps the Views.permute()
method of ImgLib2, swapping two dimensions of any RandomAccessible
or RandomAccessibleInterval
. It is called as follows:
ij.op().help('permuteView')
Available operations: (IntervalView out) = net.imagej.ops.transform.permuteView.IntervalPermuteView( RandomAccessibleInterval in, int fromAxis, int toAxis) (MixedTransformView out) = net.imagej.ops.transform.permuteView.DefaultPermuteView( RandomAccessible in, int fromAxis, int toAxis)
Let's get an Img
to permute:
input = ij.scifio().datasetIO().open("http://imagej.net/images/cat.jpg")
ij.notebook().display(input)
[INFO] Populating metadata [INFO] Populating metadata
This cat is thrilled to be permuted. Let's swap the first (0
) and second (1
) axes:
fromAxis = 0
toAxis = 1
permuted = ij.op().run("permuteView", input, fromAxis, toAxis)
ij.notebook().display(permuted)