ITK  4.9.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 >
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 
73  typedef typename TInputImage::IndexType IndexType;
74 
76  typedef typename TInputImage::RegionType RegionType;
77 
79  itkStaticConstMacro(ImageDimension, unsigned int,
80  TInputImage::ImageDimension);
81 
83  itkStaticConstMacro(VectorDimension, unsigned int,
84  PixelType::Dimension);
85 
90 
95  {
96  this->SetUseImageSpacing(true);
97  }
98 
103  {
104  this->SetUseImageSpacing(false);
105  }
106 
109  void SetUseImageSpacing(bool);
110 
111  itkGetConstMacro(UseImageSpacing, bool);
112 
114 
117  itkSetMacro(DerivativeWeights, WeightsType);
118  itkGetConstReferenceMacro(DerivativeWeights, WeightsType);
120 
122  itkSetConstObjectMacro(Image, ImageType);
123 
125  void Compute();
126 
128  itkGetConstMacro(HarmonicEnergy, double);
129 
131  void SetRegion(const RegionType & region);
132 
133 protected:
136  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
137 
139  itkGetConstReferenceMacro(NeighborhoodRadius, RadiusType);
140  itkSetMacro(NeighborhoodRadius, RadiusType);
142 
144 
145 private:
146  WarpHarmonicEnergyCalculator(const Self &) ITK_DELETE_FUNCTION;
147  void operator=(const Self &) ITK_DELETE_FUNCTION;
148 
151 
154 
156 
159 
161 };
162 } // end namespace itk
163 
164 #ifndef ITK_MANUAL_INSTANTIATION
165 #include "itkWarpHarmonicEnergyCalculator.hxx"
166 #endif
167 
168 #endif /* itkWarpHarmonicEnergyCalculator_h */
Light weight base class for most itk classes.
virtual void PrintSelf(std::ostream &os, Indent indent) const override
ConstNeighborhoodIteratorType::RadiusType RadiusType
Const version of NeighborhoodIterator, defining iteration of a local N-dimensional neighborhood of pi...
double EvaluateAtNeighborhood(ConstNeighborhoodIteratorType &it) const
void SetRegion(const RegionType &region)
ConstNeighborhoodIterator< ImageType > ConstNeighborhoodIteratorType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Base class for most ITK classes.
Definition: itkObject.h:57
FixedArray< double, ImageDimension > WeightsType
Compute the harmonic energy of a deformation field.
Templated n-dimensional image class.
Definition: itkImage.h:75