ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkThresholdImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software 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  *
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 {
69 template< typename TImage >
70 class ITK_TEMPLATE_EXPORT ThresholdImageFilter:public InPlaceImageFilter< TImage, TImage >
71 {
72 public:
73  ITK_DISALLOW_COPY_AND_ASSIGN(ThresholdImageFilter);
74 
80 
82  itkNewMacro(Self);
83 
86 
88  using PixelType = typename TImage::PixelType;
89 
91 #ifdef ITK_USE_CONCEPT_CHECKING
92  // Begin concept checking
93  itkConceptMacro( PixelTypeComparableCheck,
95  itkConceptMacro( PixelTypeOStreamWritableCheck,
97  // End concept checking
98 #endif
99 
100 
103  itkSetMacro(OutsideValue, PixelType);
104 
106  itkGetConstMacro(OutsideValue, PixelType);
107 
109  void ThresholdAbove(const PixelType & thresh);
110 
112  void ThresholdBelow(const PixelType & thresh);
113 
115  void ThresholdOutside(const PixelType & lower, const PixelType & upper);
116 
118  itkSetMacro(Lower, PixelType);
119  itkGetConstMacro(Lower, PixelType);
121 
123  itkSetMacro(Upper, PixelType);
124  itkGetConstMacro(Upper, PixelType);
126 
128  using InputImageType = TImage;
129  using InputImagePointer = typename InputImageType::ConstPointer;
131  using InputImagePixelType = typename InputImageType::PixelType;
132 
134  using OutputImageType = TImage;
135  using OutputImagePointer = typename OutputImageType::Pointer;
137  using OutputImagePixelType = typename OutputImageType::PixelType;
138 
139 protected:
141  ~ThresholdImageFilter() override = default;
142  void PrintSelf(std::ostream & os, Indent indent) const override;
143 
154  void DynamicThreadedGenerateData(const OutputImageRegionType & outputRegionForThread) override;
155 
156 private:
160 };
161 } // end namespace itk
162 
163 #ifndef ITK_MANUAL_INSTANTIATION
164 #include "itkThresholdImageFilter.hxx"
165 #endif
166 
167 #endif
Light weight base class for most itk classes.
Set image values to a user-specified value if they are below, above, or between simple threshold valu...
typename InputImageType::ConstPointer InputImagePointer
typename TImage::PixelType PixelType
typename OutputImageType::RegionType OutputImageRegionType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
typename InputImageType::RegionType InputImageRegionType
typename OutputImageType::PixelType OutputImagePixelType
Base class for filters that take an image as input and overwrite that image as the output...
typename OutputImageType::Pointer OutputImagePointer
#define itkConceptMacro(name, concept)
typename InputImageType::PixelType InputImagePixelType