Worm (mostly nematode) eggs - tips?


Hi all,

I’m new to this software. It looks pretty comprehensive and seems to get good reviews, but there’s clearly quite a learning curve when you’re new.

I was wondering if you had any tips on how to set up a pipeline for identifying worm eggs (mostly nematode genera from farm animals) in images. I have tried adapting one of the template pipelines but I’ve had no luck. It seems to ignore the eggs and instead draw irregular divisions based on invisible background gradients, so the result looks more like a country map of Europe. I’m guessing that finding the right threshold may be part of the issue?

My microscope images are 2592x1944 px, colour, 24 bit. The worm egg dimensions range roughly from about 200-600px long and 110-250px wide (covering a variety of genera). I’ll attach an example one once I work out how. [Update: I can’t see a way of doing that!]

Many thanks for your help!



Hi there, we will definitely need to see an image to be helpful (even better if you can attach the image and pipeline you tried so far!) You should be able to drag and drop the image into the message box when replying, can you give that a try?


Thanks Anne!

The pipeline I already tried was the Human Cells one, from your examples.

The original tiff images were too big to upload here (11-12 MB) so I’ve saved them as jpegs, which are much smaller.

This one has a lot more background noise:

I hope that helps!



Neat! To be safe, I want to check that each of these images has a single oval-shaped egg, right?

I would suggest

  1. first use ColorToGray to either split or merge the three color channels into a single gray image. You can play around with those choices to find the result where the egg is darkest and the background is lightest (i.e. it enhances the contrast the best).

  2. Then use the ImageMath module to invert the intensities of the image (turn the white background into black and the black eggs into white: just select Invert and leave all the other settings at default, I believe). This is necessary for IdentifyPrimaryObjects to work well.

  3. From there you could use a more typical pipeline: IdentifyPrimaryObjects and then likely MeasureObjectAreaShape + FilterObjects to remove debris that is not nicely oval-shaped.

Want to give that a try?


That worked! Thank you so much!

This pipeline found the egg. It also picked up 5 irregularly-shaped pieces of junk in the image but I think I can add a manual select module to get rid of those. Unless there’s some module that allows me to filter for only ovals?

Happy with the progress so far. Thanks again!



Super, you are close!

Goodness, no, you need not add a manual step! :smile:

Just use the MeasureObjectAreaShape to measure the candidate objects (including the junk) and then use FilterObjects to remove debris that is not nicely oval-shaped. The help for MeasureObjectAreaShape will explain what metrics are good for objects that are smoothly oval vs irregular, probably there are several options that will work.



Thanks Anne :slight_smile:

Just to be sure, is the module you mentioned called MeasureObjectSizeShape? I couldn’t find one called MeasureObjectAreaShape and assumed the former is what you meant.

Unfortunately I couldn’t find much in the help to do with using that module, but maybe I’m looking in the wrong place. The ‘?’ button only brings up generic information. I guess I have to ask it to calculate Zernike features?

In the FilterObjects module there’s an option to then filter by AreaShape, but I couldn’t see any explanation of which I should use to filter for only regularly shaped objects. I know compactness measures roundness, but I figure that’s more for assessing circle vs oval than oval vs irregular shape.

Sorry for being a pain, and thanks for your help!



Hi Wayne,

If you look at the “generic” help information for MeasureObjectSizeShape, it defines each of the measurements- I’m guessing something like FormFactor, Extent, Compactness, Solidity is going to be best to define which of your objects are good vs bad (almost certainly not Zernikes). What I often do in this situation is to use a DisplayDataOnImage module to look at the different measurements being made and overlay them on each object to get an idea of what is the best filter to pick that is well-separated between your good and bad objects; once you’ve picked it and set it in FilterObjects, you can then delete or disable the DisplayDataOnImage module.

Does that help?