Problem measuring fluorescence from retinal images

Dear All,
I am trying to measure fluorescence intensity of human retina with ImageJ.
I have 2 issues with that.

  1. I am not sure if my steps are correct?
  • set the area of measurement
  • set measurement with: SD, median, integrated density and mean gray value
  • measure
  1. I need to measure the fluorescence in two ROIs: 1cm and 3cm diameter circle (one within another) as on the provided example. Is there an elegant and quick way to do so as i have over 300 images to assess?

Anyone? Or am i asking the wrong question?
Is it possible to measure 2 ROIs at once, one within another and get 2 separate results in one action?
If yes, how?
Thanks,

I can’t tell whether “fluorescence intensity” is a good measure in your situation.

re 1.
I have no idea about the portion of fluorescence in the ROIs.
How do you expect to separate fluorescence form non-fluorescence in a ROI?
Is the gray-level mean really sufficient?

re 2.
I understand that you mean the two disc-shaped ROIs, not a ring-shaped.
You may use the ROI-manager or write a macro that measures in the two ROIs by sequentially defining them.

HTH a bit

Herbie

Thank you for reply Herbie.
re 1.
I want to quantify mean fluorescence of the given ROI therefore separation of fluorescence and non-fluorescence is not an issue.
Is the gray level mean sufficient? I don’t know.

re 2.
Yes. I mean 2 disc-shaped ROIs and measurement form the smaller inner one and bigger outer one.
I am trying to achieve this with ROI manager but without success so far. I am not able to bring both ROIs together on one image and get two separate results. Which option in ROI manager should i use?

Thanks,
Krystian

ps. Sorry for not introducing myself.

Here is a small macro produced from your screenshot with some comments.

First you have to set the scale in your image to measure it in µm, see:

https://imagej.net/docs/guide/146-30.html#toc-Subsection-30.8

You can use the macro recorder to integrate more commands in the script, see:

https://imagej.net/docs/guide/146-31.html#toc-Subsection-31.1

ImageJ Macro API:

http://rsb.info.nih.gov/ij/developer/macro/functions.html

If all of your images have an equal size you can automatize that and center two Oval selections on your image by calculating the pixel dimensions from the scale because the Ovals are set in image pixels:

//Please detect your own scale!!!!!!!!!

makeLine(10, 563, 22, 564);
run("Set Scale...", "known=200 unit=µm");

//Set the measurements
run("Set Measurements...", "area mean centroid integrated median redirect=None decimal=3");

//Get the scale values to calculate the size for the Oval ROI's!
getPixelSize(unit, pw, ph, pd);

//Calculate the ROI dimensions in pixel (0.3 and 0.1 cm)
ovalSizeBig=3000/pw
ovalSizeSmall=1000/pw

//Set the selections and measure them with the before adjusted measurements!
makeOval((getWidth()/2)-(ovalSizeBig/2), (getHeight()/2)-(ovalSizeBig/2), ovalSizeBig, ovalSizeBig);
run("Measure");
makeOval((getWidth()/2)-(ovalSizeSmall/2), (getHeight()/2)-(ovalSizeSmall/2), ovalSizeSmall, ovalSizeSmall);
run("Measure");

Apply your modified macro to a folder of images with the Batch converter:

https://imagej.net/docs/guide/146-29.html#sub:Batch

(See 29.12.3)

If the Oval selections should not be centered in the image (if the retina is not centered) some other techniques have to be applied to extract the center of measurements.

You can also leave out the first two commands of the macro and set the scale before any macro is executed with the option “Global” applied, see again:

https://imagej.net/docs/guide/146-30.html#toc-Subsection-30.8

2 Likes

Dear Krystian,

here is a short macro that assumes that the inner circular selection is already drawn:

run("Set Measurements...", "mean standard integrated median redirect=None decimal=3");
//run("8-bit");
run("Measure");
getSelectionBounds( x, y, w, h );
run("Enlarge...", "enlarge=" +  w );
run("Measure");

Paste the macro to an empty macro window (Plugins > New > Macro) and run it.

Do your images contain color information?
If not, use run(“8-bit”); i.e. remove “//”.

HTH

Herbie

2 Likes

Hi @oasisman

The advice given by @anon96376101 and @Bio7 is good. And you should be able to accomplish your measurements now

Are the images always centered? If not you will have to adjust each ROI slightly. I have worked on a few applications (including one involving retinal images) where I have to copy an ROI to hundred(s) of images and then make slight adjustments. I’d be happy to share details if you need them.

1 Like

No need to apologize. Actually, according to the forum guidelines, it is better not to write greetings at the beginning and/or end of each post. We all have usernames, so who is talking is always known already.

4 Likes

Good day Curtis,

maybe I’m old-fashioned but I think using the real name, not an avatar, is a question of politeness but there are other reasons as well.

There are quite a number of people on forums and lists who want to hide that they gain their knowledge from others … This however, is bad scientific practice.

Best

Herbie

Thanks @bnorthan
Unfortunately the images are not always centered and ROIs definitely will need adjusting. Any advise on that?

Unfortunately I am not able to enter any of the guide entries as i am getting an SSL_ERROR_RX_RECORD_TOO_LONG error in web browsers (most likely ISP issue). Any other method to access guide?

All images are exactly the same resolution but not all of them are centered.

Regarding your macro:

I checked scale on the example image in the 200µm marker area. When i counted pixel manually it was 15pixels=200µm. When measured with straight line and used set scale it counted 15,9 pixels. Not sure why the difference and how to adjust it in the macro?
I neede measurement 1000µm and 3000µm zone so i thought 75pixel diameter oval and 225pixel diamter oval?
Where do I input that in the macro? Or is it done here?

Try this:

http://imagej.net/docs/guide/

Well, use the macro recorder of ImageJ as already noted. It will record all actions from which you can create your own macro. If your draw you line for the scale it will give you the command which you can put in your macro instead of my command, since I don’t have the original image.

Just exchange the following first line with your scale.

makeLine(6, 562, 18, 562);
run("Set Scale...", "known=200 unit=µm");

The commands will calculate the required size of the Ovals automatically since the pw gives you the pixel size.

//Get the scale values to calculate the size for the Oval ROI's!
getPixelSize(unit, pw, ph, pd);

//Calculate the ROI dimensions in pixel (0.3 and 0.1 cm)
ovalSizeBig=3000/pw
ovalSizeSmall=1000/pw

getPixelSize(unit, pixelWidth, pixelHeight)
Returns the unit of length (as a string) and the pixel dimensions.

So we ask here: How many pixels in the image correspond to, e.g. 0.3 cm and from that draw the Oval.

See: http://imagej.net/developer/macro/functions.html#G

You can easily control it by drawing a line and measure the diameter.

1 Like

Hi @oasisman

Here is my workflow for placing and adjusting a ‘template’ ROI on a lot of images. This assumes you have to make adjustments to each one, otherwise you could write a macro to just copy the ROI.

  1. Put all images in the same directory.

  2. Open the first, draw the ROI.

  3. Adjust ROI as needed

  4. Ctrls to save

  5. CtrlShifto to open next image

  6. The ROI should automatically be placed in the same location on the new image

  7. keep repeating steps 3 to 6 until you’re finished all the images.

1 Like

OK, so i did as you advised with setting scale/recording/updating your proposed macro. Now i am getting results for the correct size of ROIs. The only problem is on a new images the initial ROI (smaller oval) is slightly of center (needs adjustment). I am doing that manually but when i run the macro it measures the original (of center) area. I suspect that’s because there is a fixed position of the ROIs in the first line of macro?
Is it possible to make the macro would take into account the modified position of ROI?

Herbie,
There is no colour info. Updated the macro as you advised.
When i run it though, the second measurement is from ROI that is slightly bigger than the initial one, not three times bigger as i need. I presume i need to make changes here:

but not sure how.

Krystian

Yes it has a fixed position.It is the center of the image calculated from the height and width of the image.

Please have a look at the API to adjust the Oval accordingly.

Also @bnorthan proposed a nice workflow which you can take into account.

Dear Krystian,

I can’t confirm your finding.
With my example macro the large ROI is exactly three times the small one. This holds for circles and ellipses.

However, the ROIs in your example image are slightly different:
The small one has a diameter of about 44 pel and the large one, which is not perfectly concentric, shows a diameter of about 130 pel.

HTH

Herbie

Thanks for all your response. Really helpful.

1 Like