ITK  4.2.0
Insight Segmentation and Registration Toolkit
itkZeroCrossingImageFilter.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 #ifndef __itkZeroCrossingImageFilter_h
19 #define __itkZeroCrossingImageFilter_h
20 
21 #include "itkImageToImageFilter.h"
22 namespace itk
23 {
62 template< class TInputImage, class TOutputImage >
63 class ITK_EXPORT ZeroCrossingImageFilter:
64  public ImageToImageFilter< TInputImage, TOutputImage >
65 {
66 public:
70 
72  typedef TInputImage InputImageType;
73  typedef TOutputImage OutputImageType;
74 
78 
80  typedef typename TInputImage::PixelType InputImagePixelType;
81  typedef typename TOutputImage::PixelType OutputImagePixelType;
82 
84  itkNewMacro(Self);
85 
87  typedef typename TOutputImage::RegionType OutputImageRegionType;
88 
91 
93  itkStaticConstMacro(ImageDimension, unsigned int,
94  TInputImage::ImageDimension);
95  itkStaticConstMacro(OutputImageDimension, unsigned int,
96  TOutputImage::ImageDimension);
98 
107  virtual void GenerateInputRequestedRegion()
109 
111  itkSetMacro(ForegroundValue, OutputImagePixelType);
112  itkGetConstMacro(ForegroundValue, OutputImagePixelType);
114 
116  itkSetMacro(BackgroundValue, OutputImagePixelType);
117  itkGetConstMacro(BackgroundValue, OutputImagePixelType);
119 
120 #ifdef ITK_USE_CONCEPT_CHECKING
121 
122  itkConceptMacro( OutputEqualityComparableCheck,
124  itkConceptMacro( SameDimensionCheck,
126  itkConceptMacro( InputComparableCheck,
128  itkConceptMacro( OutputOStreamWritableCheck,
130 
132 #endif
133 protected:
135  {
136  m_ForegroundValue = NumericTraits< OutputImagePixelType >::One;
138  }
139 
141  void PrintSelf(std::ostream & os, Indent indent) const;
142 
143  OutputImagePixelType m_BackgroundValue;
144  OutputImagePixelType m_ForegroundValue;
145 
157  void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread,
158  ThreadIdType threadId);
159 private:
160  ZeroCrossingImageFilter(const Self &); //purposely not implemented
161  void operator=(const Self &); //purposely not implemented
163 
164 };
165 } //end of namespace itk
166 
167 #ifndef ITK_MANUAL_INSTANTIATION
168 #include "itkZeroCrossingImageFilter.hxx"
169 #endif
170 
171 #endif
172