Error message on cell profiler


#1

Dear cell profiler:
When I tried to do segmentation, I encountered this error:

Traceback (most recent call last):
File “/Applications/CellProfiler.app/Contents/Resources/lib/python2.7/cellprofiler/gui/pipelinecontroller.py”, line 2835, in do_step
File “/Applications/CellProfiler.app/Contents/Resources/lib/python2.7/cellprofiler/workspace.py”, line 109, in refresh
File “matplotlib/backends/backend_wxagg.pyc”, line 51, in draw
File “matplotlib/backends/backend_agg.pyc”, line 474, in draw
File “matplotlib/artist.pyc”, line 61, in draw_wrapper
File “matplotlib/figure.pyc”, line 1159, in draw
File “matplotlib/artist.pyc”, line 61, in draw_wrapper
File “matplotlib/axes/_base.pyc”, line 2324, in draw
File “/Applications/CellProfiler.app/Contents/Resources/lib/python2.7/cellprofiler/gui/cpfigure.py”, line 1984, in draw
File “/Applications/CellProfiler.app/Contents/Resources/lib/python2.7/cellprofiler/gui/cpfigure.py”, line 1474, in normalize_image
ValueError: operands could not be broadcast together with shapes (818,637,3) (819,638,1)

Could you suggest a solution?
Thank you so much!


#2

@zebrafish_julia it looks like your input images are of different sizes.

The salient part of the error is

ValueError: operands could not be broadcast together with shapes (818,637,3) (819,638,1)

One image appears to be an RGB or color image, given the 3 in (818,637,3). Update the image type in NamesAndTypes or use the ColorToGray module to fix this issue.

In addition, it is also problematic that the images are 1 pixel off in both X and Y:

  • 818 vs 819
  • 637 vs 638

Did you happen to crop your images manually before processing them in CellProfiler? If so be careful to ensure that the dimensions of your input images are the same. CellProfiler has a crop module that is useful for this situation.