CellProfiler icon indicating copy to clipboard operation
CellProfiler copied to clipboard

MeasureGranularity module alters images

Open callum-jpg opened this issue 2 years ago • 4 comments

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

callum-jpg avatar Nov 17 '22 15:11 callum-jpg

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

imagesc-bot avatar Nov 17 '22 15:11 imagesc-bot

Thank you so much @tischi for finding this and pointing this out! This has apparently been going on... a while. We will definitely fix!

image

bethac07 avatar Nov 17 '22 15:11 bethac07

Yeah, it's a nasty one, hard to spot. I was lucky to stumble over it.

tischi avatar Nov 17 '22 16:11 tischi

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)

bethac07 avatar Nov 17 '22 16:11 bethac07

Closed in #4696 and #4697

bethac07 avatar Dec 13 '22 16:12 bethac07