ITK  4.3.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 
134 protected:
136  {
137  m_ForegroundValue = NumericTraits< OutputImagePixelType >::One;
139  }
140 
142  void PrintSelf(std::ostream & os, Indent indent) const;
143 
144  OutputImagePixelType m_BackgroundValue;
145  OutputImagePixelType m_ForegroundValue;
146 
158  void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread,
159  ThreadIdType threadId);
160 
161 private:
162  ZeroCrossingImageFilter(const Self &); //purposely not implemented
163  void operator=(const Self &); //purposely not implemented
164 
165 };
166 } //end of namespace itk
167 
168 #ifndef ITK_MANUAL_INSTANTIATION
169 #include "itkZeroCrossingImageFilter.hxx"
170 #endif
171 
172 #endif
173