Need help on ExampleYeastColonies_BT_PIPE.mat


First of all I would like to thank the great effort you are doing. I really appreciate it.

Second, I would like to ask if you can help me with a couple of issues:

I am trying to count the number of yeast colonies on agar plates. I have set up a device where I illuminate the plates from underneath in a dark room, and where the camera and the plates are always in the same position. That gives me a light background, so I have included a module to invert the color of the plate. I have adjusted the parameters of the pipeline ExampleYeastColonies_BT_PIPE.mat so that it does a pretty good job in counting the colonies (pipeline attached: ContarColoniasFondoBlancoPIPE.mat). The problems starts here:
The plasticware has a plastic rim underneath the plate that shows on the photos like an inner rim, and the program counts its pixels like colonies (see SANY0070_outlines.png). I cannot get rid of the plastic rim, so I thought of subtracting it: I took a photo of an empty plate (SANY0075.JPG), colored in red the inner rim (PlateTemplateRed.png) and tried to subtract it. And that’s where I got stuck. I’ve tried so many different combinations that I’ve lost track, and I don’t know what I am doing wrong. I think I should first align the images, but I get an error that it should be black and white. Nevertheless it tells me that it’s going to convert my image to B&N and then use the correction to align the color image. Then I’ve tried to subtract the red from the red original image (CropRedPlate), but I get the program to count even more accurately the pixels of the rim. So, I’ve tried adding it, with the same result!!!. I’ve converted the image with the red rim into an image with the rim in green and blue (PlateTemplateNORed.png), in an attempt to subtract or to add to the CropCombined, with no luck…I know I MUST be making some mistake, because my logic and the little I have managed to learn of the program tells me that it can be done this way, but I give up and I want to ask if you can give me a little push.

The other issue, very minor, is that I only need the program to count for me the number of colonies, I do not need all the additional information, and I’ve looked arround to see if I could remove the rest, but with not much success. It’s not too important, so if it gets complicated or are very busy, ignore this one, but if its not a big effort, then the program would be absolutely perfect for my needs!

I attach a couple of plates. You will observe that the colonies I have vary extremely in size (from 1 to 20 pixels), because of the treatment. I know it’s not the prefered format, but the cammera takes JPG pictures, so that’s what I send you. If you’d rather me converting them, tell me and I’ll do it!
ContarColoniasFondoBlancoPIPE.mat (2.67 KB)ContarColoniasFondoBlancoPIPE.mat (2.67 KB)

Sorry, I got mixed up and sent you the .mat file twice ??
I attach here just the typical plate I am trying to set up the program for and the normal PlateTemplate file I have used.
I’m using Windows XP 32 bits (that’s what we have at work…) and cell profiler 1.0.7522 Compiled.

Thanks a lot again!


Since you are trying to remove the plastic rim from the plate, you could take the PlateTemplate image (from PlateTemplate070.png) and insert a Morph module between Align and Crop.

The Morph module performs various morphological operations on images, one of which is image erosion which trims a given number of pixels off the edge of a binary image. So set the input image to Morph module as AlignedPlate, the output as AlignedPlate as well, the function as ‘erode’ and the number of repetitions as the number of pixels wide that the rim is (this part may require some trial and error).

The IdentifyPrimAutomatic module generates the colony count so you don’t need the MeasureObjectIntensity, MeasureObjectAreaShape or ClassifyObjects modules.

Hope this helps!

Hi, Mark!

Thanks a lot for your reply!. I’m sorry I took so long in replying you, but I’ve been away from my PC for the whole Christmas Hollidays. I’ve looked into the Morph suggestion you gave me, but it seems not to be the solution to my problem. I’m sorry for my English, I will try to explain myself better. You see, I could also just trim the template with GIMP or any other imaging program. The problem when trimming is that I loose all the colonies that fall between the inner rim and the edge, which can be a whole lot of them in some instances. That’s why I tried to substract the inner rim. What I am trying to do is to lower the intensity of those pixels that conform the inner rim, so that, if there is a colony, the intensity will still be higher than the background, whereas if there is no colony the intensity will be the same as the background. It’s like the inner rim is an additional background that is always on the same area, and I have to tell the computer that those pixels in that intensity are background. As if I could measure the texture of the inner rim, and subtract it from all the plates before identifying colonies. Do you understand what I’m trying to explain?


I’ve attached a pipeline which is an attempt at subtracting the empty plate from the original; I will leave it to you to modify it and insert it into the your full pipeline. Basically, it aligns the two images, subtracts the empty plate from the experiment plate and crops the result.

Note that subtraction is not perfect; you can still see the rim lines, although they are dimmer. This is most likely due to the difference in illumination between the two images. Also note that even if the image illumination was perfectly matched, the colonies bisected by the rim line would be cut in half upon subtraction, so your count may still not be accurate.

One item of note is that there is a bug in the subtract functionality of ImageMath: although it says the result is X-Y, it’s actually Y-X, so I needed reversed the operands.

PlateSubtractionPIPE.mat (1.62 KB)