Bug in Save Images



I found (and fixed) a little bug in the SaveImages Module:

elseif strcmp(BitDepth, ‘16’) && (strcmp(FileFormat,‘tif’) || strcmp(FileFormat,‘tiff’))
% correct code
Image = uint16(2^16 * Image);
% old code:
%Image2 = bitshift(255*Image, 8);
%Image = bitshift(Image2, 8);

the old code would throw away information.



Hi Christian,

We recently noticed this bug as well. Good catch! It actually came from a Mathworks solution that appears to be incorrect as formulated.

I believe the following will also work:



Hi there,

I constructed a simple pipeline to load .flex files, separate them into GFP and RFP images, then save the independent images. Unless I put in a rescale intensity (stretch from 0-1) module (which I don’t want to do since I would like to be able to visualize any abundance changes between images), the images that CellProfiler saves are essentially void of any information. I’ve attached the pipeline I used, but haven’t attached the output image (it would just be an empty image)

Does this have anything to do with the bug described in the initial post? If so, is there anything I can do about it using the compiled CellProfiler application?



(I am running CellProfiler on a core duo macbook, OS 10.5.6 using the java workaround)
saveimagesPIPE.mat (698 Bytes)



Have you tried putting a RescaleIntensity module in place for both channels with the “Enter min/max” option and 0, 0.0625, 0, 1, 0, 1 as the associated settings? This will upscale a 12-bit image to a 16-bit image and may give you the desired bit depth for saving.