RTK  2.6.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  itkOverrideGetNameOfClassMacro(LastDimensionL0GradientDenoisingImageFilter);
60 
62  itkGetMacro(Lambda, double);
63  itkSetMacro(Lambda, double);
65 
67  itkGetMacro(NumberOfIterations, unsigned int);
68  itkSetMacro(NumberOfIterations, unsigned int);
70 
71 protected:
73  ~LastDimensionL0GradientDenoisingImageFilter() override = default;
74 
75  void
76  GenerateInputRequestedRegion() override;
77 
79  void
80  ThreadedGenerateData(const typename TInputImage::RegionType & outputRegionForThread,
81  itk::ThreadIdType itkNotUsed(threadId)) override;
82 
85  GetImageRegionSplitter() const override;
87 
88  virtual void
89  OneDimensionMinimizeL0NormOfGradient(InputPixelType * input,
90  unsigned int length,
91  double lambda,
92  unsigned int nbIters);
93 
94  double m_Lambda;
95  unsigned int m_NumberOfIterations;
96 };
97 } // namespace rtk
98 
99 
100 #ifndef ITK_MANUAL_INSTANTIATION
101 # include "rtkLastDimensionL0GradientDenoisingImageFilter.hxx"
102 #endif
103 
104 #endif
Denoises along the last dimension, reducing the L0 norm of the gradient.
#define itkSetMacro(name, type)
unsigned int ThreadIdType