ITK  4.4.0
Insight Segmentation and Registration Toolkit
itkZeroCrossingBasedEdgeDetectionImageFilter.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 __itkZeroCrossingBasedEdgeDetectionImageFilter_h
19 #define __itkZeroCrossingBasedEdgeDetectionImageFilter_h
20 
21 #include "itkImageToImageFilter.h"
22 #include "itkImage.h"
23 
24 namespace itk
25 {
69 template< class TInputImage, class TOutputImage >
71  public ImageToImageFilter< TInputImage, TOutputImage >
72 {
73 public:
77 
79  typedef TInputImage InputImageType;
80  typedef TOutputImage OutputImageType;
81 
85 
87  typedef typename TInputImage::PixelType InputImagePixelType;
88  typedef typename TOutputImage::PixelType OutputImagePixelType;
89 
91  itkNewMacro(Self);
92 
94  typedef typename TOutputImage::RegionType OutputImageRegionType;
95 
98 
100  itkStaticConstMacro(ImageDimension, unsigned int,
101  TInputImage::ImageDimension);
102  itkStaticConstMacro(OutputImageDimension, unsigned int,
103  TOutputImage::ImageDimension);
105 
108 
110  itkSetMacro(Variance, ArrayType);
111  itkGetConstMacro(Variance, const ArrayType);
112  itkSetMacro(MaximumError, ArrayType);
113  itkGetConstMacro(MaximumError, const ArrayType);
115 
117  itkGetConstMacro(BackgroundValue, OutputImagePixelType);
118  itkSetMacro(BackgroundValue, OutputImagePixelType);
119  itkGetConstMacro(ForegroundValue, OutputImagePixelType);
120  itkSetMacro(ForegroundValue, OutputImagePixelType);
122 
124  void SetVariance(const typename ArrayType::ValueType v)
125  {
126  m_Variance.Fill(v);
127  }
128 
135  void SetMaximumError(const typename ArrayType::ValueType v)
136  {
137  m_MaximumError.Fill(v);
138  }
139 
140 #ifdef ITK_USE_CONCEPT_CHECKING
141 
142  itkConceptMacro( OutputEqualityComparableCheck,
144  itkConceptMacro( SameDimensionCheck,
146  itkConceptMacro( SameTypeCheck,
148  itkConceptMacro( OutputOStreamWritableCheck,
150  itkConceptMacro( PixelTypeIsFloatingPointCheck,
152 
154 #endif
155 
156 protected:
158  {
159  m_Variance.Fill(1.0);
160  m_MaximumError.Fill(0.01);
162  m_ForegroundValue = NumericTraits< OutputImagePixelType >::One;
163  }
164 
166  void PrintSelf(std::ostream & os, Indent indent) const;
167 
174  void GenerateData();
175 
176 private:
177  ZeroCrossingBasedEdgeDetectionImageFilter(const Self &); //purposely not implemented
178  void operator=(const Self &); //purposely not implemented
179 
182 
186 
189 };
190 } //end of namespace itk
191 
192 #ifndef ITK_MANUAL_INSTANTIATION
193 #include "itkZeroCrossingBasedEdgeDetectionImageFilter.hxx"
194 #endif
195 
196 #endif
197