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);
229 typedef itksys::hash_map< LabelPixelType, LabelStatistics >
MapType;
230 typedef typename itksys::hash_map< LabelPixelType, LabelStatistics >::iterator
MapIterator;
231 typedef typename itksys::hash_map< LabelPixelType, LabelStatistics >::const_iterator
MapConstIterator;
238 itkSetMacro(UseHistograms,
bool);
239 itkGetConstMacro(UseHistograms,
bool);
240 itkBooleanMacro(UseHistograms);
245 return m_ValidLabelValues;
249 void SetLabelInput(
const TLabelImage *input)
252 this->SetNthInput( 1, const_cast< TLabelImage * >( input ) );
265 return m_LabelStatistics.find(label) != m_LabelStatistics.end();
271 return m_LabelStatistics.size();
276 return this->GetNumberOfObjects();
280 RealType GetMinimum(LabelPixelType label)
const;
283 RealType GetMaximum(LabelPixelType label)
const;
286 RealType GetMean(LabelPixelType label)
const;
290 RealType GetMedian(LabelPixelType label)
const;
293 RealType GetSigma(LabelPixelType label)
const;
296 RealType GetVariance(LabelPixelType label)
const;
299 BoundingBoxType GetBoundingBox(LabelPixelType label)
const;
302 RegionType GetRegion(LabelPixelType label)
const;
305 RealType GetSum(LabelPixelType label)
const;
308 MapSizeType GetCount(LabelPixelType label)
const;
311 HistogramPointer GetHistogram(LabelPixelType label)
const;
314 void SetHistogramParameters(
const int numBins, RealType lowerBound,
315 RealType upperBound);
317 #ifdef ITK_USE_CONCEPT_CHECKING
328 void PrintSelf(std::ostream & os,
Indent indent)
const;
332 void AllocateOutputs();
335 void BeforeThreadedGenerateData();
339 void AfterThreadedGenerateData();
342 void ThreadedGenerateData(
const RegionType &
343 outputRegionForThread,
347 void GenerateInputRequestedRegion();
350 void EnlargeOutputRequestedRegion(
DataObject *data);
354 void operator=(
const Self &);
370 #ifndef ITK_MANUAL_INSTANTIATION
371 #include "itkLabelStatisticsImageFilter.hxx"