[Insight-users] ScalarImageToHistogramGenerator always creates real-value-typed histograms?

Luis Ibanez luis.ibanez at kitware.com
Tue, 06 Apr 2004 16:28:48 -0400


Hi Zach,

This use of RealType in the HistogramGeneration has been done
in purpose because it is the generic way of managing the range
of values in the Histogram.

This is one of those design decisions based on the policy of
providing the maximum flexibility on the class.

Note that even though the pixel type is integer-like, the
intervals for the histogram bins can be defined using the
more continuous range of float numbers.

Note that a good way to use this in your code is to get
the 'traits' from the HistogramGenerator class, so you can
declare appropriate compatible variables in your application.


Please let us know if this type selection is leading to any
problems in your code.


Thanks


   Luis



------------------------
Zachary Pincus wrote:

> Hello,
> 
> itkScalarImageToHistogramGenerator<ImageType> appears to create 
> histograms where the measurement vector components are *not* of type 
> ImageType::PixelType, as one might expect, but instead of type 
> NumericTraits<ImageType::PixelType>::RealType
> (see lines 51 and 53 of itkScalarImageToHistogramGenerator.h)
> 
> That is, if I pass in an image of unsigned chars to 
> ScalarImageToHistogramGenerator, the histogram returned has measurement 
> vectors defined over doubles.
> 
> This behavior is at odds with that of ScalarImageToListAdaptor, which 
> generates lists with measurement vectors of ImageType::PixelType, which 
> seems natural.
> 
> Is there any particular reason for this? Or am I just exposing my lack 
> of knowledge about the statistics classes?
> 
> Thanks,
> 
> Zach Pincus
> 
> Department of Biochemistry and Program in Biomedical Informatics
> Stanford University School of Medicine
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>