RTK  2.5.0
Reconstruction Toolkit
rtkLastDimensionL0GradientDenoisingImageFilter.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 #ifndef rtkLastDimensionL0GradientDenoisingImageFilter_h
19 #define rtkLastDimensionL0GradientDenoisingImageFilter_h
20 
21 #include "itkInPlaceImageFilter.h"
22 
24 
25 namespace rtk
26 {
41 template <class TInputImage>
42 
44  : public itk::InPlaceImageFilter<TInputImage, TInputImage>
45 {
46 public:
47  ITK_DISALLOW_COPY_AND_MOVE(LastDimensionL0GradientDenoisingImageFilter);
48 
53  using InputPixelType = typename TInputImage::PixelType;
54 
56  itkNewMacro(Self);
57 
59 #ifdef itkOverrideGetNameOfClassMacro
60  itkOverrideGetNameOfClassMacro(LastDimensionL0GradientDenoisingImageFilter);
61 #else
63 #endif
64 
65 
67  itkGetMacro(Lambda, double);
68  itkSetMacro(Lambda, double);
70 
72  itkGetMacro(NumberOfIterations, unsigned int);
73  itkSetMacro(NumberOfIterations, unsigned int);
75 
76 protected:
78  ~LastDimensionL0GradientDenoisingImageFilter() override = default;
79 
80  void
81  GenerateInputRequestedRegion() override;
82 
84  void
85  ThreadedGenerateData(const typename TInputImage::RegionType & outputRegionForThread,
86  itk::ThreadIdType itkNotUsed(threadId)) override;
87 
90  GetImageRegionSplitter() const override;
92 
93  virtual void
94  OneDimensionMinimizeL0NormOfGradient(InputPixelType * input,
95  unsigned int length,
96  double lambda,
97  unsigned int nbIters);
98 
99  double m_Lambda;
100  unsigned int m_NumberOfIterations;
101 };
102 } // namespace rtk
103 
104 
105 #ifndef ITK_MANUAL_INSTANTIATION
106 # include "rtkLastDimensionL0GradientDenoisingImageFilter.hxx"
107 #endif
108 
109 #endif
Denoises along the last dimension, reducing the L0 norm of the gradient.
#define itkSetMacro(name, type)
unsigned int ThreadIdType