Java: How to get the backing data for a stack slice
Posted by
Robert Lockwood on
Apr 02, 2019; 3:17pm
URL: http://imagej.273.s1.nabble.com/Java-How-to-get-the-backing-data-for-a-stack-slice-tp5021964.html
I need to examine pixels in images in stacks, row-by-row, but don't know
how to get the image data.
The code snippet below works up to the for loop:
public void processStack(final File dFile) {
ImageStack inStack =
ij.IJ.openImage(dFile.getPath()).getImageStack();
System.out.println("Stack: " + dFile.getPath() + " stacks = " +
inStack.getSize());
final int NROWS = inStack.getHeight();
final int NCOLS = inStack.getHeight();
final int NSLICES = inStack.getSize();
for(int slice = 1; slice <= NSLICES; slice++) {
// float[] image = ???
}
}
TIA
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html