ITK  5.4.0
Insight Toolkit
itkLaplacianOperator.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 itkLaplacianOperator_h
19 #define itkLaplacianOperator_h
20 
22 
23 namespace itk
24 {
66 template <typename TPixel, unsigned int VDimension = 2, typename TAllocator = NeighborhoodAllocator<TPixel>>
67 class ITK_TEMPLATE_EXPORT LaplacianOperator : public NeighborhoodOperator<TPixel, VDimension, TAllocator>
68 {
69 public:
70 
74 
76  itkOverrideGetNameOfClassMacro(LaplacianOperator);
77 
78  using typename Superclass::SizeType;
79 
81  {
82  for (unsigned int i = 0; i < VDimension; ++i)
83  {
84  m_DerivativeScalings[i] = 1.0;
85  }
86  }
87 
89  void
90  CreateOperator();
91 
92  void
93  PrintSelf(std::ostream & os, Indent indent) const override
94  {
95  Superclass::PrintSelf(os, indent);
96 
97  os << indent << "DerivativeScalings: " << m_DerivativeScalings << std::endl;
98  }
99 
103  void
104  SetDerivativeScalings(const double * s);
105  itkGetConstMacro(DerivativeScalings, const double *);
108 protected:
110  using typename Superclass::CoefficientVector;
111 
113  CoefficientVector
114  GenerateCoefficients() override;
115 
118  void
119  Fill(const CoefficientVector &) override;
120 
121 private:
123  double m_DerivativeScalings[VDimension]{};
124 };
125 } // namespace itk
126 
127 #ifndef ITK_MANUAL_INSTANTIATION
128 # include "itkLaplacianOperator.hxx"
129 #endif
130 
131 #endif
itk::NeighborhoodOperator
Virtual class that defines a common interface to all neighborhood operator subtypes.
Definition: itkNeighborhoodOperator.h:72
itkNeighborhoodOperator.h
itk::GTest::TypedefsAndConstructors::Dimension2::SizeType
ImageBaseType::SizeType SizeType
Definition: itkGTestTypedefsAndConstructors.h:49
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::LaplacianOperator::PrintSelf
void PrintSelf(std::ostream &os, Indent indent) const override
Definition: itkLaplacianOperator.h:93
itk::LaplacianOperator::LaplacianOperator
LaplacianOperator()
Definition: itkLaplacianOperator.h:80
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::LaplacianOperator
A NeighborhoodOperator for use in calculating the Laplacian at a pixel.
Definition: itkLaplacianOperator.h:67