RTK  2.0.1
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  * 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 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 {
72 template< typename TImageSequence >
73 class DaubechiesWaveletsDenoiseSequenceImageFilter : public itk::ImageToImageFilter<TImageSequence, TImageSequence>
74 {
75 public:
76  ITK_DISALLOW_COPY_AND_ASSIGN(DaubechiesWaveletsDenoiseSequenceImageFilter);
77 
82 
84  itkNewMacro(Self)
85 
86 
88 
90  itkGetMacro(NumberOfLevels, unsigned int)
91  itkSetMacro(NumberOfLevels, unsigned int)
92 
94  itkGetMacro(Order, unsigned int)
95  itkSetMacro(Order, unsigned int)
96 
98  itkGetMacro(Threshold, float)
99  itkSetMacro(Threshold, float)
100 
102  using TImage = itk::Image<typename TImageSequence::PixelType,
103  TImageSequence::ImageDimension - 1>;
105  using ExtractFilterType = itk::ExtractImageFilter<TImageSequence, TImage>;
106  using PasteFilterType = itk::PasteImageFilter<TImageSequence,TImageSequence>;
107  using CastFilterType = itk::CastImageFilter<TImage, TImageSequence>;
109 
110 protected:
111  DaubechiesWaveletsDenoiseSequenceImageFilter();
112  ~DaubechiesWaveletsDenoiseSequenceImageFilter() override = default;
113 
115  void GenerateData() override;
116 
117  void GenerateOutputInformation() override;
118  void GenerateInputRequestedRegion() override;
119 
126 
128  typename TImageSequence::RegionType m_ExtractAndPasteRegion;
129 
131  unsigned int m_Order{5};
132  float m_Threshold{1};
133  unsigned int m_NumberOfLevels{3};
134 
135 };
136 } //namespace ITK
137 
138 
139 #ifndef ITK_MANUAL_INSTANTIATION
140 #include "rtkDaubechiesWaveletsDenoiseSequenceImageFilter.hxx"
141 #endif
142 
143 #endif
Generate an n-dimensional image with constant pixel values.
Applies 3D Daubechies wavelets denoising to a 3D + time sequence of images.
Deconstructs an image, soft thresholds its wavelets coefficients, then reconstructs.
#define itkSetMacro(name, type)