RTK  2.6.0
Reconstruction Toolkit
rtkSoftThresholdTVImageFilter.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 rtkSoftThresholdTVImageFilter_h
20 #define rtkSoftThresholdTVImageFilter_h
21 
23 #include <itkImageToImageFilter.h>
24 #include <itkImage.h>
25 #include <itkVector.h>
26 #include "vnl/vnl_matrix.h"
27 #include "vnl/vnl_vector_fixed.h"
28 #include "vnl/algo/vnl_symmetric_eigensystem.h"
29 #include "rtkConfiguration.h"
30 
31 namespace rtk
32 {
44 template <typename TInputImage, typename TOutputImage = TInputImage>
45 class ITK_TEMPLATE_EXPORT SoftThresholdTVImageFilter : public itk::ImageToImageFilter<TInputImage, TOutputImage>
46 {
47 public:
48  ITK_DISALLOW_COPY_AND_MOVE(SoftThresholdTVImageFilter);
49 
55 
57  itkNewMacro(Self);
58 
60 #ifdef itkOverrideGetNameOfClassMacro
61  itkOverrideGetNameOfClassMacro(SoftThresholdTVImageFilter);
62 #else
64 #endif
65 
66 
69  using OutputPixelType = typename TOutputImage::PixelType;
70  using InputPixelType = typename TInputImage::PixelType;
71 
73  using InputImageType = TInputImage;
74  using OutputImageType = TOutputImage;
75  using InputImagePointer = typename InputImageType::Pointer;
76  using OutputImagePointer = typename OutputImageType::Pointer;
77 
79  static constexpr unsigned int ImageDimension = TOutputImage::ImageDimension;
80 
82  static constexpr unsigned int VectorDimension = InputPixelType::Dimension;
83 
85  using OutputImageRegionType = typename Superclass::OutputImageRegionType;
86 
87 #ifdef ITK_USE_CONCEPT_CHECKING
88 
90 
92 #endif
93 
94  itkGetMacro(Threshold, float);
95  itkSetMacro(Threshold, float);
96 
97 protected:
99  ~SoftThresholdTVImageFilter() override = default;
100 
104  // void BeforeThreadedGenerateData();
105 
117  void
118  DynamicThreadedGenerateData(const OutputImageRegionType & outputRegionForThread) override;
119 
120  // using ImageBaseType = typename InputImageType::Superclass;
121 
122 private:
123  float m_Threshold;
125 };
126 } // namespace rtk
127 
128 #ifndef ITK_MANUAL_INSTANTIATION
129 # include "rtkSoftThresholdTVImageFilter.hxx"
130 #endif
131 
132 #endif
typename OutputImageType::Pointer OutputImagePointer
TInputImage InputImageType
#define itkSetMacro(name, type)
typename InputImageType::Pointer InputImagePointer
typename OutputImageType::RegionType OutputImageRegionType
TOutputImage OutputImageType
typename TInputImage::PixelType InputPixelType
typename TOutputImage::PixelType OutputPixelType
Computes the Total Variation from a gradient input image (pixels are vectors), soft thresholds it...
unsigned int ThreadIdType
#define itkConceptMacro(name, concept)