Login  Register

Re: Roi manager multi measure from a plugin

Posted by ctrueden on Jun 08, 2014; 3:15am
URL: http://imagej.273.s1.nabble.com/Roi-manager-multi-measure-from-a-plugin-tp5008021p5008091.html

Hi Wayne,

> Fiji no longer displays the ImageJ version when you click in the
> status bar so you need to use the Help>About ImageJ command to find
> out what version of ij.jar you have.

Just wanted to quickly mention that that is a bug. It is supposed to show
the ImageJ 1.x version in parentheses. That got lost in the shuffle of the
final push for the rc-2 release, but will be back soon.

Regards,
Curtis


On Sat, Jun 7, 2014 at 1:40 PM, Rasband, Wayne (NIH/NIMH) [E] <
[hidden email]> wrote:

> On Jun 7, 2014, at 9:56 AM, Philippe Mailly wrote:
>
> > Hi Wayne,
> >
> > When I try to use the multiMeasure method, I get an error message "the
> method is not public". I downloaded the ij.jar from the daily build.
>
> You need to update by using the Help>Update ImageJ command and selecting
> "daily build" from the drop down menu.
>
> > I have a other question, is this method is implemented in the ij 2
> libraries, I'm using Fiji which is now in imageJ 2 rc version.
>
> The RoiManager#multiMeasure(ImagePlus) method is implemented in the ij.jar
> library, which is included with Fiji. Fiji no longer displays the ImageJ
> version when you click in the status bar so you need to use the Help>About
> ImageJ command to find out what version of ij.jar you have.
>
> The following is an updated JavaScript example that shows how to use the
> multiMeasure() method. It creates a 200x200x200 stack, fills it with a
> grayscale sphere, and uses the multiMeasure() method to measure the min,
> max and mean pixel values of each slice at three locations. Uncomment the
> last line to see what the sphere looks like. It requires the latest ImageJ
> daily build (1.49c8).
>
> -wayne
>
>   n = 200;  w=10; r = n/8;
>   rm = new RoiManager(true); // create hidden ROI Manager
>   rm.addRoi(new OvalRoi(0.3*n-w, 0.3*n-w, w, w));
>   rm.addRoi(new OvalRoi(0.5*n-w/2, 0.5*n-w/2, w, w));
>   rm.addRoi(new OvalRoi(0.7*n, 0.7*n, w, w));
>   imp = IJ.createImage("Untitled", "8-bit Black", n, n, n);
>   stack = imp.getStack();
>   stack.drawSphere(n/4, n/2, n/2, n/2);
>   IJ.run(imp, "Gaussian Blur 3D...", "x="+r+" y="+r+" z="+r);
>   saveMeasurements = Analyzer.getMeasurements();
>   Analyzer.setMeasurements(Measurements.MEAN+Measurements.MIN_MAX);
>   rt = rm.multiMeasure(imp);
>   rt.show("Results");
>   Analyzer.setMeasurements(saveMeasurements);
>   //imp.show();
>
> > "Rasband, Wayne (NIH/NIMH) [E]" <[hidden email]> a écrit :
> >
> >> On Jun 5, 2014, at 12:00 AM, Philippe Mailly wrote:
> >>
> >>> Hi,
> >>>
> >>> How to run roi manager command multi measure from a plugin without
>  displaying image and dialog box as in batch mode from macro.
> >>
> >> The latest ImageJ daily build (1.49c6) adds a public multiMeasure()
>  method to the ROI Manager and upgrades the recorder to support this
>  method. This is the JavaScript code the recorder generates when you  use
> the "Multi Measure" command:
> >>
> >>   imp = IJ.getImage();
> >>   rm = RoiManager.getInstance();
> >>   if (rm==null) rm = new RoiManager();
> >>   rt = rm.multiMeasure(imp);
> >>   rt.show("Results");
> >>
> >> -wayne
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

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