Images of type float must be between -1 and 1

Hi everyone,

This is probably a fairly basic issue and I’ve seen some other people having a similar problem however I have not found a solution.

When I tried to use the overlayobjects or overlayoutlines modules in Cell Profiler to save how my objects have been segmented an error message pops up “Images of type float must be between -1 and 1” and this happens with only some of my images and I can’t seem to see a pattern.

Please explain what this means (I am quite new to image analysis and CellProfiler) and how I can solve it.

Thanks :slight_smile:

Could you please post the pipeline and an example image set where you see this problem?

Hi Anne,

I have attached my pipeline and also a sample image (it is actually a single time point from a movie, let me know if you want the full thing). I have images from the same experiment (acquired exactly the same way) that don’t have this problem all the time (some timepoints do and some don’t).

Capture 2 - B3_1_29 LB16.Project Maximum Z - 1_XY1533915987_Z0_T00_C0.tif (3.7 MB)

cell profiler_T cell infiltration pipeline_binary T cells.cpproj (674.6 KB)

Hi Masha,

I’m not sure about the actual root cause of this error, but the top of the iceberg is that your image (on which you want to overlay objects/outlines) has pixel(s) with intensity value greater than 1. To overcome this issue, you can use Rescale Intensity module and set it to “Stretch each image to use full intensity range” and make overlay on the resulting image.

Hope it helps.

Hi! Is the rescaling going to affect my segmentation? Like is it actually going to change my intensity values or is it just relabelling them internally?

Sorry if this is a silly question, but as I said, I’m quite new to image analysis :slight_smile:

Also, just tested it out and that error message still appears so perhaps it’s some kind of bug?

I was able to reproduce your error and fix it by rescaling intensity. Please find attached project file (I’ve only added rescale intensity module and change the input image in overlayobjects module).

In CellProfiler after any image editing step both original and edited images are kept. Thus you can add as many editing steps as you need and still use the original image for segmentation.
Talking more generally, I think that rescaling intensity might affect the segmentation results, but it would, probably, depends on both rescaling method and segmentation method.

cell profiler_T cell infiltration pipeline_binary T cells.cpproj (634.8 KB)

I know what I didn’t do: I didn’t change the input image in overlayobjects module because I thought that the rescale intensity module changes the original image so I kept it as just spheroid but this makes more sense now and it works!

Thanks for your help!

Also, could you possibly have a look at this problem I also posted about and let me know if you have any ideas (and questions because it was hard to explain what I meant).