ITK  4.13.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< typename TInputImage, typename 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  // Begin concept checking
142  itkConceptMacro( OutputEqualityComparableCheck,
144  itkConceptMacro( SameDimensionCheck,
146  itkConceptMacro( SameTypeCheck,
148  itkConceptMacro( OutputOStreamWritableCheck,
150  itkConceptMacro( PixelTypeIsFloatingPointCheck,
152  // End concept checking
153 #endif
154 
155 protected:
157  {
158  m_Variance.Fill(1.0);
159  m_MaximumError.Fill(0.01);
162  }
163 
165  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
166 
173  void GenerateData() ITK_OVERRIDE;
174 
175 private:
176  ITK_DISALLOW_COPY_AND_ASSIGN(ZeroCrossingBasedEdgeDetectionImageFilter);
177 
179  ArrayType m_Variance;
180 
183  ArrayType m_MaximumError;
184 
185  OutputImagePixelType m_BackgroundValue;
186  OutputImagePixelType m_ForegroundValue;
187 };
188 } //end of namespace itk
189 
190 #ifndef ITK_MANUAL_INSTANTIATION
191 #include "itkZeroCrossingBasedEdgeDetectionImageFilter.hxx"
192 #endif
193 
194 #endif
Base class for all process objects that output image data.
FixedArray< double, itkGetStaticConstMacro(ImageDimension) > ArrayType
This filter implements a zero-crossing based edge detecor.
OutputImageType::PixelType OutputImagePixelType
Base class for filters that take an image as input and produce an image as output.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
#define itkConceptMacro(name, concept)