ANIMA  4.0
animaMeanAndVarianceImagesFilter.h
Go to the documentation of this file.
1 #pragma once
2 
3 // First make sure that the configuration is available.
4 // This line can be removed once the optimized versions
5 // gets integrated into the main directories.
6 #include <itkConfigure.h>
7 
8 #include <itkImageToImageFilter.h>
9 #include <itkImage.h>
10 #include <itkNumericTraits.h>
11 
12 namespace anima
13 {
27 template <class TInputImage, class TOutputImage>
29  public itk::ImageToImageFilter< TInputImage, TOutputImage >
30 {
31 public:
33  itkStaticConstMacro(InputImageDimension, unsigned int,
34  TInputImage::ImageDimension);
35  itkStaticConstMacro(OutputImageDimension, unsigned int,
36  TOutputImage::ImageDimension);
37 
39  typedef TInputImage InputImageType;
40  typedef TOutputImage OutputImageType;
41 
44  typedef itk::ImageToImageFilter< InputImageType, OutputImageType> Superclass;
45  typedef itk::SmartPointer<Self> Pointer;
46  typedef itk::SmartPointer<const Self> ConstPointer;
47 
49  itkNewMacro(Self)
50 
51 
52  itkTypeMacro(MeanAndVarianceImagesFilter, ImageToImageFilter)
53 
54 
55  typedef typename InputImageType::PixelType InputPixelType;
56  typedef typename OutputImageType::PixelType OutputPixelType;
57  typedef typename itk::NumericTraits<InputPixelType>::RealType InputRealType;
58 
59  typedef typename InputImageType::RegionType InputImageRegionType;
60  typedef typename OutputImageType::RegionType OutputImageRegionType;
61  typedef typename InputImageType::SizeType InputSizeType;
62 
64  itkSetMacro(Radius, InputSizeType)
65 
67  itkGetConstReferenceMacro(Radius, InputSizeType)
68 
69  typename OutputImageType::Pointer GetMeanImage() {return this->GetOutput(0);}
70  typename OutputImageType::Pointer GetVarImage() {return this->GetOutput(1);}
71 
72 #ifdef ITK_USE_CONCEPT_CHECKING
73 
74  itkConceptMacro(InputHasNumericTraitsCheck,
75  (itk::Concept::HasNumericTraits<InputPixelType>));
77 #endif
78 
79 protected:
82  void PrintSelf(std::ostream& os, itk::Indent indent) const ITK_OVERRIDE;
83 
84  void DynamicThreadedGenerateData(const OutputImageRegionType& outputRegionForThread) ITK_OVERRIDE;
85 
86 private:
87  ITK_DISALLOW_COPY_AND_ASSIGN(MeanAndVarianceImagesFilter);
88 
89  InputSizeType m_Radius;
90 };
91 
92 } // end of namespace anima
93 
Applies an variance filter to an image.
itk::NumericTraits< InputPixelType >::RealType InputRealType
void DynamicThreadedGenerateData(const OutputImageRegionType &outputRegionForThread) ITK_OVERRIDE
typedef(itk::Concept::HasNumericTraits< InputPixelType >) InputHasNumericTraitsCheck
itk::ImageToImageFilter< InputImageType, OutputImageType > Superclass
void PrintSelf(std::ostream &os, itk::Indent indent) const ITK_OVERRIDE