RTK  2.6.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  * https://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>
41 class ITK_TEMPLATE_EXPORT DenoisingBPDQImageFilter : public itk::InPlaceImageFilter<TOutputImage, TOutputImage>
42 {
43 public:
44  ITK_DISALLOW_COPY_AND_MOVE(DenoisingBPDQImageFilter);
45 
51 
53  itkNewMacro(Self);
54 
56 #ifdef itkOverrideGetNameOfClassMacro
57  itkOverrideGetNameOfClassMacro(DenoisingBPDQImageFilter);
58 #else
60 #endif
61 
62 
64  typedef ForwardDifferenceGradientImageFilter<TOutputImage,
65  typename TOutputImage::ValueType,
66  typename TOutputImage::ValueType,
67  TGradientImage>
74 
75  itkGetMacro(NumberOfIterations, int);
76  itkSetMacro(NumberOfIterations, int);
77 
78  itkSetMacro(Gamma, double);
79  itkGetMacro(Gamma, double);
80 
81 protected:
83  ~DenoisingBPDQImageFilter() override = default;
84 
85  void
86  GenerateData() override;
87 
88  void
89  GenerateOutputInformation() override;
90 
91  virtual ThresholdFilterType *
93  {
94  return nullptr;
95  }
96 
103 
104  double m_Gamma;
105  double m_Beta;
106  double m_MinSpacing;
108  bool m_DimensionsProcessed[TOutputImage::ImageDimension];
109 
110 private:
111  virtual void
112  SetPipelineForFirstIteration();
113  virtual void
114  SetPipelineAfterFirstIteration();
115 };
116 
117 } // namespace rtk
118 
119 #ifndef ITK_MANUAL_INSTANTIATION
120 # include "rtkDenoisingBPDQImageFilter.hxx"
121 #endif
122 
123 #endif //__rtkDenoisingBPDQImageFilter__
DivergenceFilterType::Pointer m_DivergenceFilter
ForwardDifferenceGradientImageFilter< TOutputImage, typename TOutputImage::ValueType, typename TOutputImage::ValueType, TGradientImage > GradientFilterType
MultiplyFilterType::Pointer m_MultiplyFilter
Base class for Basis Pursuit DeQuantization denoising filters.
#define itkSetMacro(name, type)
Computes the gradient of an image using forward difference.
SubtractImageFilterType::Pointer m_SubtractFilter
SubtractGradientFilterType::Pointer m_SubtractGradientFilter
Computes the backward differences divergence (adjoint of the forward differences gradient) of the inp...
GradientFilterType::Pointer m_GradientFilter
virtual ThresholdFilterType * GetThresholdFilter()