Re: IMAGEJ Digest - 28 Jul 2008 to 29 Jul 2008 (#2008-203)

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

Re: IMAGEJ Digest - 28 Jul 2008 to 29 Jul 2008 (#2008-203)

Toby Cornish
Thomas,

Not sure if this helps you out or not, but here is a function for measuring (separately) an arbitrary number of ROI manager selections listed by index in an array (code below).

toby

newImage("test", "8-bit Black", 128, 128, 1);
makeRectangle(54, 35,10,10);
roiManager("Add");
makeRectangle(70, 70,10,10);
roiManager("Add");

rois = newArray(0, 1);
measureSelections(rois);
exit();

// FUNCTIONS BELOW ================================

function measureSelections(rois) {
  for (i =0; i < rois.length; i++) {
    roiManager("select",rois[i]);
    roiManager("measure");
  }
}

>From:    Thomas Boudier <[hidden email]>
>Subject: Re: roi select two rois
>
>Hi,
>
>I'm running ImageJ 1.41i on linux with java1.6.0_06, what I would like
>is to select specifically two rois (to perform some computation on
>them), when I run this code :
>
>roiManager("Select", 0);
>setKeyDown("shift");
>roiManager("Select", 1);
>roiManager("measure");
>
>
>I only have one measure instead of two. Not sure if the shift key
>applies to the list inside roiManager or to Rois in the image where they
>are combined.
>
>Thomas




Toby C. Cornish, M.D., Ph.D.
Pathology Resident
Johns Hopkins Medical Institutions
[hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: IMAGEJ Digest - 28 Jul 2008 to 29 Jul 2008 (#2008-203)

Thomas Boudier
Hi,

Thanks for all the reply, I'm afraid, for my problem, there is no
solution since it does not depend on ImageJ but rather on Java that
manages the List inside the RoiManager. My idea was to select two Rois
and then measure some distances between them via a plugin, so I wanted
the macro to be able to select two rois and then call the plugin. I will
look towards a workaround.

Anyway thanks everybody who helped.

Thomas

> Thomas,
>
> Not sure if this helps you out or not, but here is a function for measuring (separately) an arbitrary number of ROI manager selections listed by index in an array (code below).
>
> toby
>
> newImage("test", "8-bit Black", 128, 128, 1);
> makeRectangle(54, 35,10,10);
> roiManager("Add");
> makeRectangle(70, 70,10,10);
> roiManager("Add");
>
> rois = newArray(0, 1);
> measureSelections(rois);
> exit();
>
> // FUNCTIONS BELOW ================================
>
> function measureSelections(rois) {
>   for (i =0; i < rois.length; i++) {
>     roiManager("select",rois[i]);
>     roiManager("measure");
>   }
> }
>
>  
>> From:    Thomas Boudier <[hidden email]>
>> Subject: Re: roi select two rois
>>
>> Hi,
>>
>> I'm running ImageJ 1.41i on linux with java1.6.0_06, what I would like
>> is to select specifically two rois (to perform some computation on
>> them), when I run this code :
>>
>> roiManager("Select", 0);
>> setKeyDown("shift");
>> roiManager("Select", 1);
>> roiManager("measure");
>>
>>
>> I only have one measure instead of two. Not sure if the shift key
>> applies to the list inside roiManager or to Rois in the image where they
>> are combined.
>>
>> Thomas
>>    
>
>
>
>
> Toby C. Cornish, M.D., Ph.D.
> Pathology Resident
> Johns Hopkins Medical Institutions
> [hidden email]
>
>
>  


--
/*****************************************************/
 Thomas Boudier, MCU Université Pierre et Marie Curie
 UMR 7101 / IFR 83. Bat A 328, Campus Jussieu
 Tél : 01 44 27 35 78  Fax : 01 44 27 25 08
/*****************************************************/