[Insight-users] itkHistogram with double, comments

Michal Sofka sofka at cs.rpi.edu
Thu May 19 13:54:16 EDT 2005


Hi itk users (and developers),

I've been using itkHistogram and found several inconsistencies:

1. It is derived from itkSample, that has
  typedef float FrequencyType ;
but the Histogram itself is templated over FrequencyType (through
TFrequencyContainer). As a result, when instantiating with a different type
for TFrequencyContainer than float, there are conflicts in GetFrequency and
GetTotalFrequency return types (see error messages below). (I'm using VS7.0,
Win2000.)

2. Comments for IncreaseFrequency functions (all prototypes) is not right
/** Method to increase the frequency by one.  This function is convenient
    to create a histogram. It returns false if the bin is out of bounds. */
It increases the frequency by 'value'.

3. Comment before the class (in the header file, line 46) is not right:
 * After this, users want to set range of each bin using
 * SetBinMin(dimension, n) and SetBinMax(dimension, n) methods.
The prototype of these functions is different.


Thanks.

Michal.



-----------------------------------
Michal Sofka, PhD student
Department of Computer Science, RPI
sofka at cs.rpi.edu




Issue 1 errors:

itkHistogram.h(231) : error C2555:
'itk::Statistics::Histogram<TMeasurement,VMeasurementVectorSize,TFrequencyCo
ntainer>::GetFrequency': overriding virtual function return type differs and
is not covariant from
'itk::Statistics::Sample<TMeasurementVector>::GetFrequency'
        with
        [
            TMeasurement=double,
            VMeasurementVectorSize=6,

TFrequencyContainer=itk::Statistics::DenseFrequencyContainer<double>
        ]
        and
        [
            TMeasurementVector=itk::FixedArray<double,6>
        ]
        itkSample.h(112) : see declaration of
'itk::Statistics::Sample<TMeasurementVector>::GetFrequency'
        with
        [
            TMeasurementVector=itk::FixedArray<double,6>
        ]
itkHistogram.h(282) : error C2555:
'itk::Statistics::Histogram<TMeasurement,VMeasurementVectorSize,TFrequencyCo
ntainer>::GetTotalFrequency': overriding virtual function return type
differs and is not covariant from
'itk::Statistics::Sample<TMeasurementVector>::GetTotalFrequency'
        with
        [
            TMeasurement=double,
            VMeasurementVectorSize=6,

TFrequencyContainer=itk::Statistics::DenseFrequencyContainer<double>
        ]
        and
        [
            TMeasurementVector=itk::FixedArray<double,6>
        ]
        itkSample.h(115) : see declaration of
'itk::Statistics::Sample<TMeasurementVector>::GetTotalFrequency'
        with
        [
            TMeasurementVector=itk::FixedArray<double,6>
        ]



More information about the Insight-users mailing list