RTK  1.4.0
Reconstruction Toolkit
rtkDenoisingBPDQImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright RTK Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 
19 #ifndef rtkDenoisingBPDQImageFilter_h
20 #define rtkDenoisingBPDQImageFilter_h
21 
24 
25 #include <itkCastImageFilter.h>
26 #include <itkSubtractImageFilter.h>
27 #include <itkMultiplyImageFilter.h>
28 #include <itkInPlaceImageFilter.h>
29 
30 namespace rtk
31 {
40 template< typename TOutputImage, typename TGradientImage>
42  public itk::InPlaceImageFilter< TOutputImage, TOutputImage >
43 {
44 public:
45 
51 
53  itkNewMacro(Self)
54 
55 
57 
60  <TOutputImage,
61  typename TOutputImage::ValueType,
62  typename TOutputImage::ValueType,
63  TGradientImage> GradientFilterType;
64  typedef itk::MultiplyImageFilter<TOutputImage> MultiplyFilterType;
67  typedef itk::InPlaceImageFilter<TGradientImage> ThresholdFilterType;
68  typedef BackwardDifferenceDivergenceImageFilter<TGradientImage, TOutputImage> DivergenceFilterType;
69 
70  itkGetMacro(NumberOfIterations, int)
71  itkSetMacro(NumberOfIterations, int)
72 
73  itkSetMacro(Gamma, double)
74  itkGetMacro(Gamma, double)
75 
76 protected:
77  DenoisingBPDQImageFilter();
78  virtual ~DenoisingBPDQImageFilter() ITK_OVERRIDE {}
79 
80  void GenerateData() ITK_OVERRIDE;
81 
82  void GenerateOutputInformation() ITK_OVERRIDE;
83 
84  virtual ThresholdFilterType* GetThresholdFilter(){return ITK_NULLPTR;}
85 
92 
93  double m_Gamma;
94  double m_Beta;
95  double m_MinSpacing;
97  bool m_DimensionsProcessed[TOutputImage::ImageDimension];
98 
99 private:
100  DenoisingBPDQImageFilter(const Self&); //purposely not implemented
101  void operator=(const Self&); //purposely not implemented
102 
103  virtual void SetPipelineForFirstIteration();
104  virtual void SetPipelineAfterFirstIteration();
105 };
106 
107 } // end namespace itk
108 
109 #ifndef ITK_MANUAL_INSTANTIATION
110 #include "rtkDenoisingBPDQImageFilter.hxx"
111 #endif
112 
113 #endif //__rtkDenoisingBPDQImageFilter__
itk::SmartPointer< const Self > ConstPointer
DivergenceFilterType::Pointer m_DivergenceFilter
MultiplyFilterType::Pointer m_MultiplyFilter
Base class for Basis Pursuit DeQuantization denoising filters.
itk::InPlaceImageFilter< TOutputImage, TOutputImage > Superclass
virtual void SetPipelineAfterFirstIteration()
Computes the gradient of an image using forward difference.
SubtractImageFilterType::Pointer m_SubtractFilter
void GenerateOutputInformation() override
SubtractGradientFilterType::Pointer m_SubtractGradientFilter
bool m_DimensionsProcessed[TOutputImage::ImageDimension]
virtual void SetPipelineForFirstIteration()
Computes the backward differences divergence (adjoint of the forward differences gradient) of the inp...
void operator=(const Self &)
GradientFilterType::Pointer m_GradientFilter
virtual ThresholdFilterType * GetThresholdFilter()
#define itkSetMacro(name, type)