Target certain cells and automation running

Hello everyone,

I’m a quite new Fiji user, and have met some problem while using Fiji.

I’m using Fiji to analyze the inflammation status of PBMC cell.
I have 3 individual color pictures. (Blue - Nuclei; Green - NF-ϰB; Red - Cytoplasm)

Basically, my idea is to use blue color picture to target the wanted cells (about 10 cells), then compare the area of green and red at the same location (wanted cells) to distinguish if it’s a inflammatory cell or not.

Procedure will be applied for 3 color pictures

  1. transfer pictures to 8 byte
  2. Adjust - threshold - default red
  3. Analyze - Analyze particle - Size around 4000 to 9000

Pictures will be like this -

I used “Wand (tracing tool)” to choose qualified (or target) cells on red and green color picture manually based on the target cells on blue color picture since it’s comparatively clear. Then used ROI to calculate the area of green and red color of the target cell, and use the Area (Green)/Area (Red) to determine the degree of inflammation.

However, since I have almost 1000 pictures to be analyzed, it takes forever to do it manually and I don’t have a strong coding background to write the command for automation. Thus, I came here for help.

  1. How to put a command to randomly choose 10 cells from blue picture
  2. How to apply ROI manager on the red and green color cells, based on the 10 cells chosen from the blue picture


Do you need this to work on command line or can it work with a graphical user interface (And take over your computer while it runs) The issue is the ROI manager, the command codes to automate this are slightly different depending on how you will run it.

Hi Susan,

Thanks for the response!
I need this to work on command line.

Sorry I got busy with my own stuff. Let me start by saying, I’m not an expert on this. I think I would try to do this in a different order. Run analyze particles and identify all the blue cells making sure to use the show overlay option. Then you can make a loop . Something like below: the random part I do not have experience with. I think, you could be able to make a new array with size “n” being all the count of everything in the roiManager. then use the random function to select a random number from the array. do this 10 times in a loop with the open other image and select roi code snip its and you are there. This might be something to consider. while you certainly could not get measurements for all by hand, if your asking the computer do it it, it easily can and in this case might be easier. Does that get you more robust data by exploring all your cells in you image?

run(“Analyze Particles…”, “show=Overlay”);
print(“ROI_number=” + n);
if (roiManager(“count”)==0)
print(“No Object found”);
else if(i<=roiManager(“count”))
print(“Name of path reading files from dir2”,path2);
roiManager(“Select”,i );