RTK  2.0.1
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  ITK_DISALLOW_COPY_AND_ASSIGN(DenoisingBPDQImageFilter);
46 
52 
54  itkNewMacro(Self)
55 
56 
58 
61  <TOutputImage,
62  typename TOutputImage::ValueType,
63  typename TOutputImage::ValueType,
64  TGradientImage> GradientFilterType;
65  using MultiplyFilterType = itk::MultiplyImageFilter<TOutputImage>;
68  using ThresholdFilterType = itk::InPlaceImageFilter<TGradientImage>;
69  using DivergenceFilterType = BackwardDifferenceDivergenceImageFilter<TGradientImage, TOutputImage>;
70 
71  itkGetMacro(NumberOfIterations, int)
72  itkSetMacro(NumberOfIterations, int)
73 
74  itkSetMacro(Gamma, double)
75  itkGetMacro(Gamma, double)
76 
77 protected:
78  DenoisingBPDQImageFilter();
79  ~DenoisingBPDQImageFilter() override = default;
80 
81  void GenerateData() override;
82 
83  void GenerateOutputInformation() override;
84 
85  virtual ThresholdFilterType* GetThresholdFilter(){return nullptr;}
86 
93 
94  double m_Gamma;
95  double m_Beta;
96  double m_MinSpacing;
98  bool m_DimensionsProcessed[TOutputImage::ImageDimension];
99 
100 private:
101  virtual void SetPipelineForFirstIteration();
102  virtual void SetPipelineAfterFirstIteration();
103 };
104 
105 } // end namespace itk
106 
107 #ifndef ITK_MANUAL_INSTANTIATION
108 #include "rtkDenoisingBPDQImageFilter.hxx"
109 #endif
110 
111 #endif //__rtkDenoisingBPDQImageFilter__
DivergenceFilterType::Pointer m_DivergenceFilter
MultiplyFilterType::Pointer m_MultiplyFilter
Base class for Basis Pursuit DeQuantization denoising filters.
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...
GradientFilterType::Pointer m_GradientFilter
virtual ThresholdFilterType * GetThresholdFilter()
#define itkSetMacro(name, type)