Help with cell profiler 3D monolayer error

Hello,
I am running this exact pipeline https://github.com/CellProfiler/tutorials/blob/master/3d_monolayer/3d_monolayer_final.cppipe

using these images
3d_2wkrpapsesg_xy1_ch2.tif (10.2 MB) 3d_2wkrpapsesg_xy1_ch1.tif (10.2 MB)

And I haven’t been able to run it to completion because I keep getting an error on step imagemath#22 that says error the image sizes don’t line up and to use the crop or align tools but I have followed the rest exactly and the align tool doesn’t work on 3D analysis. I’m at a dead end and not sure how to fix this, any help would be really really appreciated. Thanks.

Hello Maria,

You have two channels (in your attached sample images), but this pipeline is designed for a 3 channel image.
Please make sure in the “NamesAndTypes” module to adjust the channels and then moving forward ( in “RescaleIntensity”, “ImageMath”, etc.)
You can deactivate any module that you don’t need to use just by unchecking them.

Hope this helps!
Best,
Nasim

1 Like

I’ve seen this before - see the linked thread

In this case:

  • Your original images have dimensions 381 x 402
  • Two resize “cycles” happen, one by 0.5 and one by 0.25
  • You can’t have half pixels, so CellProfiler rounds to a whole number.

For the first resizing
381 * 0.5 = 190.5 which is rounded to 190 by CP.
402 * 0.5 = 201
When the Resize back up happens (multiplied by a factor of 2) the resultant stack is 380 x 402.

Then in the second resizing
381 * 0.25 = 95.25 round to 95 by CP
402 * 0.25 = 100.5, rounded to 100 by CP.
Resized back up with a factor of 4 the resultant stack
is 380 x 400.

So one of your images is 2 pixels longer than the other which is why that ImageMath won’t work.

2 Likes

Thank you so much this worked! I am now getting another error further downstream that states "error while processing overlay objects: ‘image’ and ‘label’ must be the same shape. I’m guessing the solution is something similar but I can’t figure out the size of the label. the input is rescaleintensityDNA, the output is nuclei overlay, the objects is Nuclei (from resize objects) as stated in the pipeline. Any ideas how to resolve this?
Thanks in advance!

Hi @mquintero,
I had this issue earlier, but I resolved after using the proper resizing factor as mentioned before in this thread. I tried your sample, reproduced the error but not able to resolve it. But found this thread,

Hope this helps.
Regards,
Lakshmi
Fujifilm Wako Automation (Consultant)
www.wakoautomation.com
For CellProfiler training or optimised pipeline write to,
lakshmi.balasubramanian.contractor@fujifilm.com

Read more on our site.
Yokogawa CV8000 - The Ultimate in Confocal HCS
https://www.wakoautomation.com/products/yokogawa-high-content-imaging

Join us at, https://www.slas2020.org

To be honest, I think in this case, I would probably crop the image stacks from 318 x 402 to 380 x 400 and use the original pipeline.

You’d not really be losing any information and then both numbers divide by 4 (and thus 2). I suspect that will be easier than the other options to fix.

1 Like

That resolved it thank you again!!

1 Like