ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkSobelOperator.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 itkSobelOperator_h
19 #define itkSobelOperator_h
20 
22 
23 namespace itk
24 {
94 template< typename TPixel, unsigned int VDimension = 2,
95  typename TAllocator = NeighborhoodAllocator< TPixel > >
96 class ITK_TEMPLATE_EXPORT SobelOperator:
97  public NeighborhoodOperator< TPixel, VDimension, TAllocator >
98 {
99 public:
100 
104 
105  itkTypeMacro(SobelOperator, NeighborhoodOperator);
106 
107  SobelOperator() = default;
108  SobelOperator(const Self & other):
109  NeighborhoodOperator< TPixel, VDimension, TAllocator >(other)
110  {}
111 
117  void CreateDirectional() override
118  {
119  this->CreateToRadius(1);
120  }
121 
126  // virtual void CreateToRadius(const unsigned long);
127 
131  Self & operator=(const Self & other)
132  {
133  Superclass::operator=(other);
134  return *this;
135  }
137 
141  void PrintSelf(std::ostream & os, Indent i) const override
142  {
143  os << i << "SobelOperator { this=" << this << "}" << std::endl;
144  Superclass::PrintSelf( os, i.GetNextIndent() );
145  }
147 
148 protected:
153  using CoefficientVector = typename Superclass::CoefficientVector;
155 
159  CoefficientVector GenerateCoefficients() override;
160 
164  void Fill(const CoefficientVector & c) override;
165 };
166 } // namespace itk
167 
168 #ifndef ITK_MANUAL_INSTANTIATION
169 #include "itkSobelOperator.hxx"
170 #endif
171 
172 #endif
A light-weight container object for storing an N-dimensional neighborhood of values.
SobelOperator(const Self &other)
void PrintSelf(std::ostream &os, Indent i) const override
Virtual class that defines a common interface to all neighborhood operator subtypes.
A NeighborhoodOperator for performing a directional Sobel edge-detection operation at a pixel locatio...
void CreateDirectional() override
Self & operator=(const Self &other)
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Indent GetNextIndent()