CellProfiler/CellProfiler — Issue #122: JIRA [IMG-1145] ApplyThreshold doesn't play well with color images
Author: thouis
Created: 2011-11-23 20:50:15+00:00
State: open
Labels: current

ApplyThreshold errors when an RGB image is used as input:
*******
Traceback (most recent call last):
File"C:\Trunk\CellProfiler\cellprofiler\gui\pipelinecontroller.py", line 897, in do_step
module.run(workspace)
File"C:\Trunk\CellProfiler\cellprofiler\modules\applythreshold.py", line 137, in run
"""Run the module
File"C:\Trunk\CellProfiler\cellprofiler\cpimage.py", line 522, in get_image
raise ValueError("Image must be grayscale, but it was color")
ValueError: Image must be grayscale, but it was color
**********
Perhaps it indeed shouldn't allow non-grayscale images, and steer the user to ColorToGray. Alternatively, it could convert to gray automatically (all channels equal weights) and apply the threshold.

Original reporter: dlogan
Jira link: https://jira.broadinstitute.org/browse/IMG-1145
Fix version: Current
Assignee: leek