Error in MaskImage module when trying to count colonies based on yeast colony tutorial


I am performing an assay that requires counting of fixed, crystal violet stained colonies in a 10cm plate format (see example picture of plate and plate template below, with original picture converted to grayscale to reduce processing time), ideally in an automated, non-biased way. Because the colonies are similar to those described in the yeast colony counting tutorial, I have attempted to adapt that pipeline for my purposes, with some simplifications since I do not particularly care about distinguishing color. I have attached the .cpproject file as well. The first few steps seem to work well (CorrectIlluminationCalculate, CorrectIllumination Apply, and Align [though this step is quite slow]) but when it gets to the MaskImage step I get the following error:

“Error while processing MaskImage: boolean index did not match indexed array along dimension 0; dimension is 2722 but corresponding boolean dimension is 2681.”

I am not sure why this is, as the plate template was derived from this particular image, and the alignment step should fix this, I thought? Any tips or suggestions would be appreciated, as I would like to get the pipeline working so I can launch it on all my images.


transposase_assay_test_v1.cpproj (981.4 KB)

Hi Rachel,
You’re aligning the picture to the template- try swapping the order and aligning the template to the plate and see if that helps. Good luck!

Hi @bcimini – can you please explain how to swap the order and align the template to the plate? I am having the same issue as the original post, but am not able to fix it.

I currently have the original settings from the pipeline. Therefore, in the Align tab, my first input image is PlateTemplate and the output is AlignedPlate. Then, my second Input is CorrRed, and second output is AlignedRed. My “additional image” is CombinedImage, and my output is AlignedCombined.


Sorry to hear you’re having issues! Can you post the exact pipeline and images that you’re using that are causing this problem? That will make it easiest for us to figure out the issue and help get it fixed for you. Thanks!

Hi, @bcimini thank you for your reply!

I am using the example pipeline, ExampleYeastColonies.cppipe.

The only images I inputted to the pipeline was a single image of my yeast colonies on a plate, and then also the template plate circle that came with the example pipeline. (Both attached).

The only setting I changed in the pipeline to run my own images, is in NamesAndTypes, where I changed the name of their example file 6-1.jpg to the name of my yeast image file.

I was able to get the pipeline to work with their example colony plate image, but not with mine. It is able to run until the Align step, when it then throws an error (screenshot attached).

Thank you so much!! I’d really like to use this tool to analyze my plates.

ExampleYeastColonies.cppipe (20.3 KB)

Hi @lvl2111,

The error that you’re getting is happening because your image of yeast colonies on a plate has different dimensions than the mask. The mask has dimensions 1112 x 1116 pixels while the yeast colony image has dimensions 996 x 1000 pixels. The alignment doesn’t work because the Align module expects the images to have the same dimensions.

In order to get around this, you can use the Crop module to crop the original PlateTemplate image down to the same size as your OrigColor image. In order to do this, I used the “Rectangle” cropping mode and cropped 58 pixels from each edge, shown here:

The resulting image has been cropped from each side to the correct dimensions:

I was then able to use that image in the Align module w/o errors. I hope this helps!