go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkSingleValuedPointSetToPointSetMetric.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright UMC Utrecht and contributors
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 /*=========================================================================
19 
20  Program: Insight Segmentation & Registration Toolkit
21  Module: $RCSfile: itkSingleValuedPointSetToPointSetMetric.h,v $
22  Language: C++
23  Date: $Date: 2009-01-26 21:45:56 $
24  Version: $Revision: 1.2 $
25 
26  Copyright (c) Insight Software Consortium. All rights reserved.
27  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
28 
29  This software is distributed WITHOUT ANY WARRANTY; without even
30  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
31  PURPOSE. See the above copyright notices for more information.
32 
33 =========================================================================*/
34 #ifndef __itkSingleValuedPointSetToPointSetMetric_h
35 #define __itkSingleValuedPointSetToPointSetMetric_h
36 
37 #include "itkImageBase.h"
38 #include "itkAdvancedTransform.h"
39 #include "itkSingleValuedCostFunction.h"
40 #include "itkExceptionObject.h"
41 #include "itkSpatialObject.h"
42 #include "itkPointSet.h"
43 
44 namespace itk
45 {
46 
61 template< class TFixedPointSet, class TMovingPointSet >
63  public SingleValuedCostFunction
64 {
65 public:
66 
69  typedef SingleValuedCostFunction Superclass;
71  typedef SmartPointer< const Self > ConstPointer;
72 
74  typedef Superclass::ParametersValueType CoordinateRepresentationType;
75 
77  itkTypeMacro( SingleValuedPointSetToPointSetMetric, SingleValuedCostFunction );
78 
80  typedef TFixedPointSet FixedPointSetType;
81  typedef typename FixedPointSetType::PixelType FixedPointSetPixelType;
82  typedef typename FixedPointSetType::ConstPointer FixedPointSetConstPointer;
83  typedef TMovingPointSet MovingPointSetType;
84  typedef typename MovingPointSetType::PixelType MovingPointSetPixelType;
85  typedef typename MovingPointSetType::ConstPointer MovingPointSetConstPointer;
86  typedef typename FixedPointSetType::PointsContainer::ConstIterator PointIterator;
87  typedef typename FixedPointSetType::PointDataContainer::ConstIterator PointDataIterator;
88 
90  itkStaticConstMacro( FixedPointSetDimension, unsigned int,
91  TFixedPointSet::PointDimension );
92  itkStaticConstMacro( MovingPointSetDimension, unsigned int,
93  TMovingPointSet::PointDimension );
94 
97  itkGetStaticConstMacro( FixedPointSetDimension ),
98  itkGetStaticConstMacro( MovingPointSetDimension ) > TransformType;
104 
105  typedef SpatialObject<
106  itkGetStaticConstMacro( FixedPointSetDimension ) > FixedImageMaskType;
107  typedef typename FixedImageMaskType::Pointer FixedImageMaskPointer;
108  typedef typename FixedImageMaskType::ConstPointer FixedImageMaskConstPointer;
109  typedef SpatialObject<
110  itkGetStaticConstMacro( MovingPointSetDimension ) > MovingImageMaskType;
111  typedef typename MovingImageMaskType::Pointer MovingImageMaskPointer;
112  typedef typename MovingImageMaskType::ConstPointer MovingImageMaskConstPointer;
113 
115  typedef Superclass::MeasureType MeasureType;
116  typedef Superclass::DerivativeType DerivativeType;
117  typedef typename DerivativeType::ValueType DerivativeValueType;
118  typedef Superclass::ParametersType ParametersType;
119 
122 
124  itkSetConstObjectMacro( FixedPointSet, FixedPointSetType );
125 
127  itkGetConstObjectMacro( FixedPointSet, FixedPointSetType );
128 
130  itkSetConstObjectMacro( MovingPointSet, MovingPointSetType );
131 
133  itkGetConstObjectMacro( MovingPointSet, MovingPointSetType );
134 
136  itkSetObjectMacro( Transform, TransformType );
137 
139  itkGetConstObjectMacro( Transform, TransformType );
140 
142  void SetTransformParameters( const ParametersType & parameters ) const;
143 
145  unsigned int GetNumberOfParameters( void ) const
146  { return this->m_Transform->GetNumberOfParameters(); }
147 
151  virtual void Initialize( void ) throw ( ExceptionObject );
152 
154  // \todo: currently not used
155  itkSetConstObjectMacro( FixedImageMask, FixedImageMaskType );
156 
158  itkGetConstObjectMacro( FixedImageMask, FixedImageMaskType );
159 
161  itkSetConstObjectMacro( MovingImageMask, MovingImageMaskType );
162 
164  itkGetConstObjectMacro( MovingImageMask, MovingImageMaskType );
165 
167  virtual void BeforeThreadedGetValueAndDerivative( const TransformParametersType & parameters ) const;
168 
170  itkSetMacro( UseMetricSingleThreaded, bool );
171  itkGetConstReferenceMacro( UseMetricSingleThreaded, bool );
172  itkBooleanMacro( UseMetricSingleThreaded );
173 
174 protected:
175 
178 
180  void PrintSelf( std::ostream & os, Indent indent ) const;
181 
188 
189  mutable unsigned int m_NumberOfPointsCounted;
190 
193 
194 private:
195 
196  SingleValuedPointSetToPointSetMetric( const Self & ); // purposely not implemented
197  void operator=( const Self & ); // purposely not implemented
198 
199 };
200 
201 } // end namespace itk
202 
203 #ifndef ITK_MANUAL_INSTANTIATION
204 #include "itkSingleValuedPointSetToPointSetMetric.hxx"
205 #endif
206 
207 #endif
itk::AdvancedTransform::OutputPointType
Superclass::OutputPointType OutputPointType
Definition: itkAdvancedTransform.h:125
itk::SingleValuedPointSetToPointSetMetric::MovingImageMaskType
SpatialObject< itkGetStaticConstMacro(MovingPointSetDimension) > MovingImageMaskType
Definition: itkSingleValuedPointSetToPointSetMetric.h:110
itkAdvancedTransform.h
itk::SingleValuedPointSetToPointSetMetric::TransformParametersType
TransformType::ParametersType TransformParametersType
Definition: itkSingleValuedPointSetToPointSetMetric.h:102
itk::AdvancedTransform::InputPointType
Superclass::InputPointType InputPointType
Definition: itkAdvancedTransform.h:124
SmartPointer< Self >
itk::SingleValuedPointSetToPointSetMetric::FixedImageMaskConstPointer
FixedImageMaskType::ConstPointer FixedImageMaskConstPointer
Definition: itkSingleValuedPointSetToPointSetMetric.h:108
itk::SingleValuedPointSetToPointSetMetric::SingleValuedPointSetToPointSetMetric
SingleValuedPointSetToPointSetMetric()
itk::SingleValuedPointSetToPointSetMetric::TransformPointer
TransformType::Pointer TransformPointer
Definition: itkSingleValuedPointSetToPointSetMetric.h:99
itk::SingleValuedPointSetToPointSetMetric
Computes similarity between two point sets.
Definition: itkSingleValuedPointSetToPointSetMetric.h:64
itk::SingleValuedPointSetToPointSetMetric::MovingPointSetPixelType
MovingPointSetType::PixelType MovingPointSetPixelType
Definition: itkSingleValuedPointSetToPointSetMetric.h:84
itk::SingleValuedPointSetToPointSetMetric::MovingImageMaskConstPointer
MovingImageMaskType::ConstPointer MovingImageMaskConstPointer
Definition: itkSingleValuedPointSetToPointSetMetric.h:112
itk::SingleValuedPointSetToPointSetMetric::GetNumberOfParameters
unsigned int GetNumberOfParameters(void) const
Definition: itkSingleValuedPointSetToPointSetMetric.h:145
itk::SingleValuedPointSetToPointSetMetric::OutputPointType
TransformType::OutputPointType OutputPointType
Definition: itkSingleValuedPointSetToPointSetMetric.h:101
itk::SingleValuedPointSetToPointSetMetric::PrintSelf
void PrintSelf(std::ostream &os, Indent indent) const
itk::SingleValuedPointSetToPointSetMetric::PointDataIterator
FixedPointSetType::PointDataContainer::ConstIterator PointDataIterator
Definition: itkSingleValuedPointSetToPointSetMetric.h:87
itk::SingleValuedPointSetToPointSetMetric::m_UseMetricSingleThreaded
bool m_UseMetricSingleThreaded
Definition: itkSingleValuedPointSetToPointSetMetric.h:192
itk::SingleValuedPointSetToPointSetMetric::Pointer
SmartPointer< Self > Pointer
Definition: itkSingleValuedPointSetToPointSetMetric.h:70
itk::SingleValuedPointSetToPointSetMetric::m_MovingPointSet
MovingPointSetConstPointer m_MovingPointSet
Definition: itkSingleValuedPointSetToPointSetMetric.h:184
itk::SingleValuedPointSetToPointSetMetric::FixedImageMaskType
SpatialObject< itkGetStaticConstMacro(FixedPointSetDimension) > FixedImageMaskType
Definition: itkSingleValuedPointSetToPointSetMetric.h:106
itk::SingleValuedPointSetToPointSetMetric::MovingImageMaskPointer
MovingImageMaskType::Pointer MovingImageMaskPointer
Definition: itkSingleValuedPointSetToPointSetMetric.h:111
itk::SingleValuedPointSetToPointSetMetric::itkStaticConstMacro
itkStaticConstMacro(FixedPointSetDimension, unsigned int, TFixedPointSet::PointDimension)
itk::SingleValuedPointSetToPointSetMetric::PointIterator
FixedPointSetType::PointsContainer::ConstIterator PointIterator
Definition: itkSingleValuedPointSetToPointSetMetric.h:86
itk::SingleValuedPointSetToPointSetMetric::MeasureType
Superclass::MeasureType MeasureType
Definition: itkSingleValuedPointSetToPointSetMetric.h:115
itk::AdvancedTransform::JacobianType
Superclass::JacobianType JacobianType
Definition: itkAdvancedTransform.h:115
itk::SingleValuedPointSetToPointSetMetric::DerivativeValueType
DerivativeType::ValueType DerivativeValueType
Definition: itkSingleValuedPointSetToPointSetMetric.h:117
itk::SingleValuedPointSetToPointSetMetric::MovingPointSetType
TMovingPointSet MovingPointSetType
Definition: itkSingleValuedPointSetToPointSetMetric.h:83
itk::AdvancedTransform
Transform maps points, vectors and covariant vectors from an input space to an output space.
Definition: itkAdvancedTransform.h:87
itk::SingleValuedPointSetToPointSetMetric::FixedPointSetConstPointer
FixedPointSetType::ConstPointer FixedPointSetConstPointer
Definition: itkSingleValuedPointSetToPointSetMetric.h:82
itk::SingleValuedPointSetToPointSetMetric::ParametersType
Superclass::ParametersType ParametersType
Definition: itkSingleValuedPointSetToPointSetMetric.h:118
itk::SingleValuedPointSetToPointSetMetric::MovingPointSetConstPointer
MovingPointSetType::ConstPointer MovingPointSetConstPointer
Definition: itkSingleValuedPointSetToPointSetMetric.h:85
itk::SingleValuedPointSetToPointSetMetric::InputPointType
TransformType::InputPointType InputPointType
Definition: itkSingleValuedPointSetToPointSetMetric.h:100
itk::SingleValuedPointSetToPointSetMetric::NonZeroJacobianIndicesType
TransformType::NonZeroJacobianIndicesType NonZeroJacobianIndicesType
Definition: itkSingleValuedPointSetToPointSetMetric.h:121
itk::SingleValuedPointSetToPointSetMetric::operator=
void operator=(const Self &)
itk::SingleValuedPointSetToPointSetMetric::m_FixedPointSet
FixedPointSetConstPointer m_FixedPointSet
Definition: itkSingleValuedPointSetToPointSetMetric.h:183
itk::SingleValuedPointSetToPointSetMetric::m_FixedImageMask
FixedImageMaskConstPointer m_FixedImageMask
Definition: itkSingleValuedPointSetToPointSetMetric.h:185
itk::SingleValuedPointSetToPointSetMetric::~SingleValuedPointSetToPointSetMetric
virtual ~SingleValuedPointSetToPointSetMetric()
Definition: itkSingleValuedPointSetToPointSetMetric.h:177
itk::SingleValuedPointSetToPointSetMetric::BeforeThreadedGetValueAndDerivative
virtual void BeforeThreadedGetValueAndDerivative(const TransformParametersType &parameters) const
itk::SingleValuedPointSetToPointSetMetric::m_MovingImageMask
MovingImageMaskConstPointer m_MovingImageMask
Definition: itkSingleValuedPointSetToPointSetMetric.h:186
itk::SingleValuedPointSetToPointSetMetric::SetTransformParameters
void SetTransformParameters(const ParametersType &parameters) const
itk::AdvancedTransform::NonZeroJacobianIndicesType
std::vector< unsigned long > NonZeroJacobianIndicesType
Definition: itkAdvancedTransform.h:141
itk::SingleValuedPointSetToPointSetMetric::DerivativeType
Superclass::DerivativeType DerivativeType
Definition: itkSingleValuedPointSetToPointSetMetric.h:116
itk::SingleValuedPointSetToPointSetMetric::Self
SingleValuedPointSetToPointSetMetric Self
Definition: itkSingleValuedPointSetToPointSetMetric.h:68
itk
Definition: itkAdvancedImageToImageMetric.h:40
itk::SingleValuedPointSetToPointSetMetric::FixedPointSetPixelType
FixedPointSetType::PixelType FixedPointSetPixelType
Definition: itkSingleValuedPointSetToPointSetMetric.h:81
itk::SingleValuedPointSetToPointSetMetric::FixedImageMaskPointer
FixedImageMaskType::Pointer FixedImageMaskPointer
Definition: itkSingleValuedPointSetToPointSetMetric.h:107
itk::SingleValuedPointSetToPointSetMetric::m_Transform
TransformPointer m_Transform
Definition: itkSingleValuedPointSetToPointSetMetric.h:187
itk::SingleValuedPointSetToPointSetMetric::ConstPointer
SmartPointer< const Self > ConstPointer
Definition: itkSingleValuedPointSetToPointSetMetric.h:71
itk::SingleValuedPointSetToPointSetMetric::CoordinateRepresentationType
Superclass::ParametersValueType CoordinateRepresentationType
Definition: itkSingleValuedPointSetToPointSetMetric.h:74
itk::SingleValuedPointSetToPointSetMetric::m_NumberOfPointsCounted
unsigned int m_NumberOfPointsCounted
Definition: itkSingleValuedPointSetToPointSetMetric.h:189
itk::SingleValuedPointSetToPointSetMetric::FixedPointSetType
TFixedPointSet FixedPointSetType
Definition: itkSingleValuedPointSetToPointSetMetric.h:77
itk::AdvancedTransform::ParametersType
Superclass::ParametersType ParametersType
Definition: itkAdvancedTransform.h:110
itk::SingleValuedPointSetToPointSetMetric::TransformType
AdvancedTransform< CoordinateRepresentationType, itkGetStaticConstMacro(FixedPointSetDimension), itkGetStaticConstMacro(MovingPointSetDimension) > TransformType
Definition: itkSingleValuedPointSetToPointSetMetric.h:98
itk::SingleValuedPointSetToPointSetMetric::SingleValuedPointSetToPointSetMetric
SingleValuedPointSetToPointSetMetric(const Self &)
itk::SingleValuedPointSetToPointSetMetric::itkStaticConstMacro
itkStaticConstMacro(MovingPointSetDimension, unsigned int, TMovingPointSet::PointDimension)
itk::SingleValuedPointSetToPointSetMetric::Initialize
virtual void Initialize(void)
itk::SingleValuedPointSetToPointSetMetric::TransformJacobianType
TransformType::JacobianType TransformJacobianType
Definition: itkSingleValuedPointSetToPointSetMetric.h:103
itk::SingleValuedPointSetToPointSetMetric::Superclass
SingleValuedCostFunction Superclass
Definition: itkSingleValuedPointSetToPointSetMetric.h:69


Generated on OURCE_DATE_EPOCH for elastix by doxygen 1.8.18 elastix logo