Roi manager multi measure from a plugin

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Roi manager multi measure from a plugin

Philippe Mailly
Hi,

How to run roi manager command multi measure from a plugin without  
displaying image and dialog box as in batch mode from macro.


Thanks in advance


Philippe Mailly

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Roi manager multi measure from a plugin

Kota Miura
Hi Phiippe,



On Thu, Jun 5, 2014 at 6:00 AM, Philippe Mailly <
[hidden email]> 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.
>
>
> Thanks in advance
>
>
> Philippe Mailly
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>


See

http://cmci.embl.de/documents/120206pyip_cooking/python_imagej_cookbook#roi_manager

It's in Jython but similar in Java.

Kota

--

-------------------------------------------------------------*Dr. Kota Miura*

Scientist & IT Engineer
Centre for Molecular and Cellular Imaging,
European Molecular Biology Laboratory
Meyerhofstr. 1
69117 Heidelberg
GERMANY

Tel +49 6221 387 404

Mobile +49 160 95001177

Fax +49 6221 387 512

http://cmci.embl.de
-------------------------------------------------------------

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Roi manager multi measure from a plugin

Rasband, Wayne (NIH/NIMH) [E]
In reply to this post by Philippe Mailly
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
Reply | Threaded
Open this post in threaded view
|

Re: Roi manager multi measure from a plugin

Philippe Mailly
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.
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.

Thanks


Philippe

"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
Reply | Threaded
Open this post in threaded view
|

Re: Roi manager multi measure from a plugin

Rasband, Wayne (NIH/NIMH) [E]
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
Reply | Threaded
Open this post in threaded view
|

ImageJ 1.x version no longer displayed in Fiji's status bar, was Re: Roi manager multi measure from a plugin

dscho
Dear Wayne,

On Sat, 7 Jun 2014, Rasband, Wayne (NIH/NIMH) [E] wrote:

> Fiji no longer displays the ImageJ version when you click in the status bar

Thank you for reporting that bug.

We will fix it as soon as possible,
Johannes

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: ImageJ 1.x version no longer displayed in Fiji's status bar, was Re: Roi manager multi measure from a plugin

dscho
Dear Wayne,

On Sat, 7 Jun 2014, Johannes Schindelin wrote:

> On Sat, 7 Jun 2014, Rasband, Wayne (NIH/NIMH) [E] wrote:
>
> > Fiji no longer displays the ImageJ version when you click in the status bar
>
> Thank you for reporting that bug.

The bug has been fixed. After updating Fiji, the version will be displayed
correctly in the status bar.

Ciao,
Johannes

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Roi manager multi measure from a plugin

ctrueden
In reply to this post by Rasband, Wayne (NIH/NIMH) [E]
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