RTK  1.4.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  * 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 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,
45  typename TRealType = float,
46  typename TOutputImage = TInputImage>
47 class ITK_EXPORT SoftThresholdTVImageFilter:
48  public itk::ImageToImageFilter< TInputImage, TOutputImage >
49 {
50 public:
56 
58  itkNewMacro(Self);
59 
62 
65  typedef typename TOutputImage::PixelType OutputPixelType;
66  typedef typename TInputImage::PixelType InputPixelType;
67 
69  typedef TInputImage InputImageType;
70  typedef TOutputImage OutputImageType;
71  typedef typename InputImageType::Pointer InputImagePointer;
72  typedef typename OutputImageType::Pointer OutputImagePointer;
73 
75  itkStaticConstMacro(ImageDimension, unsigned int,
76  TOutputImage::ImageDimension);
77 
79  itkStaticConstMacro(VectorDimension, unsigned int,
80  InputPixelType::Dimension);
81 
83  typedef TRealType RealType;
86 
88  typedef typename Superclass::OutputImageRegionType OutputImageRegionType;
89 
90 #ifdef ITK_USE_CONCEPT_CHECKING
91 
92  itkConceptMacro( InputHasNumericTraitsCheck,
94  itkConceptMacro( RealTypeHasNumericTraitsCheck,
96 
98 #endif
99 
100  itkGetMacro(Threshold, float)
101  itkSetMacro(Threshold, float)
102 
103 protected:
105  virtual ~SoftThresholdTVImageFilter() ITK_OVERRIDE {}
106 
110 // void BeforeThreadedGenerateData();
111 
123 #if ITK_VERSION_MAJOR<5
124  void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread,
125  ThreadIdType threadId) ITK_OVERRIDE;
126 #else
127  void DynamicThreadedGenerateData(const OutputImageRegionType & outputRegionForThread) ITK_OVERRIDE;
128 #endif
129 
130 
131 // typedef typename InputImageType::Superclass ImageBaseType;
132 
133 private:
134  float m_Threshold;
136 
137  SoftThresholdTVImageFilter(const Self &); //purposely not implemented
138  void operator=(const Self &); //purposely not implemented
139 };
140 } // end namespace itk
141 
142 #ifndef ITK_MANUAL_INSTANTIATION
143 #include "rtkSoftThresholdTVImageFilter.hxx"
144 #endif
145 
146 #endif
Superclass::OutputImageRegionType OutputImageRegionType
itk::Image< RealVectorType, TInputImage::ImageDimension > RealVectorImageType
itk::Vector< TRealType, InputPixelType::Dimension > RealVectorType
unsigned int ThreadIdType
itk::SmartPointer< const Self > ConstPointer
itk::ImageToImageFilter< TInputImage, TOutputImage > Superclass
Computes the Total Variation from a gradient input image (pixels are vectors), soft thresholds it...
#define itkConceptMacro(name, concept)
#define itkSetMacro(name, type)