ITK  4.5.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 {
54 template< typename TImage >
55 class ThresholdImageFilter:public InPlaceImageFilter< TImage, TImage >
56 {
57 public:
63 
65  itkNewMacro(Self);
66 
69 
71  typedef typename TImage::PixelType PixelType;
72 
74 #ifdef ITK_USE_CONCEPT_CHECKING
75  // Begin concept checking
76  itkConceptMacro( PixelTypeComparableCheck,
78  itkConceptMacro( PixelTypeOStreamWritableCheck,
80  // End concept checking
81 #endif
82 
83 
86  itkSetMacro(OutsideValue, PixelType);
87 
89  itkGetConstMacro(OutsideValue, PixelType);
90 
92  void ThresholdAbove(const PixelType & thresh);
93 
95  void ThresholdBelow(const PixelType & thresh);
96 
98  void ThresholdOutside(const PixelType & lower, const PixelType & upper);
99 
101  itkSetMacro(Lower, PixelType);
102  itkGetConstMacro(Lower, PixelType);
104 
106  itkSetMacro(Upper, PixelType);
107  itkGetConstMacro(Upper, PixelType);
109 
111  typedef TImage InputImageType;
112  typedef typename InputImageType::ConstPointer InputImagePointer;
113  typedef typename InputImageType::RegionType InputImageRegionType;
114  typedef typename InputImageType::PixelType InputImagePixelType;
115 
117  typedef TImage OutputImageType;
118  typedef typename OutputImageType::Pointer OutputImagePointer;
119  typedef typename OutputImageType::RegionType OutputImageRegionType;
120  typedef typename OutputImageType::PixelType OutputImagePixelType;
121 
122 protected:
125  void PrintSelf(std::ostream & os, Indent indent) const;
126 
137  void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread,
138  ThreadIdType threadId);
139 
140 private:
141  ThresholdImageFilter(const Self &); //purposely not implemented
142  void operator=(const Self &); //purposely not implemented
143 
147 };
148 } // end namespace itk
149 
150 #ifndef ITK_MANUAL_INSTANTIATION
151 #include "itkThresholdImageFilter.hxx"
152 #endif
153 
154 #endif
InputImageType::PixelType InputImagePixelType
OutputImageType::RegionType OutputImageRegionType
OutputImageType::PixelType OutputImagePixelType
Light weight base class for most itk classes.
InputImageType::RegionType InputImageRegionType
void ThresholdAbove(const PixelType &thresh)
Set image values to a user-specified value if they are below, above, or between simple threshold valu...
void ThresholdBelow(const PixelType &thresh)
void ThresholdOutside(const PixelType &lower, const PixelType &upper)
void operator=(const Self &)
void ThreadedGenerateData(const OutputImageRegionType &outputRegionForThread, ThreadIdType threadId)
InputImageType::ConstPointer InputImagePointer
OutputImageType::Pointer OutputImagePointer
InPlaceImageFilter< TImage, TImage > Superclass
SmartPointer< const Self > ConstPointer
Control indentation during Print() invocation.
Definition: itkIndent.h:49
void PrintSelf(std::ostream &os, Indent indent) const
Base class for filters that take an image as input and overwrite that image as the output...
#define itkConceptMacro(name, concept)
unsigned int ThreadIdType
Definition: itkIntTypes.h:159