RTK  1.4.0
Reconstruction Toolkit
rtkMagnitudeThresholdImageFilter.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 rtkMagnitudeThresholdImageFilter_h
20 #define rtkMagnitudeThresholdImageFilter_h
21 
22 #include <itkInPlaceImageFilter.h>
23 #include <itkVector.h>
24 
25 namespace rtk
26 {
39 template< typename TInputImage,
40  typename TRealType = float,
41  typename TOutputImage = TInputImage>
43  public itk::InPlaceImageFilter< TInputImage, TOutputImage >
44 {
45 public:
46 
52 
54  itkNewMacro(Self);
55 
58 
61  typedef typename TOutputImage::PixelType OutputPixelType;
62  typedef typename TInputImage::PixelType InputPixelType;
63 
65  typedef TInputImage InputImageType;
66  typedef TOutputImage OutputImageType;
67  typedef typename InputImageType::Pointer InputImagePointer;
68  typedef typename OutputImageType::Pointer OutputImagePointer;
69 
71  itkStaticConstMacro(ImageDimension, unsigned int,
72  TOutputImage::ImageDimension);
73 
75  itkStaticConstMacro(VectorDimension, unsigned int,
76  InputPixelType::Dimension);
77 
79  typedef TRealType RealType;
82 
84  typedef typename Superclass::OutputImageRegionType OutputImageRegionType;
85 
86 #ifdef ITK_USE_CONCEPT_CHECKING
87 
88  itkConceptMacro( InputHasNumericTraitsCheck,
90  itkConceptMacro( RealTypeHasNumericTraitsCheck,
92 
94 #endif
95 
96  itkGetMacro(Threshold, TRealType)
97  itkSetMacro(Threshold, TRealType)
98 
99 protected:
101  virtual ~MagnitudeThresholdImageFilter() ITK_OVERRIDE {}
102 
103 #if ITK_VERSION_MAJOR<5
104  void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread,
105  itk::ThreadIdType threadId) ITK_OVERRIDE;
106 #else
107  void DynamicThreadedGenerateData(const OutputImageRegionType & outputRegionForThread) ITK_OVERRIDE;
108 #endif
109 
110 private:
111  TRealType m_Threshold;
112 
113  MagnitudeThresholdImageFilter(const Self &); //purposely not implemented
114  void operator=(const Self &); //purposely not implemented
115 };
116 } // end namespace itk
117 
118 #ifndef ITK_MANUAL_INSTANTIATION
119 #include "rtkMagnitudeThresholdImageFilter.hxx"
120 #endif
121 
122 #endif
itk::Vector< TRealType, InputPixelType::Dimension > RealVectorType
Superclass::OutputImageRegionType OutputImageRegionType
Performs thresholding on the norm of each vector-valued input pixel.
unsigned int ThreadIdType
itk::ImageToImageFilter< TInputImage, TOutputImage > Superclass
#define itkConceptMacro(name, concept)
itk::Image< RealVectorType, TInputImage::ImageDimension > RealVectorImageType
#define itkSetMacro(name, type)