RTK  2.6.0
Reconstruction Toolkit
rtkDaubechiesWaveletsDenoiseSequenceImageFilter.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 rtkDaubechiesWaveletsDenoiseSequenceImageFilter_h
20 #define rtkDaubechiesWaveletsDenoiseSequenceImageFilter_h
21 
22 #include "rtkConstantImageSource.h"
23 
24 #include <itkExtractImageFilter.h>
25 #include <itkPasteImageFilter.h>
26 #include <itkCastImageFilter.h>
28 
29 namespace rtk
30 {
73 template <typename TImageSequence>
75  : public itk::ImageToImageFilter<TImageSequence, TImageSequence>
76 {
77 public:
78  ITK_DISALLOW_COPY_AND_MOVE(DaubechiesWaveletsDenoiseSequenceImageFilter);
79 
84 
86  itkNewMacro(Self);
87 
89 #ifdef itkOverrideGetNameOfClassMacro
90  itkOverrideGetNameOfClassMacro(DaubechiesWaveletsDenoiseSequenceImageFilter);
91 #else
93 #endif
94 
95 
97  itkGetMacro(NumberOfLevels, unsigned int);
98  itkSetMacro(NumberOfLevels, unsigned int);
100 
102  itkGetMacro(Order, unsigned int);
103  itkSetMacro(Order, unsigned int);
105 
107  itkGetMacro(Threshold, float);
108  itkSetMacro(Threshold, float);
110 
112  using TImage = itk::Image<typename TImageSequence::PixelType, TImageSequence::ImageDimension - 1>;
118 
119 protected:
121  ~DaubechiesWaveletsDenoiseSequenceImageFilter() override = default;
122 
124  void
125  GenerateData() override;
126 
127  void
128  GenerateOutputInformation() override;
129  void
130  GenerateInputRequestedRegion() override;
131 
138 
140  typename TImageSequence::RegionType m_ExtractAndPasteRegion;
141 
143  unsigned int m_Order{ 5 };
144  float m_Threshold{ 1 };
145  unsigned int m_NumberOfLevels{ 3 };
146 };
147 } // namespace rtk
148 
149 
150 #ifndef ITK_MANUAL_INSTANTIATION
151 # include "rtkDaubechiesWaveletsDenoiseSequenceImageFilter.hxx"
152 #endif
153 
154 #endif
Generate an n-dimensional image with constant pixel values.
#define itkSetMacro(name, type)
Applies 3D Daubechies wavelets denoising to a 3D + time sequence of images.
Deconstructs an image, soft thresholds its wavelets coefficients, then reconstructs.