ITK  4.2.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< class TInputImage >
45 class ITK_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 
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 
94  void SetUseImageSpacingOn()
95  {
96  this->SetUseImageSpacing(true);
97  }
98 
102  void SetUseImageSpacingOff()
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(void);
126 
128  itkGetConstMacro(HarmonicEnergy, double);
129 
131  void SetRegion(const RegionType & region);
132 
133 protected:
136  void PrintSelf(std::ostream & os, Indent indent) const;
137 
139  itkGetConstReferenceMacro(NeighborhoodRadius, RadiusType);
140  itkSetMacro(NeighborhoodRadius, RadiusType);
142 
143  double EvaluateAtNeighborhood(ConstNeighborhoodIteratorType & it) const;
144 
145 private:
146  WarpHarmonicEnergyCalculator(const Self &); //purposely not implemented
147  void operator=(const Self &); //purposely not implemented
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 */
169