ITK  5.2.0
Insight Toolkit
itkThresholdImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
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  *
20  * Portions of this file are subject to the VTK Toolkit Version 3 copyright.
21  *
22  * Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
23  *
24  * For complete copyright, license and disclaimer of warranty information
25  * please refer to the NOTICE file at the top of the ITK source tree.
26  *
27  *=========================================================================*/
28 #ifndef itkThresholdImageFilter_h
29 #define itkThresholdImageFilter_h
30 
31 #include "itkInPlaceImageFilter.h"
32 
33 #include "itkConceptChecking.h"
34 
35 namespace itk
36 {
70 template <typename TImage>
71 class ITK_TEMPLATE_EXPORT ThresholdImageFilter : public InPlaceImageFilter<TImage, TImage>
72 {
73 public:
74  ITK_DISALLOW_COPY_AND_MOVE(ThresholdImageFilter);
75 
81 
83  itkNewMacro(Self);
84 
87 
89  using PixelType = typename TImage::PixelType;
90 
92 #ifdef ITK_USE_CONCEPT_CHECKING
93  // Begin concept checking
94  itkConceptMacro(PixelTypeComparableCheck, (Concept::Comparable<PixelType>));
95  itkConceptMacro(PixelTypeOStreamWritableCheck, (Concept::OStreamWritable<PixelType>));
96  // End concept checking
97 #endif
98 
99 
102  itkSetMacro(OutsideValue, PixelType);
103 
105  itkGetConstMacro(OutsideValue, PixelType);
106 
108  void
109  ThresholdAbove(const PixelType & thresh);
110 
112  void
113  ThresholdBelow(const PixelType & thresh);
114 
116  void
117  ThresholdOutside(const PixelType & lower, const PixelType & upper);
118 
120  itkSetMacro(Lower, PixelType);
121  itkGetConstMacro(Lower, PixelType);
123 
125  itkSetMacro(Upper, PixelType);
126  itkGetConstMacro(Upper, PixelType);
128 
130  using InputImageType = TImage;
131  using InputImagePointer = typename InputImageType::ConstPointer;
133  using InputImagePixelType = typename InputImageType::PixelType;
134 
136  using OutputImageType = TImage;
137  using OutputImagePointer = typename OutputImageType::Pointer;
139  using OutputImagePixelType = typename OutputImageType::PixelType;
140 
141 protected:
143  ~ThresholdImageFilter() override = default;
144  void
145  PrintSelf(std::ostream & os, Indent indent) const override;
146 
157  void
158  DynamicThreadedGenerateData(const OutputImageRegionType & outputRegionForThread) override;
159 
160 private:
164 };
165 } // end namespace itk
166 
167 #ifndef ITK_MANUAL_INSTANTIATION
168 # include "itkThresholdImageFilter.hxx"
169 #endif
170 
171 #endif
itk::ThresholdImageFilter::m_OutsideValue
PixelType m_OutsideValue
Definition: itkThresholdImageFilter.h:161
itk::ThresholdImageFilter::InputImagePointer
typename InputImageType::ConstPointer InputImagePointer
Definition: itkThresholdImageFilter.h:131
itk::Concept::OStreamWritable
Definition: itkConceptChecking.h:634
itk::ThresholdImageFilter::PixelType
typename TImage::PixelType PixelType
Definition: itkThresholdImageFilter.h:89
itk::InPlaceImageFilter
Base class for filters that take an image as input and overwrite that image as the output.
Definition: itkInPlaceImageFilter.h:77
itkConceptChecking.h
itk::ThresholdImageFilter::m_Upper
PixelType m_Upper
Definition: itkThresholdImageFilter.h:163
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::ThresholdImageFilter::OutputImagePixelType
typename OutputImageType::PixelType OutputImagePixelType
Definition: itkThresholdImageFilter.h:139
itk::ThresholdImageFilter::InputImagePixelType
typename InputImageType::PixelType InputImagePixelType
Definition: itkThresholdImageFilter.h:133
itk::ThresholdImageFilter::InputImageRegionType
typename InputImageType::RegionType InputImageRegionType
Definition: itkThresholdImageFilter.h:132
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itk::ThresholdImageFilter::OutputImagePointer
typename OutputImageType::Pointer OutputImagePointer
Definition: itkThresholdImageFilter.h:137
itk::ThresholdImageFilter::InputImageType
TImage InputImageType
Definition: itkThresholdImageFilter.h:130
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itk::ThresholdImageFilter::OutputImageRegionType
typename OutputImageType::RegionType OutputImageRegionType
Definition: itkThresholdImageFilter.h:138
itk::ThresholdImageFilter
Set image values to a user-specified value if they are below, above, or between simple threshold valu...
Definition: itkThresholdImageFilter.h:71
itk::Concept::Comparable
Definition: itkConceptChecking.h:328
itk::ThresholdImageFilter::m_Lower
PixelType m_Lower
Definition: itkThresholdImageFilter.h:162
itkConceptMacro
#define itkConceptMacro(name, concept)
Definition: itkConceptChecking.h:64
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itkInPlaceImageFilter.h
itk::ThresholdImageFilter::OutputImageType
TImage OutputImageType
Definition: itkThresholdImageFilter.h:136