RTK  2.6.0
Reconstruction Toolkit
rtkDaubechiesWaveletsConvolutionImageFilter.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 rtkDaubechiesWaveletsConvolutionImageFilter_h
20 #define rtkDaubechiesWaveletsConvolutionImageFilter_h
21 
22 // Includes
23 #include <itkImageToImageFilter.h>
25 
26 #include "rtkMacro.h"
27 
28 namespace rtk
29 {
30 
44 template <typename TImage>
45 class ITK_TEMPLATE_EXPORT DaubechiesWaveletsConvolutionImageFilter : public itk::ImageToImageFilter<TImage, TImage>
46 {
47 public:
48  ITK_DISALLOW_COPY_AND_MOVE(DaubechiesWaveletsConvolutionImageFilter);
49 
50  enum Pass
51  {
52  Low = 0x0, // Indicates to return the low-pass filter coefficients
53  High = 0x1 // Indicates to return the high-pass filter coefficients
54  };
55 
56  enum Type
57  {
58  Deconstruct = 0x0, // Indicates to deconstruct the image into levels/bands
59  Reconstruct = 0x1 // Indicates to reconstruct the image from levels/bands
60  };
61 
62 
68 
70  using OutputImageType = TImage;
71 
73  using OutputImagePixelType = typename TImage::PixelType;
74 
76  using OutputImageRegionType = typename TImage::RegionType;
77 
80 
82 #ifdef itkOverrideGetNameOfClassMacro
83  itkOverrideGetNameOfClassMacro(DaubechiesWaveletsConvolutionImageFilter);
84 #else
86 #endif
87 
88 
90  itkNewMacro(Self);
91 
94 
96  void
97  SetDeconstruction();
98 
100  void
101  SetReconstruction();
102 
104  void
105  PrintSelf(std::ostream & os, itk::Indent i) const override;
106 
108  itkSetMacro(Order, unsigned int);
109  itkGetConstMacro(Order, unsigned int);
111 
114  itkGetMacro(Pass, PassVector);
116 
117 protected:
120 
121  using CoefficientVector = std::vector<typename TImage::PixelType>;
122 
125  GenerateCoefficients();
126 
128  void
129  GenerateData() override;
130 
132  void
133  GenerateOutputInformation() override;
134 
135 private:
138  GenerateCoefficientsLowpassDeconstruct();
140  GenerateCoefficientsHighpassDeconstruct();
142  GenerateCoefficientsLowpassReconstruct();
144  GenerateCoefficientsHighpassReconstruct();
146 
148  unsigned int m_Order{ 3 };
149 
151  PassVector m_Pass{ PassVector(typename PassVector::ComponentType(0)) };
152 
155 };
156 
157 } // namespace rtk
158 
159 // Include CXX
160 #ifndef rtk_MANUAL_INSTANTIATION
161 # include "rtkDaubechiesWaveletsConvolutionImageFilter.hxx"
162 #endif
163 
164 #endif
typename itk::ConvolutionImageFilter< TImage > ConvolutionFilterType
typename OutputImageType::PixelType OutputImagePixelType
#define itkSetMacro(name, type)
typename itk::Vector< typename Self::Pass, TImage::ImageDimension > PassVector
typename OutputImageType::RegionType OutputImageRegionType
TOutputImage OutputImageType
Creates a Daubechies wavelets kernel image with the requested attributes (order, type, pass along each dimension)