[Insight-users] Minor bug in new OtsuMultipleThresholdsCalculator?

lucantiga at softhome.net lucantiga at softhome.net
Fri, 5 Mar 2004 10:44:12 +0100 (CET)


  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.
  Send mail to mime at docserver.cac.washington.edu for more info.

--8323328-1382140891-1078479170=:4486
Content-Type: TEXT/PLAIN; CHARSET=US-ASCII
Content-ID: <Pine.LNX.4.44.0403051033171.4491 at localhost.localdomain>

Hi Zach and Luis,
 attached you can find the corrected versions of 
OtsuMultipleThresholdsCalculator. 

 Basically I defined two types, namely 

 typedef typename NumericTraits<MeasurementType>::RealType MeanType;
 typedef typename NumericTraits<MeasurementType>::RealType VarianceType;

and modified the code accordingly, with all the necessary static_cast's.

 To be consistent, I also changed all comparisons of the kind

if (frequency > 0.0)
 with 
if (NumericTraits<FrequencyType>::IsPositive(frequency))

 and the assignments

mean = 0.0;
 with
mean = NumericTraits<MeanType>::Zero;

 The test passes correctly.

 Therefore, two modifications were made with respect to the CVS version:
 1. Fixed bug in class mean calculation
 2. Fixed type handling 

I also fixed a Doxygen problem in itkOtsuMultipleThresholdsCalculator.h

/** \class itkOtsuMultipleThresholdsCalculator

 was changed to

/** \class OtsuMultipleThresholdsCalculator

 This same thing should also be fixed for 
HistogramAlgorithmBase and ThresholdLabelerImageFilter

Thanks!

Luca


-- 
Luca Antiga, PhD
----------------------------------------------
Biomedical Technologies Laboratory
Bioengineering Department, 
Mario Negri Institute
Villa Camozzi, 24020, Ranica (BG), Italy
----------------------------------------------
phone: +39 035 4535-381
email: antiga at marionegri.it
web:   http://villacamozzi.marionegri.it/~luca
----------------------------------------------

--8323328-1382140891-1078479170=:4486
Content-Type: APPLICATION/X-GZIP; NAME="itkOtsuMultipleThresholdsCalculator.tar.gz"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.LNX.4.44.0403051031211.4486 at localhost.localdomain>
Content-Description: 
Content-Disposition: ATTACHMENT; FILENAME="itkOtsuMultipleThresholds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