ITK  4.13.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:
78 
80  itkNewMacro(Self);
81 
84 
86  typedef typename TImage::PixelType PixelType;
87 
89 #ifdef ITK_USE_CONCEPT_CHECKING
90  // Begin concept checking
91  itkConceptMacro( PixelTypeComparableCheck,
93  itkConceptMacro( PixelTypeOStreamWritableCheck,
95  // End concept checking
96 #endif
97 
98 
101  itkSetMacro(OutsideValue, PixelType);
102 
104  itkGetConstMacro(OutsideValue, PixelType);
105 
107  void ThresholdAbove(const PixelType & thresh);
108 
110  void ThresholdBelow(const PixelType & thresh);
111 
113  void ThresholdOutside(const PixelType & lower, const PixelType & upper);
114 
116  itkSetMacro(Lower, PixelType);
117  itkGetConstMacro(Lower, PixelType);
119 
121  itkSetMacro(Upper, PixelType);
122  itkGetConstMacro(Upper, PixelType);
124 
126  typedef TImage InputImageType;
127  typedef typename InputImageType::ConstPointer InputImagePointer;
128  typedef typename InputImageType::RegionType InputImageRegionType;
129  typedef typename InputImageType::PixelType InputImagePixelType;
130 
132  typedef TImage OutputImageType;
133  typedef typename OutputImageType::Pointer OutputImagePointer;
134  typedef typename OutputImageType::RegionType OutputImageRegionType;
135  typedef typename OutputImageType::PixelType OutputImagePixelType;
136 
137 protected:
139  ~ThresholdImageFilter() ITK_OVERRIDE {}
140  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
141 
152  void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread,
153  ThreadIdType threadId) ITK_OVERRIDE;
154 
155 private:
156  ITK_DISALLOW_COPY_AND_ASSIGN(ThresholdImageFilter);
157 
161 };
162 } // end namespace itk
163 
164 #ifndef ITK_MANUAL_INSTANTIATION
165 #include "itkThresholdImageFilter.hxx"
166 #endif
167 
168 #endif
InputImageType::PixelType InputImagePixelType
OutputImageType::RegionType OutputImageRegionType
OutputImageType::PixelType OutputImagePixelType
Light weight base class for most itk classes.
InputImageType::RegionType InputImageRegionType
Set image values to a user-specified value if they are below, above, or between simple threshold valu...
InputImageType::ConstPointer InputImagePointer
OutputImageType::Pointer OutputImagePointer
InPlaceImageFilter< TImage, TImage > Superclass
unsigned int ThreadIdType
Definition: itkIntTypes.h:159
SmartPointer< const Self > ConstPointer
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Base class for filters that take an image as input and overwrite that image as the output...
#define itkConceptMacro(name, concept)