Posted by
Jeremy Adler on
May 21, 2020; 5:52am
URL: http://imagej.273.s1.nabble.com/I-d-like-to-know-how-to-measure-all-ROIs-200000-500000-using-the-macro-as-fast-as-manual-measuring-tp5023346p5023347.html
Dear Hayato,
1)
you can avoid using the loop to populate the array
nRois=roiManager("count");// entries in ROI Manager.
testArray=Array.getSequence(nRois); // creates an array with nRois entries, numbered sequentially. from 0 upwards
roiManager("Select", testArray);// select all ROIs.
roiManager("Measure");// measure all ROIs.
2)
but I suspect the slow part is measuring and printing your 200,000+ ROIs and the results
so, consider where your ROIs came from,
if they came from a thresholded image and Analyze Particles,
the measurements can be made at the same time by selecting the Display results checkbox
3)
to check on how fast a part of your macro runs
add
timeBefore=getTime();// before part of the macro.
and
timeAfter=getTime();// after the part.
print("time ",timeAfter-timeBefore; //
Jeremy Adler
Uppsala U
-----Original Message-----
From: ImageJ Interest Group <
[hidden email]> On Behalf Of hatopop100
Sent: Thursday, May 21, 2020 5:51 AM
To:
[hidden email]
Subject: I'd like to know how to measure all ROIs (200000~500000) using the macro as fast as manual measuring.
Dear all,
I'd like to measure all ROIs (200000~500000) using the macro.
So, I performed the macro referred to the past post as below.
----------------------------------
count=roiManager("count");
array=newArray(count);
for(i=0; i<count;i++) {
array[i] = i;
}
roiManager("Select", array);
roiManager("Measure");
----------------------------------
But it worked very slow compared with the method manually select all ROIs and put on the "Measure" button on ROI Manager.
Because I have to measure many slices (each has 200000~500000 ROIs), I'd like to use the macro.
How should I do macro as fast as the manual method?
Sincerely,
Hayato
--
Sent from:
http://imagej.1557.x6.nabble.com/--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.htmlNär du har kontakt med oss på Uppsala universitet med e-post så innebär det att vi behandlar dina personuppgifter. För att läsa mer om hur vi gör det kan du läsa här:
http://www.uu.se/om-uu/dataskydd-personuppgifter/E-mailing Uppsala University means that we will process your personal data. For more information on how this is performed, please read here:
http://www.uu.se/en/about-uu/data-protection-policy--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html