ITK  4.13.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:
50  typedef Object Superclass;
53 
55  itkNewMacro(Self);
56 
59 
61  typedef TInputImage ImageType;
62 
64  typedef typename TInputImage::Pointer ImagePointer;
65 
67  typedef typename TInputImage::ConstPointer ImageConstPointer;
68 
70  typedef typename TInputImage::PixelType PixelType;
71 
74 
76  typedef typename TInputImage::RegionType RegionType;
77 
79  itkStaticConstMacro(ImageDimension, unsigned int,
80  TInputImage::ImageDimension);
81 
83  itkStaticConstMacro(VectorDimension, unsigned int,
85 
90 
100  void SetUseImageSpacing(bool);
101  itkGetConstMacro(UseImageSpacing, bool);
102  itkBooleanMacro(UseImageSpacing);
103 #if !defined(ITK_LEGACY_REMOVE)
104 
106  itkLegacyMacro(void SetUseImageSpacingOn())
107  {
108  this->SetUseImageSpacing(true);
109  }
110 
112  itkLegacyMacro(void SetUseImageSpacingOff())
113  {
114  this->SetUseImageSpacing(false);
115  }
116 #endif
117 
118  typedef FixedArray< double, ImageDimension > WeightsType;
119 
123  itkSetMacro(DerivativeWeights, WeightsType);
124  itkGetConstReferenceMacro(DerivativeWeights, WeightsType);
126 
128  itkSetConstObjectMacro(Image, ImageType);
129 
131  void Compute();
132 
134  itkGetConstMacro(HarmonicEnergy, double);
135 
137  void SetRegion(const RegionType & region);
138 
139 protected:
140  WarpHarmonicEnergyCalculator();
142  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
143 
145  itkGetConstReferenceMacro(NeighborhoodRadius, RadiusType);
146  itkSetMacro(NeighborhoodRadius, RadiusType);
148 
149  double EvaluateAtNeighborhood(ConstNeighborhoodIteratorType & it) const;
150 
151 private:
152  ITK_DISALLOW_COPY_AND_ASSIGN(WarpHarmonicEnergyCalculator);
153 
154  double m_HarmonicEnergy;
156 
159 
161 
163 
165 };
166 } // end namespace itk
167 
168 #ifndef ITK_MANUAL_INSTANTIATION
169 #include "itkWarpHarmonicEnergyCalculator.hxx"
170 #endif
171 
172 #endif /* itkWarpHarmonicEnergyCalculator_h */
Light weight base class for most itk classes.
ConstNeighborhoodIteratorType::RadiusType RadiusType
Const version of NeighborhoodIterator, defining iteration of a local N-dimensional neighborhood of pi...
ConstNeighborhoodIterator< ImageType > ConstNeighborhoodIteratorType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Base class for most ITK classes.
Definition: itkObject.h:59
Compute the harmonic energy of a deformation field.