Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

cpmorphology shape broadcast error #324

Closed
dlogan opened this Issue May 9, 2012 · 1 comment

Comments

Projects
None yet
2 participants
Member

dlogan commented May 9, 2012

Error doing grayscale erosion in Morph open operation:


Traceback (most recent call last):
File "C:\Trunk\CellProfiler.git\trunk\cellprofiler\gui\pipelinecontroller.py", line 1019, in do_step
module.run(workspace)
File "C:\Trunk\CellProfiler.git\trunk\cellprofiler\modules\morph.py", line 543, in run
function.custom_repeats.value)
File "C:\Trunk\CellProfiler.git\trunk\cellprofiler\modules\morph.py", line 701, in run_function
footprint=strel)
File "C:\Trunk\CellProfiler.git\trunk\cellprofiler\cpmath\cpmorphology.py", line 2501, in opening
eroded_image = grey_erosion(image, radius, mask, footprint)
File "C:\Trunk\CellProfiler.git\trunk\cellprofiler\cpmath\cpmorphology.py", line 2336, in grey_erosion
big_image[iradius:-iradius,iradius:-iradius] = image
ValueError: operands could not be broadcast together with shapes (721,1024,13) (721,1024,3)


INPUT:
\iodine\imaging_analysis\People\David\Forum\interlaced

PIPELINE:

\iodine\imaging_analysis\People\David\Forum\interlaced\interlaced_test_pipeline.cp

@ghost ghost assigned LeeKamentsky May 9, 2012

The image was color with all 3 channels being the same. I made Morph do a gentle color -> gray (warns user if it's color, but converts to gray anyway, and from there, possibly it converts to binary for things like skeletonize).

The work-around for the user is to do the color to gray explicitly in the pipeline.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment