Measure areas within multiple ROIs

Hi there,

I’m trying to measure the thresholded area within multiple ROIs at the same time and I want to obtain the measure of the single area within each ROI.
To be clear, for example, I want to measure the “red vacuole” within each of the 3 selected ROIs in the image below.

By using the “OR (combine)” option I obtained the measures of the single areas (as I need), but without any reference to the ROI from which they are derived (vacuole 1–>ROI 1, vacuole 2–>ROI 2, …).

If I do it manually (selecting each ROI at a time and measuring the thresholded area), in the results window, the measure is associated to “name of the image: ROI label”, but when I do all the ROIs together the ROI label disappear.

Any suggestions? Thanks!

Hello Lus -

It sounds like you want to use the ROI Manager:
Analyze > Tools > ROI Manager...

After selecting an ROI, you can either click “Add [t]” in the
ROI Manager or just type <Ctrl-t>. After you have added
multiple ROIs, you can click “Measure” in the ROI Manager,
and the Results Table will be populated with measurements
for each ROI separately. “Area” will be (by default) one of the
quantities measured.

I’m not sure exactly what you’re asking here. Do you still have
this problem if you use the ROI Manager to measure multiple
ROIs simultaneously? If so, could you give a more detailed
explanation of what you are trying to achieve and what issues
you face?

Thanks, mm


Something like this might work in this case…

count = roiManager("count");
for (i = 0; i < count; i++) {
	roiManager("Select", i);
	run("Clear Outside");
	run("Create Selection");
1 Like

Thanks for your response.
To be clearer, I expose you the scientific question:
I have histological images from skeletal muscle, representing myocytes (in the image they are pink, 3 of them encircled in orange). In most of the myocytes there is a vacuole (white hole within each cell). I want to obtain for each myocyte the total area of the myocyte and the area of the corresponding vacuole(s).

1)The first step I’ve already done was to add to the ROI manager all the ROIs encircling the myocytes and then measuring the area of each ROI.

2)The second step is to measure the area of the vacuole. For that purpose I obained a thresholded image in which white vacuoles are thresholded (red) and myocytes are not (black) (see fig. below, in which, as an example, I selected just the 3 ROIs (in green) corresponding to myocyte 1, 2 and 3).

Now, I select ROI1 in the ROI manager, analyze>analyze particles and I obtain the measure of vacuole 1. Then I do the same with ROI2, etc…
This is OK but because of the high number of measures I have to do, I was wondering if there is a way to measure all the vacuoles within all the ROIs, at one time.

I tried to do it by using the “OR(combine)” option in the ROI manager (I select all the ROIs, more>OR(combine), and again analyze>analyze particles). But I think it is not the correct way to do it.
With this I obtained the measures of all the vacuoles separately (the measure of each vacuole) as I wanted, but in the results table there isn’t the reference to the corresponding myocyte (for each measure the label is just the name of the image, while I would need name of the image+name of the ROI.

Thanks again,

Hello Lus -

If I understand your issue correctly, I think you are asking how
you can have a measurement in the Results Table explicitly
linked to a specific ROI, rather than having to deduce it from
which row in the Results Table the measurement is in.

If this is the case, you can include the ROIs’ labels as a column
in the Results Table:

Analyze > Set Measurements... and check “Display label”.

Here is a recorded ijm macro that illustrates this:

run("Blobs (25K)");
run("Set Measurements...", "area mean standard min display redirect=None decimal=3");
run("ROI Manager...");
makeRectangle(23, 13, 31, 34);
makeRectangle(169, 30, 24, 41);
makeRectangle(23, 153, 107, 101);
makeRectangle(191, 187, 17, 14);
saveAs("Results", "blobs_results.csv");

And here is the output (Results Table saved as a .csv file) from
running the macro:


Each row of measurements in the Results Table has a label in
the form “<image_name>:<ROI_name>”.

Does this do what you need?

Thanks, mm

Yes thanks!
I made some changes that allow me to directly measure the areas and now it works!
Thanks a lot,

1 Like