RTK  2.0.1
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 "RTKExport.h"
26 #include "rtkMacro.h"
27 
28 namespace rtk
29 {
48 template< typename TInputImage>
50 {
51 public:
52  ITK_DISALLOW_COPY_AND_ASSIGN(ConditionalMedianImageFilter);
53 
59 
61  itkNewMacro(Self)
62 
63 
65 
68  itkGetMacro(Radius, MedianRadiusType)
69 
71  itkSetMacro(ThresholdMultiplier, double)
72  itkGetMacro(ThresholdMultiplier, double)
73 
74 protected:
75  ConditionalMedianImageFilter();
76  ~ConditionalMedianImageFilter() override = default;
77 
78  void GenerateInputRequestedRegion() override;
79 
81 #if ITK_VERSION_MAJOR<5
82  void ThreadedGenerateData(const typename TInputImage::RegionType& outputRegionForThread, itk::ThreadIdType itkNotUsed(threadId)) override;
83 #else
84  void DynamicThreadedGenerateData(const typename TInputImage::RegionType& outputRegionForThread) override;
85 #endif
86 
87 
90 };
91 
92 template <>
93 RTK_EXPORT
94 void
96 #if ITK_VERSION_MAJOR<5
97 ::ThreadedGenerateData(const itk::VectorImage<float, 3>::RegionType& outputRegionForThread, itk::ThreadIdType itkNotUsed(threadId));
98 #else
99 ::DynamicThreadedGenerateData(const itk::VectorImage<float, 3>::RegionType& outputRegionForThread);
100 #endif
101 
102 } //namespace rtk
103 
104 
105 #ifndef ITK_MANUAL_INSTANTIATION
106 #include "rtkConditionalMedianImageFilter.hxx"
107 #endif
108 
109 #endif // rtkConditionalMedianImageFilter_h
void ThreadedGenerateData(const typename TInputImage::RegionType &outputRegionForThread, itk::ThreadIdType) override
Performs a median filtering on outlier pixels.
unsigned int ThreadIdType
void GenerateInputRequestedRegion() override
typename Superclass::RegionType RegionType
typename itk::ConstNeighborhoodIterator< TOutputImage >::RadiusType MedianRadiusType
typename Superclass::RadiusType RadiusType
#define itkSetMacro(name, type)