36 #ifndef __itkStatisticsImageFilterWithMask_h
37 #define __itkStatisticsImageFilterWithMask_h
40 #include <itkImageToImageFilter.h>
41 #include <itkNumericTraits.h>
43 #include <itkSimpleDataObjectDecorator.h>
44 #include <itkSpatialObject.h>
64 template<
class TInputImage>
66 public ImageToImageFilter<TInputImage, TInputImage>
71 typedef ImageToImageFilter<TInputImage,TInputImage> Superclass;
72 typedef SmartPointer<Self> Pointer;
73 typedef SmartPointer<const Self> ConstPointer;
84 typedef typename TInputImage::RegionType RegionType ;
85 typedef typename TInputImage::SizeType SizeType ;
86 typedef typename TInputImage::IndexType IndexType ;
87 typedef typename TInputImage::PixelType PixelType ;
88 typedef typename TInputImage::PointType PointType ;
91 itkStaticConstMacro(ImageDimension,
unsigned int,
92 TInputImage::ImageDimension ) ;
95 typedef typename NumericTraits<PixelType>::RealType
RealType;
102 typedef SimpleDataObjectDecorator<PixelType> PixelObjectType;
107 typedef typename ImageMaskType::Pointer ImageMaskPointer;
110 itkSetObjectMacro( ImageMask, ImageMaskType );
111 itkGetConstObjectMacro( ImageMask, ImageMaskType );
115 {
return this->GetMinimumOutput()->Get(); }
116 PixelObjectType* GetMinimumOutput();
117 const PixelObjectType* GetMinimumOutput()
const;
121 {
return this->GetMaximumOutput()->Get(); }
122 PixelObjectType* GetMaximumOutput();
123 const PixelObjectType* GetMaximumOutput()
const;
127 {
return this->GetMeanOutput()->Get(); }
128 RealObjectType* GetMeanOutput();
129 const RealObjectType* GetMeanOutput()
const;
133 {
return this->GetSigmaOutput()->Get(); }
134 RealObjectType* GetSigmaOutput();
135 const RealObjectType* GetSigmaOutput()
const;
139 {
return this->GetVarianceOutput()->Get(); }
140 RealObjectType* GetVarianceOutput();
141 const RealObjectType* GetVarianceOutput()
const;
145 {
return this->GetSumOutput()->Get(); }
146 RealObjectType* GetSumOutput();
147 const RealObjectType* GetSumOutput()
const;
151 virtual DataObjectPointer MakeOutput(
unsigned int idx);
156 void PrintSelf(std::ostream& os, Indent indent)
const;
159 void AllocateOutputs();
162 void BeforeThreadedGenerateData ();
165 void AfterThreadedGenerateData ();
168 void ThreadedGenerateData (
const RegionType& outputRegionForThread,
169 ThreadIdType threadId);
172 void GenerateInputRequestedRegion();
175 void EnlargeOutputRequestedRegion(DataObject *data);
178 StatisticsImageFilterWithMask(
const Self&);
179 void operator=(
const Self&);
181 mutable ImageMaskPointer m_ImageMask;
183 Array<RealType> m_ThreadSum;
184 Array<RealType> m_SumOfSquares;
186 Array<PixelType> m_ThreadMin;
187 Array<PixelType> m_ThreadMax;
193 #ifndef ITK_MANUAL_INSTANTIATION
194 #include "itkStatisticsImageFilterWithMask.txx"
Compute min. max, variance and mean of an Image.
Definition: itkStatisticsImageFilterWithMask.h:65
RealType GetVariance() const
Definition: itkStatisticsImageFilterWithMask.h:138
PixelType GetMaximum() const
Definition: itkStatisticsImageFilterWithMask.h:120
DataObject::Pointer DataObjectPointer
Definition: itkStatisticsImageFilterWithMask.h:98
SimpleDataObjectDecorator< RealType > RealObjectType
Definition: itkStatisticsImageFilterWithMask.h:101
RealType GetMean() const
Definition: itkStatisticsImageFilterWithMask.h:126
StatisticsImageFilterWithMask Self
Definition: itkStatisticsImageFilterWithMask.h:70
Definition: itkNormalizeImageFilterWithMask.h:48
SpatialObject< TInputImage::ImageDimension > ImageMaskType
Definition: itkStatisticsImageFilterWithMask.h:106
RealType GetSigma() const
Definition: itkStatisticsImageFilterWithMask.h:132
TInputImage::Pointer InputImagePointer
Definition: itkStatisticsImageFilterWithMask.h:82
PixelType GetMinimum() const
Definition: itkStatisticsImageFilterWithMask.h:114
RealType GetSum() const
Definition: itkStatisticsImageFilterWithMask.h:144
NumericTraits< PixelType >::RealType RealType
Definition: itkStatisticsImageFilterWithMask.h:95