Problem in measuring the area

Hi,
I am using a pipeline mainly to measure the area occupied by the fungus. But sometimes it doesn’t work for the cultures which has different intensities within the area occupied.Could anyone help me figuring out the problem. I am attaching the pipeline and the 2 images one of which is working fine and the other is not. I have to get the area occupied within the outer white line. It would be a great help if I get some feedback .
Thanks,
Suchi.





basic.cp (6.6 KB)

Hi Suchi,

Unfortunately, your pipeline doesn’t work with the images posted. The input folder specified in LoadImages doesn’t exist on my computer, the text that specifies the files doesn’t match the images you uploaded and the elliptical coordinates in the Crop module do not seem to match the region of interest. Could you check the settings and/or the images and re-post?

Thanks!
-Mark

Hi Mark,
Thanks for your reply.And I am sorry for the inconvenience. I am sending you the pipeline again. Actually I am trying to design the pipeline in a way so that i can feed more images at a time. But what i saw is that, I had to change the cropping diameter depending on the area occupied by the fungus and also the threshold correction factor every time. I am really looking for a solution for that. I have a lot of similar images I am sending you some of them having different diameters. Could you kindly suggest me the way to design the pipeline, so that I could run all of them together or atleast some of them having similar diameter range together?
I am attaching the pipeline and 4 images. Day4_P1 should work for this pipeline. but the rest are not.

Thanks again for the help.
Regards,
Suchi.
basicMod.cp (6.62 KB)








Thanks for the images. I take it what you are trying to do is determine the size of the fungal mass, correct?

If so, coming up with a solution that fits the full range of fungus you have here would be difficult since the primary challenge is coming up with a way to distinguish the fungus from the dish itself. This might be possible in the cases where the fungus occupies the center of the dish; the reddish agar could then be used to distinguish the fungus. But in the Day9 image, the fungus takes up the entire dish and no agar is visible, so this approach would not work.

The best approach I think would be the one illustrated in the yeast colony example available from our Examples page. The example pipeline simply uses a binary image in the size/shape of the agar area; you will need to make one approapriate for your dishes.

I’m attaching a pipeline and first pass at a template image (which you should adjust). Another warning: the Day4 images seems to have different dimensions than the others. For this to work properly, your images should be the same size, acquired in exactly the same way (magnification, zoom, etc). This template image will work with the Day6, 7 and 9 images since they are the same size.

Regards,
-Mark
2011_01_04.cp (8.55 KB)


Hi Mark,
Thanks for your reply. You are right, I am trying to measure the area occupied by the fungal colony. I just tried the pipeline you sent but couldn’t run it for Day7 image as it is selecting the full plate as the primary object.I tried the template image first and then tried with my images.Could you kindly make it clear how should I try? I mean to get the region within the white outline as primary object. Or I did something wrong?
I know, there is some problem with the size of the images which i am trying to get images having same size. But, can I run the images having same size with this pipeline at a time?

Thanks and Regards,
Suchi

Hi Suchi,

I’m sorry, I should have been more specific on the use of the pipeline. Please note the following:

  • The template is automatically loaded using the second module, LoadSingleImage. So you don’t need to specify it in LoadImages, if that was what you were doing.

  • To use LoadSingleImage, you must point it at the location you saved the template image to.

  • In LoadImages, specify your original fungal ‘Day’ images as you were before.

I tried it for the Day7 image and it seems to be working correctly (more or less; see the attached image).

If the images are the same size and the dish are acquired at the same resolution as well, then yes, you should able to run through multiple images with one pipeline.

Regards,
-Mark


Hi Mark,
Thank you so much. It worked for that image. But I am sorry to bother you once more. It doesn’t work with the other images of day 9 and some other(having the same size, resolution etc.) in which the fungus reached the edge of the plate. In these cases it should give the same area measurements, right? So could you kindly suggest me whether there is any trick to get the area of the whole plate covered by the fungus? So that I could run those pictures in the pipeline?
I am attaching the images I mentioned(not working).
Thanks,






It seems that the threshold is not lenient enough so it is not capturing enough of the foreground if the cropped area is mostly fungus. You may want to try changing the threshold method from Otsu 2-class thresholding to instead 3-class thresholding with the middle class set to foreground.
-Mark

Thank you so much Mark. It worked. :smiley:

Hi Mark,
Sorry for bothering you once more.
Actually I was trying to use the pipeline for the other images having smaller area occupied by the fungus. Could you give me some clue to manipulate the primary object selection module. Actually what I am doing right now is, just trying to manipulate arbitrarily. Sometimes don’t get the complete idea from the module help. So if you could kindly help me to design the pipeline for these images also it would be really a great help for me. I am sending you the images and the pipeline(slightly changed). It’s working but taking the reflected line included in the object. Please do also mention whether we have to change the object diameter for different object size or we can keep a fixed range.How does it work?
One more thing, could you explain me why did you loaded the template image? is it only to resize the image?
Regards,
Suchi
Mark’sSmallerarea.cp (8.55 KB)






Since the stripe is quite a bit lighter than the fungus, I would suggest adjusting the threshold correction factor upwards (perhaps around 1.5 or so?) until the stripe disappears. This may affect results for other timepoints, so you are probably better served by adjusting the lighting during acquisition so that the stripe does not overlay the fungus.

You should adjust the min/max range in suit the size range of fungi you expect. I assume this should cover the smallest size on day 1 to the largest size when it covers the full dish. Anything that is lower or higher than these values will be discarded. This is useful when there are spurious small objects being detected that you don’t want to count; these are outlined in red on the lower-left panel on the display window.

Also, I suggest unchecking “Discard objects on the image edge”. This setting also applies to objects touching the cropped border, so if the fungus touches it and the setting is checked, the whole thing will get tossed out. If you find that the edge of the dish is being identified incorrectly, I suggest either

  • Adjusting the template binary disk so that it is smaller, and hence will crop less of the plate.
  • Adjust the maximum diameter value down so the edge object gets excluded. For example, going from 500 to 300 seemed to work for Day3_P1.

The template image is required to align the agar-filled portion of the dish; the binary image should be sized to that region of the image. Since the dish can located anywhere in the image, the Align module used with the template helps ensure that correct area is cropped and used for identification.

Regards,
-Mark

Hi Mark,
Thank you so much for the detail explanation. I really appreciate this.
Regards,
Suchi.

H,
Here I am again with my problem in measuring area. Last time I got a very good solution from Mark for my pipeline that I am using for measuring the area of my plates. Using a template really worked nice. But It’s taking a lot of time for a single picture. Now I started working with smaller plates and Using the same pipeline making a template for the smaller plate. But I am again in the same problem. every time I am supposed to change either the threshold or the diameter range. This time I took images having the same sizes without changing the zoom or other factors. Still I can not run the pipeline. I am attaching some pictures having different diameters. Could you please help me to figure out the exact pipeline to run multiple images together?
I am really grateful to the forum for the kind co operation. At the same time sorry for bothering all the time with my problems.

Thanks again,
Suchi.










Hi Mark,
Sorry for the bothering. I have one more question, should I use the module Enhance/suppress feature to this pipeline to make sure it doesn’t pick up the area outside the fungal diameter zone? Could you please give me a solution for this? I am still struggling with the pipeline to make it run several images together.

Thanks,
Suchi.

Hi Suchi,

You may want to try re-doing your template so that it is a circle that occupies the area within the inner plate edge. You may notice that the ExampleYeastColonies_BT_Images example does this. The reason is that the plate edges show up as light features which throw off the fungus detection.

Regards,
-Mark

Hi Mark,
I reied to do the template as you suggested but I am sorry it did not help. May be I am wrong in doing that step. I am attaching the template. Could you please see whether it works in any other way?
Please help me out.
Thanks,
Suchi.


Hi,
I just found that the pipeline is even getting still when it’s coming to the “color to gray” option. It doesn’t do anything further!!! this is really strange to me. Mark, Could you please see the problem and kindly explain me what is going on?





Mark’sFinal2.cp (8.55 KB)

Hi Suchi,

It seems that the binary template is still not big enough. I’m concerned that the use of a binary template may not be sufficient in your case. I think you have two options:

  • Try the attached pipeline (it’s compatible with the latest version of CP, available from your website). It shrinks the binary circle by a few pixels which may be enough to get the Align module to work.

  • If this doesn’t work consistently for your images, the alternative is to use a different template image. I would suggest obtaining a single image of a plate with no fungus (only agar), acquired under the same conditions as the other images. Use this image to create another image containing a binary circle of the appropriate size. The idea here is that alignment may work better with an image that is more similar to the experimental images than the binary circle we’ve been using. Then, in the Align module, when new template is aligned, the binary circle can be added and aligned similarly, placing it in the correct position for masking.

Also, the max diameter in IdentifyPrimaryObjects needed to be increased to find the larger fungal colonies.

I’m not sure what you mean by “getting still.” Do you mean that the pipeline is no longer executing and doesn’t give you an error? If that’s the case, could you take a look at the command window (assuming you’re using a Windows computer, it’s the black window that opens before the main interface appears) and let me know what it says when this happens?

Regards,
-Mark
2011_03_10.cp (10.2 KB)

Hi Mark,
Thanks for your reply. The problem with the pipeline is already solved when I downloaded the latest version. Before it was giving some error message (which I mentioned in the “error message” topic already) and was not running further while it was reaching the color to gray option.
I just tried the pipeline you posted. It is able to identify the object if I make the lower threshold 0.001. But with lower limit 0 it doesn’t identify the object. even with the 0.001 lower threshold it is getting some other artifacts. You said that, I have to increase the diameter to get larger colonies. Do you mean I can not use the same pipeline for all the plates having same size? And also I was using a template having smaller diameter than the original plate, as you suggested in your last post. If I take the picture of an empty plate will it be possible to get rid of the reflection of the edge? Though i am not much worried about the light reflection at the edge as we are developing our new studio very soon to get rid of all these reflections. But I am really trying to fix a single pipeline to run all the images together. Could you please also explain why we are using “expand or shrink object”? I could not get a clear idea from the help module. Is there any other way to get rid of the smaller objects (artifacts) the pipeline is identifying along with the fungal area.
Thanks and regards.
Suchi.

Hi,
I have one more confusion. In the output file does the pipeline make an average of the area occupied by the different objects? I mean while it is identifying some other artifacts besides the fungal colony I am trying to get the area of the fungus but i can see it is just giving one measurement. I am getting …AreaOccupied_AreaOccupied_Primary, AreaOccupied_TotalArea_Primary, FileName_P1, FileName_template in successive columns. I have selected from Export to data sheet option the area occupied and the file name only. Could you please explain how to just get the area occupied by the different objects separately. So that even it measures other artifacts I can be able to get the fungal area.
Suchi.