Extract fluoresence intensities from tiff file with 3000 circular spots

Dear

My name is Wim Trypsteen and I am a graduate student at Ghent University.
I have a specific imageJ image processing question:

I need to extract fluorescence intensities from a tiff file that has a picture of a slide with about 3000 circular spots.
How can I do this in ImageJ if at all possible?
This would require making a stencil/layout, overlap this with the tiff image and extract the fluorescent values of those 3000 circular spots.

Best
Wim

This is possible with the ROI Manager.

You can execute a particle analysis to detect the circular spots and add the particles to the ROI manager.

https://imagej.nih.gov/ij/docs/guide/146-30.html#toc-Subsection-30.2

https://imagej.nih.gov/ij/docs/guide/146-30.html#fig:The-ROI-Manager

The fluorescent values from each ROI can be extracted with the ImageJ API by iterating over each ROI in the ROI Manager.

https://imagej.nih.gov/ij/plugins/roi-iterator/index.html

I applied the API in my application (Bio7) to transfer ROI pixels from all ROI’s in the ROI Manager (of several layers) to the statistical package R.

Here an older example (action is now called ‘Pixel RM’ - see second example below):

This is used for example for supervised classification:

Thank you for the reply!

I had a look at but it is not really what I am after.
I have a atypic microarray layout of spots where I want to make a template with 3000 circles and overlay that with the tiff file image. Next I want to extract the fluoresence value of the overlapped premade circles.
Is this something I can do with your suggestion?

Best and thanks again for your time!
Wim

Yes you can do this easily with a scripting language (or ImageJ macro or Java).

For instance you can draw your ovals (i used double values here, see API) with JavaScript and add them to the ROI Manager:

    var ovalWidth = 10.0;
    var ovalHeight = 10.0;
    var ovalDist = 20.0;
    imp = IJ.createImage("Untitled", "8-bit white", 1000, 1000, 1);//Dummy image!
    imp.show();
    var rm = RoiManager.getInstance();
    if (rm == null) {
        rm = new RoiManager();
    }
    for (var dx = 0.0; dx < 1000; dx = dx + ovalDist) {
        for (var dy = 0.0; dy < 1000; dy = dy + ovalDist) {
            imp.setRoi(new OvalRoi(dx, dy, ovalWidth, ovalHeight));
            rm.addRoi(imp.getRoi());
        }
    }

    rm.runCommand(imp, "Show All");

From this ROI templates you can extract the pixel values as described earlier.

The ROI’s can be enabled on any other image again and the ROI Manager can save the ROI’s, too!

Wauw, thank you very much!
I could make my desired template :slight_smile:

So, now I made my template with the IJ.createImage function.
If I understand correctly, I can use these ROIs on the tiff image containing the 3000 spots and just press measure in the ROI manager, right?

Would there be a possibility to actually plot the ROIs on the tiff image, so I can visually check whether my template corresponds to the 3000 array spots? Probably I need to change the call to imp = … ?

Best
Wim

You don’t need to create an Image. This was just an example. Load your image(s) and then
you draw the selection unto your image with (instead of: IJ.createImage… - also remove imp.show()):

var imp = IJ.getImage();
imp.show();// remove - the image is already open!

Once you have created ROI’s in the ROI Manager they can be activated or deactivated on any other loaded
image as long as you don’t close the ROI Manager (see the ‘Show All’ action in the ROI Manager to visualize them - I did this in my example with the command rm.runCommand(imp, "Show All");.

If you press measure for each ROI you get the adjusted pixel measurements (see ‘Set Measurements’).

You could also select single ROI’s in the ROI Manager to measure only the selected (nothing selected measures all ROI’s).

As I descibed earlier it is also possible (if needed) to extract all single pixel values of a ROI with the ImageJ API. But I think you are after the mean?

Here you find some more examples about JavaScript:

Please note that the default imports are made automatically in ImageJ (see section ‘Importing classes’!).