Resize objects problem when odd number of pixels


#1

Hi,
I have quite large images to analyse in 3D, so to improve analysis time I have been using the resize module (0.5x as suggested in the tutorial https://github.com/CellProfiler/tutorials/tree/master/3d_monolayer). However, when the original image has an odd number of pixels in a dimension (i.e, 1170x971 vs 1170x972) you can not overlay the resized objects (2x) on the original image:

Failed to run module OverlayObjects
Traceback (most recent call last):
File “CellProfiler\cellprofiler\gui\pipelinecontroller.py”, line 2887, in do_step
File “CellProfiler\cellprofiler\pipeline.py”, line 2022, in run_module
File “CellProfiler\cellprofiler\modules\overlayobjects.py”, line 70, in run
File “CellProfiler\cellprofiler\module.py”, line 961, in run
File “CellProfiler\cellprofiler\modules\overlayobjects.py”, line 67, in
File “CellProfiler\cellprofiler\object.py”, line 974, in overlay_labels
File “site-packages\skimage\color\colorlabel.py”, line 114, in label2rgb
File “site-packages\skimage\color\colorlabel.py”, line 159, in _label2rgb_overlay
ValueError: image and label must be the same shape

I figure it has rounded the pixels on the initial resize and then doubling this factor in the resizeObjects module always leads to an even pixel count. Is there a workaround to this or will I need to ensure all my images have an even pixel count on the XY axes?

Thanks,
James