ITK  6.0.0
Insight Toolkit
itkWarpHarmonicEnergyCalculator.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 itkWarpHarmonicEnergyCalculator_h
19#define itkWarpHarmonicEnergyCalculator_h
20
21#include "itkObject.h"
22#include "itkObjectFactory.h"
24#include "itkVector.h"
25
26namespace itk
27{
44template <typename TInputImage>
45class ITK_TEMPLATE_EXPORT WarpHarmonicEnergyCalculator : public Object
46{
47public:
48 ITK_DISALLOW_COPY_AND_MOVE(WarpHarmonicEnergyCalculator);
49
55
57 itkNewMacro(Self);
58
60 itkOverrideGetNameOfClassMacro(WarpHarmonicEnergyCalculator);
61
63 using ImageType = TInputImage;
64
67
70
72 using PixelType = typename TInputImage::PixelType;
73
76
79
81 static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
82
84 static constexpr unsigned int VectorDimension = PixelType::Dimension;
85
90
100 void
102 itkGetConstMacro(UseImageSpacing, bool);
103 itkBooleanMacro(UseImageSpacing);
107
111 itkSetMacro(DerivativeWeights, WeightsType);
112 itkGetConstReferenceMacro(DerivativeWeights, WeightsType);
116 itkSetConstObjectMacro(Image, ImageType);
117
119 void
121
123 itkGetConstMacro(HarmonicEnergy, double);
124
126 void
127 SetRegion(const RegionType & region);
128
129protected:
131 ~WarpHarmonicEnergyCalculator() override = default;
132 void
133 PrintSelf(std::ostream & os, Indent indent) const override;
134
136 itkGetConstReferenceMacro(NeighborhoodRadius, RadiusType);
137 itkSetMacro(NeighborhoodRadius, RadiusType);
140 double
142
143private:
144 double m_HarmonicEnergy{ 0.0 };
146
147 RegionType m_Region{};
148 bool m_RegionSetByUser{ false };
149
150 bool m_UseImageSpacing{ true };
151
152 WeightsType m_DerivativeWeights{};
153
154 RadiusType m_NeighborhoodRadius{};
155};
156} // end namespace itk
157
158#ifndef ITK_MANUAL_INSTANTIATION
159# include "itkWarpHarmonicEnergyCalculator.hxx"
160#endif
161
162#endif /* itkWarpHarmonicEnergyCalculator_h */
Const version of NeighborhoodIterator, defining iteration of a local N-dimensional neighborhood of pi...
Templated n-dimensional image class.
Definition: itkImage.h:89
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Light weight base class for most itk classes.
Base class for most ITK classes.
Definition: itkObject.h:62
Compute the harmonic energy of a deformation field.
~WarpHarmonicEnergyCalculator() override=default
void SetRegion(const RegionType &region)
void PrintSelf(std::ostream &os, Indent indent) const override
typename TInputImage::RegionType RegionType
typename ConstNeighborhoodIteratorType::RadiusType RadiusType
typename TInputImage::ConstPointer ImageConstPointer
double EvaluateAtNeighborhood(ConstNeighborhoodIteratorType &it) const
SmartPointer< const Self > ConstPointer
SmartPointer< Self > Pointer
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....