Error while processing save images: (Worker) ValueError: Images of type float must be between -1 and 1

I have a pipeline as shown in the image below to calculate Illumination correction. It starts showing an error after processing 110 image sets.

Here is an image of the setting for CorrectIlluminationCalculate module:

Here are images of two types of settings for the SaveImage modules:

Is this a common error? I’m not sure what bit of setting causes this error. Is it due to the rescale function option in the Illumination correction module?

Hello @mkm.mayank,
Yes, this is an already reported issue and it’ll hopefully get fixed in the new release.
For now, please set the Rescale the illumination function to No.

Actually, the Github issue linked here is not the problem; in general, 16 bit tiffs expect the values of images to be rescaled -1 to 1, and using CorrectIlluminationCalculate with the “Rescale” option turned on sets images to have a minimum of 1 and a maximum of something larger than 1.

We recommend using .npy, rather than tiff files, for saving that sort of illumination correction function; this recommendation is already in the help for both CorrectIlluminationCalculate and SaveImages, but if you can think of anywhere else to put it that would be useful we’ll certainly consider doing so as we prep the 4.0 release!

Thanks for the reply! I’m new to CellProfiler so I missed the general help option for each module, I have been using the question mark boxes beside each option in modules instead. Perhaps, it could be helpful to add the suggestion in the “Rescale” option description as well.

1 Like