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 
177  virtual ~SingleValuedPointSetToPointSetMetric() {}
178 
180  void PrintSelf( std::ostream & os, Indent indent ) const;
181 
183  FixedPointSetConstPointer m_FixedPointSet;
184  MovingPointSetConstPointer m_MovingPointSet;
185  FixedImageMaskConstPointer m_FixedImageMask;
186  MovingImageMaskConstPointer m_MovingImageMask;
187  mutable TransformPointer m_Transform;
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
void SetTransformParameters(const ParametersType &parameters) const
std::vector< unsigned long > NonZeroJacobianIndicesType
FixedPointSetType::PointsContainer::ConstIterator PointIterator
SpatialObject< itkGetStaticConstMacro(MovingPointSetDimension) > MovingImageMaskType
Superclass::ParametersType ParametersType
void PrintSelf(std::ostream &os, Indent indent) const
Transform maps points, vectors and covariant vectors from an input space to an output space...
SpatialObject< itkGetStaticConstMacro(FixedPointSetDimension) > FixedImageMaskType
TransformType::NonZeroJacobianIndicesType NonZeroJacobianIndicesType
Superclass::JacobianType JacobianType
FixedPointSetType::PointDataContainer::ConstIterator PointDataIterator
itkStaticConstMacro(FixedPointSetDimension, unsigned int, TFixedPointSet::PointDimension)
Superclass::InputPointType InputPointType
Superclass::OutputPointType OutputPointType
virtual void BeforeThreadedGetValueAndDerivative(const TransformParametersType &parameters) const
AdvancedTransform< CoordinateRepresentationType, itkGetStaticConstMacro(FixedPointSetDimension), itkGetStaticConstMacro(MovingPointSetDimension) > TransformType


Generated on 04-09-2015 for elastix by doxygen 1.8.9.1 elastix logo