Issues regarding identifying objects of pupae

Hi there,

I\m new to this amazing software. However, i\m having some issues to identify and measure pupae of flies. There is a successful example of identifying pupae here, in that topic the pipeline is also attached. Please see here Extending the use of WormTools to Drosophila Pupae

But idon\t know why this pipeline does not fit my images. It would be great if someone here could help me figure out. :wink: :smile: The image is attached.

ps, The purpose of my study is to identify all pupae and measure the size (area or height), and rank them according to the measurements. I know that it could be able to measure and show the data on image, but do we also have a ranking function, where enable the image only display the biggest ones?
ps, the image is taken by cellphone under the lights. We can easily find the shade, will this affect the measurement and how can we remove?

Best from Long

HI long

have you looked at the pipeline and test files that are attached as supplementary files to this paper?

Zhang, Wenyu, Guy Richard Reeves, and Diethard Tautz. “Identification of a Genetic Network for an Ecologically Relevant Behavioural Phenotype in Drosophila Melanogaster .” Molecular Ecology 29, no. 3 (February 2020): 502–18.

Note that you will need to invert (ImageMath module ) the image to get the IdentifyPrimaryObjects to work easily.

Start of a with a pipeline ImageMath-invert > IdentifyPrimaryObjects. once you have this working you are 90% there.
Your image looks like it should be easy to do do what you want. We have done this for 1000s of much more difficult images than yours- the contrast of your looks really excellent.

1 Like

Dear Dr. Reeves,

Thanks for your nice suggestion. :smile: :blush: it works much better when having the ImageMath included, though there is still lacking of precision. It is the paper that guided me find cell profiler, thanks for sharing. I think more pre image processes are required to enhance the precision of measurement.

ps I have analyzed another image of pupa (see below), wanted to test how the distance in between camera and the pupa affects the measurement.

Those pupae are having the same size of length, however the results show as least three issues>

  1. Failed to identify all objects
  2. The shade from lights is considered as part of the objects
  3. The measured length of pupae differs enormously
    pupae area

used pipeline>BSFpipeline.cppipe (6.8 KB)

Do you have any good suggestions?
Thanks in advance :smile:



I think we should stick with this image, the other is more problematic. Spend a bit of time trying to get a set up where you get black pupae on a white background (minimal shadows and reflections). We use a light source under the pupae and a camera above. What you have above is quite good. I have not tried to set the thresholding methods accurately as this will need to be done based on the variability across several images (also if you are going to let pupae touch you will need to use the UntangleWorms module and make a model which is complex). This pipeline does what you want in that it identifies a candidate longest one.

This the pipeline
long01.cpproj (653.4 KB)

outlines and numbers in the “MyExpt_IdentifySecondaryObjects.csv”

this one maybe is the longest one that is not touching the edge or another pupae.

I am sure you can improve on this, but the place to save time is in getting a good set up for photos, using a phone is not a problem.

good luck

Dear Dr. Reeves,

I really appreciate for your kind assistance. It looks amazing with your improved pipeline. Thanks :hugs:

Wish you the very best

1 Like

by the way it is often a good idea (particularly if you are using a camera that might be moved, or if the focus or zoom cannot be fixed-- like a phone–), to always include an object of known size in the image. This makes it possible to compare across images if you need to. We use a 1cent € coin painted black and have a part of the pipeline measure it for every image.
This can save you a lot of hassle in longer projects, so consider it at the beginning.

That is a really nice suggestion in relation to my concerns regarding camera. That’s the reason why i tested for pupae with the same size. Thanks :blush: