CellProfiler
CellProfiler copied to clipboard
MeasureGranularity module alters images
A user on the forum has reported that the MeasureGranularity
module erroneously alters the input_image. Any module downstream of MeasureGranularity
has therefore been working with an altered image.
This is a result of operations being applied to the original input image, rather than a copy: https://github.com/CellProfiler/CellProfiler/blob/2877e58eaa95f66167d49e13505c4384ca02cb48/cellprofiler/modules/measuregranularity.py#L304
Data to reproduce: measuregranularity.zip
This issue has been mentioned on Image.sc Forum. There might be relevant details there:
https://forum.image.sc/t/bug-in-cellprofiler-modifies-image-when-measuring-granularity/74057/2
Thank you so much @tischi for finding this and pointing this out! This has apparently been going on... a while. We will definitely fix!

Yeah, it's a nasty one, hard to spot. I was lucky to stumble over it.
Just to make sure to clarify the scope - this ONLY AFFECTS YOU if your setting for “Subsampling factor for granularity measurements” is set to 1. If you use the default value, which is 0.25, or any other value between 0 and 1, you are ok.
(This is still very bad and very necessary to fix! But hopefully it means the spread is somewhat less)
Closed in #4696 and #4697