Trying to batch detect worm in one image, measure its fluorescence in another

Hi there,

I’m brand new to ImageJ and, after two weeks of trying to figure this out on my own, I’ve decided to ask for help.

I’m doing a mutagenesis screen in worms with fluorescence as my reporter. This means that when I have a hit, the worm stops fluorescing. This is looking for a dark needle in a dark haystack, and I was hoping ImageJ could help me automate the load.

Essentially, I take two images of many worms in the same field, a brightfield and a fluorescent image, in quick succession. Then, I want to automate ImageJ to locate and outline/select the worms in the brightfield image, and then run(“measure”) on each of the worms in the fluorescent image. Thus, a worm is detected in the brightfield image and, should it measure at nearly the same brightness as it’s background in the fluorescent image, it’s a hit!

So far, I’m opening images as a stack, running subtract background and threshold on the brightfield and getting selections, but I can’t seem to figure out how to identify each worm, and then analyze it in the other image. Can anyone please help me?? I have this feeling that the answer is obnoxiously obvious and that I’m missing it due to inexperience with this program…

Thanks in advance!

Hello Lindy and welcome to the ImageJ forum!

Can you post some sample images here so we can find the solution that fits the best your problem?




Above are the two images. There’s a brightfield and a fluorescence. I need ImageJ to be able to find a worm in the brightfield and measure it in the fluorescence.

Here’s how far I’ve gotten:

  • Open as stack
  • Subtract background from brightfield
  • threshold the brightfield
    (here onwards is where I’ve been struggling)
  • Used Analyze particles to get the outlines of just the big worms

The point is to be able to identify worms like the one the very top of the image. That worm exists in the brightfield, but has no signal in the fluorescence.

I see, following your steps I get something like this:

If you are only interested in the big warms, you can filter them by size using the “Size (pixel^2)” parameter of “Analyze Particles”.

Also, remember to check the “Add to manager” option so the selections get added to the ROI manger and you can reuse them later in the fluorescent image by clicking on them in the manager.

Does it make sense?

Instead of using the ROI Manager as suggested by @iarganda, you can also Analyze > Set Measurements… to Redirect to your fluorescence image, then Analyze particles will directly give you the fluorescence intensity for each object you segmented on the brightfield channel.

1 Like

Thank you both! It worked! Now I just have to automate it and program it to batch run, but I think I can handle that.

Here is my macro script, for anyone else looking for something similar:

run(“Image Sequence…”, “open=/Users/YOUR_PATH_HERE sort”);
run(“Subtract Background…”, “rolling=50 light slice”);
setAutoThreshold(“Default dark”);
//setThreshold(157, 255);
setOption(“BlackBackground”, false);
run(“Convert to Mask”, “method=Default background=Dark calculate only”);
run(“Analyze Particles…”, “size=800-Infinity clear add slice”);
run(“Next Slice [>]”);
saveAs(“Results”, “/Users/YOUR_PATH_HERE/Results.xls”);

1 Like