Login  Register

Convert image : 32-bit to 16-bit, keeping the whole intensity range?

Posted by lechristophe on Jan 22, 2014; 9:01am
URL: http://imagej.273.s1.nabble.com/Convert-image-32-bit-to-16-bit-keeping-the-whole-intensity-range-tp5006223.html

Hi,

I am trying to do flatfield-correction on microscope images, i.e. using
reference images from uniform slides to compensate for the uneven
illumination pattern.

So I have two images : an input image, and a flatfield image, both 16-bits.
Ideally I'd like to normalize the input image by the flatfield image,
keeping the mean intensity of the result image equal to that of the input
image.

What I do: I have made a 32-bit normalization image that is equal to:
normalization image = (mean Intensity of flatfield image) / (flatfield
image)

and then multiply the input image by this normalization image to obtain a
32-bit corrected image:
corrected image (32-bit) = (input image) * (normalization image)

The mean intensity of this 32-bit corrected image is equal to this of the
16-bit input image. However, I am unable to convert this corrected image
into a 16-bit final image, keeping the intensity constant. When converting
the 32-bit corrected image using Images>Type>16-bit, there is a rescaling
by min and max occuring, and the resulting image does not have the same
mean intensity. This is specially bad for stacks, where the min/max
rescaling uses the values of the displayed slices, regardless of the values
in the other slices, this ending up with saturated images in
higher-intensities slices in the stack.

TL;DR version: How can I convert a 32-bit image into a 16-bit images,
keeping the measured pixel values equal (full intensity range, no
rescaling)? Or is there another way to do the flatfield correction without
using 32-bit images as intermediaries?

Thanks for your help,

--
Christophe Leterrier
Researcher
Axonal Domains Architecture Team
CRN2M CNRS UMR 7286
Aix Marseille University, France

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html