RTK  2.0.1
Reconstruction Toolkit
rtkSingularValueThresholdImageFilter.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 rtkSingularValueThresholdImageFilter_h
20 #define rtkSingularValueThresholdImageFilter_h
21 
22 #include <itkInPlaceImageFilter.h>
23 #include <itkVector.h>
24 
26 
27 namespace rtk
28 {
49 template< typename TInputImage,
50  typename TRealType = float,
51  typename TOutputImage = TInputImage>
53  public itk::InPlaceImageFilter< TInputImage, TOutputImage >
54 {
55 public:
56  ITK_DISALLOW_COPY_AND_ASSIGN(SingularValueThresholdImageFilter);
57 
63 
65  itkNewMacro(Self);
66 
69 
72  using OutputPixelType = typename TOutputImage::PixelType;
73  using InputPixelType = typename TInputImage::PixelType;
74 
76  using InputImageType = TInputImage;
77  using OutputImageType = TOutputImage;
78  using InputImagePointer = typename InputImageType::Pointer;
79  using OutputImagePointer = typename OutputImageType::Pointer;
80 
82  itkStaticConstMacro(ImageDimension, unsigned int,
83  TOutputImage::ImageDimension);
84 
86  itkStaticConstMacro(VectorDimension, unsigned int,
87  InputPixelType::Dimension);
88 
90  using RealType = TRealType;
93 
95  using OutputImageRegionType = typename Superclass::OutputImageRegionType;
96 
97 #ifdef ITK_USE_CONCEPT_CHECKING
98 
99  itkConceptMacro( InputHasNumericTraitsCheck,
101  itkConceptMacro( RealTypeHasNumericTraitsCheck,
103 
105 #endif
106 
107  itkGetMacro(Threshold, TRealType)
108  itkSetMacro(Threshold, TRealType)
109 
110 protected:
112  ~SingularValueThresholdImageFilter() override = default;
113 
114  void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread,
115  itk::ThreadIdType threadId) override;
116 
118  const itk::ImageRegionSplitterBase* GetImageRegionSplitter(void) const override;
120 
121 private:
122  TRealType m_Threshold;
123 
124 };
125 } // end namespace itk
126 
127 #ifndef ITK_MANUAL_INSTANTIATION
128 #include "rtkSingularValueThresholdImageFilter.hxx"
129 #endif
130 
131 #endif
typename Superclass::OutputImageRegionType OutputImageRegionType
unsigned int ThreadIdType
Performs thresholding on the singular values.
#define itkConceptMacro(name, concept)
#define itkSetMacro(name, type)