ANIMA  4.0
animaSmoothingRecursiveYvvGaussianImageFilter.h
Go to the documentation of this file.
1 #pragma once
2 
4 #include <itkCastImageFilter.h>
5 #include <itkImage.h>
6 #include <itkPixelTraits.h>
7 #include <itkCommand.h>
8 #include <itkFixedArray.h>
9 
10 namespace anima
11 {
12 
13 template <typename TInputImage,
14 typename TOutputImage= TInputImage >
16 public itk::InPlaceImageFilter<TInputImage,TOutputImage>
17 {
18 public:
21  typedef itk::InPlaceImageFilter<TInputImage,TOutputImage> Superclass;
22  typedef itk::SmartPointer<Self> Pointer;
23  typedef itk::SmartPointer<const Self> ConstPointer;
24 
26  typedef TInputImage InputImageType;
27  typedef TOutputImage OutputImageType;
28  typedef typename TInputImage::PixelType PixelType;
29  typedef typename itk::NumericTraits<PixelType>::RealType RealType;
30  typedef typename itk::NumericTraits<PixelType>::ScalarRealType ScalarRealType;
31 
34  InPlaceImageFilter)
35 
36 
37  itkStaticConstMacro(ImageDimension, unsigned int,
38  TInputImage::ImageDimension);
39 
41  typedef itk::FixedArray< ScalarRealType,
42  itkGetStaticConstMacro(ImageDimension) > SigmaArrayType;
43 
48  typedef typename itk::NumericTraits< PixelType >::RealType InternalRealType;
49  typedef typename InputImageType::template Rebind<InternalRealType>::Type RealImageType;
50 
54  RealImageType
56 
60  RealImageType
62 
64  typedef itk::CastImageFilter<
66  OutputImageType
68 
71 
74 
76  typedef typename CastingFilterType::Pointer CastingFilterPointer;
77 
79  typedef typename OutputImageType::Pointer OutputImagePointer;
80 
82  itkNewMacro(Self)
83 
84 
88  void SetSigmaArray(const SigmaArrayType & sigmas);
89  void SetSigma( ScalarRealType sigma );
90 
92  ScalarRealType GetSigma() const;
93 
95  void SetNormalizeAcrossScale(bool normalizeInScaleSpace);
96  itkGetConstMacro(NormalizeAcrossScale, bool)
97 
98  void SetNumberOfWorkUnits(itk::ThreadIdType nb) ITK_OVERRIDE;
99 
100  // See super class for doxygen documentation
101  //
102  virtual bool CanRunInPlace() const ITK_OVERRIDE;
103 
104 protected:
106  virtual ~SmoothingRecursiveYvvGaussianImageFilter() {}
107  void PrintSelf(std::ostream& os, itk::Indent indent) const ITK_OVERRIDE;
108 
110  void GenerateData() ITK_OVERRIDE;
111 
117  virtual void GenerateInputRequestedRegion() ITK_OVERRIDE;
118 
119  // Override since the filter produces the entire dataset
120  void EnlargeOutputRequestedRegion(itk::DataObject *output) ITK_OVERRIDE;
121 
122 private:
123  ITK_DISALLOW_COPY_AND_ASSIGN(SmoothingRecursiveYvvGaussianImageFilter);
124 
125  InternalGaussianFilterPointer m_SmoothingFilters[ImageDimension - 1];
126  FirstGaussianFilterPointer m_FirstSmoothingFilter;
127  CastingFilterPointer m_CastingFilter;
128 
130  bool m_NormalizeAcrossScale;
131 
133  SigmaArrayType m_Sigma;
134 };
135 
136 } // end of namespace anima
137 
itk::CastImageFilter< RealImageType, OutputImageType > CastingFilterType
itk::FixedArray< ScalarRealType, itkGetStaticConstMacro(ImageDimension) > SigmaArrayType
InputImageType::template Rebind< InternalRealType >::Type RealImageType
anima::RecursiveLineYvvGaussianImageFilter< InputImageType, RealImageType > FirstGaussianFilterType
void PrintSelf(std::ostream &os, itk::Indent indent) const ITK_OVERRIDE
anima::RecursiveLineYvvGaussianImageFilter< RealImageType, RealImageType > InternalGaussianFilterType
itk::InPlaceImageFilter< TInputImage, TOutputImage > Superclass