18 #ifndef __itkLabelStatisticsImageFilter_h
19 #define __itkLabelStatisticsImageFilter_h
24 #include "itksys/hash_map.hxx"
59 template<
class TInputImage,
class TLabelImage >
79 typedef typename TInputImage::SizeType
SizeType;
92 itkStaticConstMacro(ImageDimension,
unsigned int,
93 TInputImage::ImageDimension);
136 unsigned int imageDimension = itkGetStaticConstMacro(ImageDimension);
137 m_BoundingBox.resize(imageDimension * 2);
138 for (
unsigned int i = 0; i < imageDimension * 2; i += 2 )
163 unsigned int imageDimension = itkGetStaticConstMacro(ImageDimension);
164 m_BoundingBox.resize(imageDimension * 2);
165 for (
unsigned int i = 0; i < imageDimension * 2; i += 2 )
172 m_Histogram = HistogramType::New();
179 m_Histogram->SetMeasurementVectorSize(1);
183 m_Histogram->Initialize(hsize, lb, ub);
233 typedef itksys::hash_map< LabelPixelType, LabelStatistics >
MapType;
234 typedef typename itksys::hash_map< LabelPixelType, LabelStatistics >::iterator
MapIterator;
235 typedef typename itksys::hash_map< LabelPixelType, LabelStatistics >::const_iterator
MapConstIterator;
242 itkSetMacro(UseHistograms,
bool);
243 itkGetConstMacro(UseHistograms,
bool);
244 itkBooleanMacro(UseHistograms);
249 return m_ValidLabelValues;
253 void SetLabelInput(
const TLabelImage *input)
256 this->SetNthInput( 1, const_cast< TLabelImage * >( input ) );
269 return m_LabelStatistics.find(label) != m_LabelStatistics.end();
275 return m_LabelStatistics.size();
280 return this->GetNumberOfObjects();
284 RealType GetMinimum(LabelPixelType label)
const;
287 RealType GetMaximum(LabelPixelType label)
const;
290 RealType GetMean(LabelPixelType label)
const;
294 RealType GetMedian(LabelPixelType label)
const;
297 RealType GetSigma(LabelPixelType label)
const;
300 RealType GetVariance(LabelPixelType label)
const;
303 BoundingBoxType GetBoundingBox(LabelPixelType label)
const;
306 RegionType GetRegion(LabelPixelType label)
const;
309 RealType GetSum(LabelPixelType label)
const;
312 MapSizeType GetCount(LabelPixelType label)
const;
315 HistogramPointer GetHistogram(LabelPixelType label)
const;
318 void SetHistogramParameters(
const int numBins, RealType lowerBound,
319 RealType upperBound);
321 #ifdef ITK_USE_CONCEPT_CHECKING
332 void PrintSelf(std::ostream & os,
Indent indent)
const;
336 void AllocateOutputs();
339 void BeforeThreadedGenerateData();
343 void AfterThreadedGenerateData();
346 void ThreadedGenerateData(
const RegionType &
347 outputRegionForThread,
351 void GenerateInputRequestedRegion();
354 void EnlargeOutputRequestedRegion(
DataObject *data);
358 void operator=(
const Self &);
374 #ifndef ITK_MANUAL_INSTANTIATION
375 #include "itkLabelStatisticsImageFilter.hxx"