ITK  6.0.0
Insight Toolkit
itkZeroCrossingBasedEdgeDetectionImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
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  * https://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 {
74 template <typename TInputImage, typename TOutputImage>
76  : public ImageToImageFilter<TInputImage, TOutputImage>
77 {
78 public:
79  ITK_DISALLOW_COPY_AND_MOVE(ZeroCrossingBasedEdgeDetectionImageFilter);
80 
84 
86  using InputImageType = TInputImage;
87  using OutputImageType = TOutputImage;
88 
92 
94  using InputImagePixelType = typename TInputImage::PixelType;
95  using OutputImagePixelType = typename TOutputImage::PixelType;
96 
98  itkNewMacro(Self);
99 
102 
104  itkOverrideGetNameOfClassMacro(ZeroCrossingBasedEdgeDetectionImageFilter);
105 
107  static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
108  static constexpr unsigned int OutputImageDimension = TOutputImage::ImageDimension;
109 
112 
114  itkSetMacro(Variance, ArrayType);
115  itkGetConstMacro(Variance, const ArrayType);
116  itkSetMacro(MaximumError, ArrayType);
117  itkGetConstMacro(MaximumError, const ArrayType);
121  itkGetConstMacro(BackgroundValue, OutputImagePixelType);
122  itkSetMacro(BackgroundValue, OutputImagePixelType);
123  itkGetConstMacro(ForegroundValue, OutputImagePixelType);
124  itkSetMacro(ForegroundValue, OutputImagePixelType);
128  void
130  {
131  m_Variance.Fill(v);
132  }
133 
140  void
142  {
143  m_MaximumError.Fill(v);
144  }
145 
146 #ifdef ITK_USE_CONCEPT_CHECKING
147  // Begin concept checking
148  itkConceptMacro(OutputEqualityComparableCheck, (Concept::EqualityComparable<OutputImagePixelType>));
152  itkConceptMacro(PixelTypeIsFloatingPointCheck, (Concept::IsFloatingPoint<InputImagePixelType>));
153  // End concept checking
154 #endif
155 
156 protected:
158 
159  ~ZeroCrossingBasedEdgeDetectionImageFilter() override = default;
160  void
161  PrintSelf(std::ostream & os, Indent indent) const override;
162 
169  void
170  GenerateData() override;
171 
172 private:
174  ArrayType m_Variance{};
175 
178  ArrayType m_MaximumError{};
179 
180  OutputImagePixelType m_BackgroundValue{};
181  OutputImagePixelType m_ForegroundValue{};
182 };
183 } // end of namespace itk
184 
185 #ifndef ITK_MANUAL_INSTANTIATION
186 # include "itkZeroCrossingBasedEdgeDetectionImageFilter.hxx"
187 #endif
188 
189 #endif
itk::ZeroCrossingBasedEdgeDetectionImageFilter::SetMaximumError
void SetMaximumError(const typename ArrayType::ValueType v)
Definition: itkZeroCrossingBasedEdgeDetectionImageFilter.h:141
itk::Concept::OStreamWritable
Definition: itkConceptChecking.h:638
itkImage.h
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::ZeroCrossingBasedEdgeDetectionImageFilter::SetVariance
void SetVariance(const typename ArrayType::ValueType v)
Definition: itkZeroCrossingBasedEdgeDetectionImageFilter.h:129
itk::Concept::SameDimension
Definition: itkConceptChecking.h:696
itk::ImageToImageFilter::InputImagePixelType
typename InputImageType::PixelType InputImagePixelType
Definition: itkImageToImageFilter.h:133
itk::ImageToImageFilter
Base class for filters that take an image as input and produce an image as output.
Definition: itkImageToImageFilter.h:108
itk::ImageSource
Base class for all process objects that output image data.
Definition: itkImageSource.h:67
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itk::Concept::IsFloatingPoint
Definition: itkConceptChecking.h:948
itk::ImageToImageFilter::InputImageType
TInputImage InputImageType
Definition: itkImageToImageFilter.h:129
itkImageToImageFilter.h
itk::FixedArray< double, Self::ImageDimension >
itk::ImageSource::OutputImageRegionType
typename OutputImageType::RegionType OutputImageRegionType
Definition: itkImageSource.h:92
itkConceptMacro
#define itkConceptMacro(name, concept)
Definition: itkConceptChecking.h:65
itk::Concept::SameType
Definition: itkConceptChecking.h:679
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::ProcessObject
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Definition: itkProcessObject.h:139
itk::ImageSource::OutputImagePixelType
typename OutputImageType::PixelType OutputImagePixelType
Definition: itkImageSource.h:93
itk::ZeroCrossingBasedEdgeDetectionImageFilter
This filter implements a zero-crossing based edge detector.
Definition: itkZeroCrossingBasedEdgeDetectionImageFilter.h:75
itk::Concept::EqualityComparable
Definition: itkConceptChecking.h:306
itk::FixedArray< double, Self::ImageDimension >::ValueType
double ValueType
Definition: itkFixedArray.h:63
itk::ImageSource::OutputImageType
TOutputImage OutputImageType
Definition: itkImageSource.h:90