RTK  1.4.0
Reconstruction Toolkit
rtkConditionalMedianImageFilter.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 #ifndef rtkConditionalMedianImageFilter_h
19 #define rtkConditionalMedianImageFilter_h
20 
21 #include <itkInPlaceImageFilter.h>
23 #include <itkVectorImage.h>
24 
25 #include "rtkWin32Header.h"
26 #include "rtkMacro.h"
27 
28 namespace rtk
29 {
48 template< typename TInputImage>
50 {
51 public:
57 
59  itkNewMacro(Self)
60 
61 
63 
65  itkSetMacro(Radius, MedianRadiusType)
66  itkGetMacro(Radius, MedianRadiusType)
67 
69  itkSetMacro(ThresholdMultiplier, double)
70  itkGetMacro(ThresholdMultiplier, double)
71 
72 protected:
73  ConditionalMedianImageFilter();
74  virtual ~ConditionalMedianImageFilter() ITK_OVERRIDE {}
75 
76  void GenerateInputRequestedRegion() ITK_OVERRIDE;
77 
79 #if ITK_VERSION_MAJOR<5
80  void ThreadedGenerateData(const typename TInputImage::RegionType& outputRegionForThread, itk::ThreadIdType itkNotUsed(threadId)) ITK_OVERRIDE;
81 #else
82  void DynamicThreadedGenerateData(const typename TInputImage::RegionType& outputRegionForThread) ITK_OVERRIDE;
83 #endif
84 
85 
86  MedianRadiusType m_Radius;
88 
89 private:
90  ConditionalMedianImageFilter(const Self &); //purposely not implemented
91  void operator=(const Self &); //purposely not implemented
92 
93 };
94 
95 template <>
97 void
99 #if ITK_VERSION_MAJOR<5
100 ::ThreadedGenerateData(const itk::VectorImage<float, 3>::RegionType& outputRegionForThread, itk::ThreadIdType itkNotUsed(threadId));
101 #else
102 ::DynamicThreadedGenerateData(const itk::VectorImage<float, 3>::RegionType& outputRegionForThread);
103 #endif
104 
105 } //namespace rtk
106 
107 
108 #ifndef ITK_MANUAL_INSTANTIATION
109 #include "rtkConditionalMedianImageFilter.hxx"
110 #endif
111 
112 #endif // rtkConditionalMedianImageFilter_h
void ThreadedGenerateData(const typename TInputImage::RegionType &outputRegionForThread, itk::ThreadIdType) override
itk::InPlaceImageFilter< TInputImage > Superclass
itk::ConstNeighborhoodIterator< TInputImage >::RadiusType MedianRadiusType
Performs a median filtering on outlier pixels.
#define RTK_EXPORT
unsigned int ThreadIdType
void GenerateInputRequestedRegion() override
typename Superclass::RegionType RegionType
typename Superclass::RadiusType RadiusType
#define itkSetMacro(name, type)