ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkWarpHarmonicEnergyCalculator.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 itkWarpHarmonicEnergyCalculator_h
19 #define itkWarpHarmonicEnergyCalculator_h
20 
21 #include "itkObject.h"
22 #include "itkObjectFactory.h"
24 #include "itkVector.h"
25 
26 namespace itk
27 {
44 template< typename TInputImage >
45 class ITK_TEMPLATE_EXPORT WarpHarmonicEnergyCalculator:public Object
46 {
47 public:
48  ITK_DISALLOW_COPY_AND_ASSIGN(WarpHarmonicEnergyCalculator);
49 
52  using Superclass = Object;
55 
57  itkNewMacro(Self);
58 
60  itkTypeMacro(WarpHarmonicEnergyCalculator, Object);
61 
63  using ImageType = TInputImage;
64 
66  using ImagePointer = typename TInputImage::Pointer;
67 
69  using ImageConstPointer = typename TInputImage::ConstPointer;
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 SetUseImageSpacing(bool);
101  itkGetConstMacro(UseImageSpacing, bool);
102  itkBooleanMacro(UseImageSpacing);
104 
106 
110  itkSetMacro(DerivativeWeights, WeightsType);
111  itkGetConstReferenceMacro(DerivativeWeights, WeightsType);
113 
115  itkSetConstObjectMacro(Image, ImageType);
116 
118  void Compute();
119 
121  itkGetConstMacro(HarmonicEnergy, double);
122 
124  void SetRegion(const RegionType & region);
125 
126 protected:
129  void PrintSelf(std::ostream & os, Indent indent) const override;
130 
132  itkGetConstReferenceMacro(NeighborhoodRadius, RadiusType);
133  itkSetMacro(NeighborhoodRadius, RadiusType);
135 
136  double EvaluateAtNeighborhood(ConstNeighborhoodIteratorType & it) const;
137 
138 private:
141 
144 
146 
148 
150 };
151 } // end namespace itk
152 
153 #ifndef ITK_MANUAL_INSTANTIATION
154 #include "itkWarpHarmonicEnergyCalculator.hxx"
155 #endif
156 
157 #endif /* itkWarpHarmonicEnergyCalculator_h */
Light weight base class for most itk classes.
Const version of NeighborhoodIterator, defining iteration of a local N-dimensional neighborhood of pi...
typename ConstNeighborhoodIteratorType::RadiusType RadiusType
typename TInputImage::RegionType RegionType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
typename Superclass::RadiusType RadiusType
Base class for most ITK classes.
Definition: itkObject.h:60
Compute the harmonic energy of a deformation field.
Templated n-dimensional image class.
Definition: itkImage.h:75
typename TInputImage::ConstPointer ImageConstPointer