ITK  4.3.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< class TImage >
55 class ITK_EXPORT 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 
77  itkConceptMacro( PixelTypeComparableCheck,
79  itkConceptMacro( PixelTypeOStreamWritableCheck,
81 
83 #endif
84 
87  itkSetMacro(OutsideValue, PixelType);
88 
90  itkGetConstMacro(OutsideValue, PixelType);
91 
93  void ThresholdAbove(const PixelType & thresh);
94 
96  void ThresholdBelow(const PixelType & thresh);
97 
99  void ThresholdOutside(const PixelType & lower, const PixelType & upper);
100 
102  itkSetMacro(Lower, PixelType);
103  itkGetConstMacro(Lower, PixelType);
105 
107  itkSetMacro(Upper, PixelType);
108  itkGetConstMacro(Upper, PixelType);
110 
112  typedef TImage InputImageType;
113  typedef typename InputImageType::ConstPointer InputImagePointer;
114  typedef typename InputImageType::RegionType InputImageRegionType;
115  typedef typename InputImageType::PixelType InputImagePixelType;
116 
118  typedef TImage OutputImageType;
119  typedef typename OutputImageType::Pointer OutputImagePointer;
120  typedef typename OutputImageType::RegionType OutputImageRegionType;
121  typedef typename OutputImageType::PixelType OutputImagePixelType;
122 
123 protected:
126  void PrintSelf(std::ostream & os, Indent indent) const;
127 
138  void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread,
139  ThreadIdType threadId);
140 
141 private:
142  ThresholdImageFilter(const Self &); //purposely not implemented
143  void operator=(const Self &); //purposely not implemented
144 
148 };
149 } // end namespace itk
150 
151 #ifndef ITK_MANUAL_INSTANTIATION
152 #include "itkThresholdImageFilter.hxx"
153 #endif
154 
155 #endif
156