[Insight-users] Managing conversion of pixel types during file read

Zachary Pincus zpincus at stanford.edu
Wed, 14 Apr 2004 16:03:31 -0700


Hello,

My plan is to convert images I read in (initially in heterogeneous 
pixel types) to floating-point pixels. I intend to rescale each image 
such that the dynamic range of the image type (e.g. 8 bits, 16 bits) is 
compressed to the floating-point range [0, 1].

That is, I don't mean to "normalize" each image I read in so that 
[image.min_value, image.max_value] goes to [0, 1], but to convert 
[ImageType.min_possible_value, ImageType.max_possible_value] to [0, 1]. 
(If you follow my abused notation!)

Is there any simple way to do this in ITK now? I could write a new 
version of DefaultConvertPixelTraits for use with the FileReaders, but 
(a) I don't quite know what all needs to go into this, and (b) if 
there's an easy way already, I should use that.

Thanks,
Zach Pincus


Department of Biochemistry and Program in Biomedical Informatics
Stanford University School of Medicine