Creating a overlay/mask/roi from a binary image and overlaying it onto another In ImageJ

Hi all, I’m fairly new to ImageJ and what I want to do is very simple (in theory at least).

I want to create a mask from a binary image from one channel, overlay it onto another channel, and count nuclei that are only inside the mask. Seems simple, but I can’t get it to work. I will attach the two images. I know how to use particle analyzer to count the cells, but not how to create the mask and overlay it onto another image to only count nuceli within the mask. Any tips/ideas?

The red image is what will be used to make the threshold (the bright red areas are the areas I want to only count nuclei in).

Thank you!

Hi
@TissueEngineering
I am not a biologist and I do not understand what you want.

However, I propose this.

Can this be suitable? So

// Open the first image
setAutoThreshold("Default");
//run("Threshold...");
//setThreshold(80, 255);
setOption("BlackBackground", false);
run("Convert to Mask");
run("Invert");
run("Analyze Particles...", "clear add");
roiManager("Show All without labels");
// open the second image
roiManager("Show All without labels");
run("Flatten");

The macro is not very “clean” but it gives you a working track.
You could also use:
roiManager ( “Select” …);
then
run (“Restore Selection”);
Thank you for letting me know if this satisfies you.

2 Likes

And you may want to look into Weka segmentation or something with more context awareness, as the sections of your sample that go in and out of focus have very different intensities. Plus that blob of background? on the right could be problematic if it is frequent.

2 Likes