Login  Register

ZProjector for dummies

Posted by Jeff Hardin on Jun 04, 2014; 9:25pm
URL: http://imagej.273.s1.nabble.com/ZProjector-for-dummies-tp5008014.html

Hi all,
I'm trying to learn how to use the ZProjector class to generate an ImagePlus and then replace the ImagePlus of a window with the result. However, I can't get the same result using calls to the ZProjector  directly that I get when I use the IJ.run("Z Project...") command. I am using a stack which is the MRI Stack (27 slices) converted to a HyperStack (z = 9 , t = 3).

Here are the two calls:

myProjector = new ZProjector();
myProjector.setMethod(ij.plugin.ZProjector.MAX_METHOD);
myProjector.setStartSlice(1);
myProjector.setStopSlice(4);
myProjector.setImage(imp);
myProjector.doHyperStackProjection(false);
ImageWindow tempWindow = new ImageWindow(myProjector.getProjection());
tempWindow.show();

This seems to project all 9 focal planes instead of 4. Other projection methods seem to give the same result (all 9 sections). This is also true when I use a plain old stack and myProjector.doProjection()

In contrast, the following works correctly on a stack or hyperstack:
IJ.run(imp, "Z Project...", "start=1 stop=4 projection=[Max Intensity]");

This projects only the requested 4 focal planes.

Is this a bug, or am I doing something fundamentally wrong? If the latter, help would be appreciated! ImageJ v = 1.49b, JVM 1.60_65 (32-bit), Mac OS X 10.9.

Cheers,
Jeff
----------------------------------------
Jeff Hardin
Professor and Chair, Department of Zoology
Director, Biology Core Curriculum
University of Wisconsin
1117 W. Johnson St.
Madison, WI 53706
voice: (608) 262-9634
fax: (608) 262-7319
email: [hidden email]
web page: http://worms.zoology.wisc.edu

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html