go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkPolydataDummyPenalty.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 #ifndef __itkPolydataDummyPenalty_h
19 #define __itkPolydataDummyPenalty_h
20 
22 #include "itkPoint.h"
23 #include "itkPointSet.h"
24 #include "itkImage.h"
25 #include "itkMesh.h"
26 #include <itkVectorContainer.h>
27 
28 namespace itk
29 {
30 
39 template< class TFixedPointSet, class TMovingPointSet >
40 class ITK_EXPORT MeshPenalty :
41  public SingleValuedPointSetToPointSetMetric< TFixedPointSet, TMovingPointSet >
42 {
43 public:
44 
46  typedef MeshPenalty Self;
48  TFixedPointSet, TMovingPointSet > Superclass;
50  typedef SmartPointer< const Self > ConstPointer;
51 
55  itkNewMacro( Self );
56 
59 
61  typedef typename Superclass::TransformType TransformType;
62  typedef typename Superclass::TransformPointer TransformPointer;
63  typedef typename Superclass::TransformParametersType TransformParametersType;
64  typedef typename Superclass::TransformJacobianType TransformJacobianType;
65 
66  typedef typename Superclass::MeasureType MeasureType;
67  typedef typename Superclass::DerivativeType DerivativeType;
68  typedef typename Superclass::DerivativeValueType DerivativeValueType;
69 
71  typedef typename Superclass::InputPointType InputPointType;
72  typedef typename Superclass::OutputPointType OutputPointType;
73  typedef typename InputPointType::CoordRepType CoordRepType;
78 
79  typedef typename Superclass::NonZeroJacobianIndicesType NonZeroJacobianIndicesType;
80 
82  itkStaticConstMacro( FixedPointSetDimension, unsigned int,
83  Superclass::FixedPointSetDimension );
84 
85  typedef Vector< typename TransformType::ScalarType,
86  FixedPointSetDimension > PointNormalType;
87  typedef unsigned char DummyMeshPixelType;
88  typedef DefaultStaticMeshTraits< PointNormalType,
89  FixedPointSetDimension, FixedPointSetDimension, CoordRepType > MeshTraitsType;
90  typedef Mesh< PointNormalType, FixedPointSetDimension,
91  MeshTraitsType > FixedMeshType;
92 
93  typedef typename FixedMeshType::ConstPointer FixedMeshConstPointer;
94  typedef typename FixedMeshType::Pointer FixedMeshPointer;
95  typedef typename MeshTraitsType::CellType::CellInterface CellInterfaceType;
96 
97  typedef typename FixedMeshType::PointType MeshPointType;
98  typedef typename FixedMeshType::PointType::VectorType VectorType;
99 
100  typedef typename FixedMeshType::PointsContainer MeshPointsContainerType;
101  typedef typename MeshPointsContainerType::Pointer MeshPointsContainerPointer;
102  typedef typename MeshPointsContainerType::ConstPointer MeshPointsContainerConstPointer;
103  typedef typename FixedMeshType::PointsContainerConstIterator MeshPointsContainerConstIteratorType;
104  typedef typename FixedMeshType::PointsContainerIterator MeshPointsContainerIteratorType;
105 
106  typedef typename FixedMeshType::PointDataContainer MeshPointDataContainerType;
107  typedef typename FixedMeshType::PointDataContainerConstPointer MeshPointDataContainerConstPointer;
108  typedef typename FixedMeshType::PointDataContainerPointer MeshPointDataContainerPointer;
109  //typedef typename FixedMeshType::PointDataContainerConstIterator MeshPointDataContainerConstIteratorType;
110  typedef typename FixedMeshType::PointDataContainerIterator MeshPointDataContainerConstIteratorType;
111  typedef typename MeshPointDataContainerType::Iterator MeshPointDataContainerIteratorType;
112 
113  typedef unsigned int MeshIdType;
114  typedef VectorContainer< MeshIdType, FixedMeshConstPointer > FixedMeshContainerType;
115  typedef typename FixedMeshContainerType::Pointer FixedMeshContainerPointer;
116  typedef typename FixedMeshContainerType::ConstPointer FixedMeshContainerConstPointer;
117  typedef typename FixedMeshContainerType::ElementIdentifier FixedMeshContainerElementIdentifier;
118 
119  typedef VectorContainer< MeshIdType, FixedMeshPointer > MappedMeshContainerType;
120  typedef typename MappedMeshContainerType::Pointer MappedMeshContainerPointer;
121  typedef typename MappedMeshContainerType::ConstPointer MappedMeshContainerConstPointer;
122 
123  typedef Array< DerivativeValueType > MeshPointsDerivativeValueType;
124 
125  itkSetConstObjectMacro( FixedMeshContainer, FixedMeshContainerType );
126  itkGetConstObjectMacro( FixedMeshContainer, FixedMeshContainerType );
127 
128  itkSetObjectMacro( MappedMeshContainer, MappedMeshContainerType );
129  itkGetObjectMacro( MappedMeshContainer, MappedMeshContainerType );
130 
132  //itkGetObjectMacro( MappedPoints, MeshPointsContainerPointer );
133 
135  //itkSetConstObjectMacro( FixedMesh, FixedMeshType );
136 
138  //itkGetConstObjectMacro( FixedMesh, FixedMeshType );
139 
141  //itkSetObjectMacro( Transform, TransformType );
142 
144  //itkGetConstObjectMacro( Transform, TransformType );
145 
147  //void SetTransformParameters( const ParametersType & parameters ) const;
148 
150  //unsigned int GetNumberOfParameters( void ) const
151  //{ return this->m_Transform->GetNumberOfParameters(); }
152 
156  virtual void Initialize( void ) throw ( ExceptionObject );
157 
159  // \todo: currently not used
160  //itkSetConstObjectMacro( FixedImageMask, FixedImageMaskType );
161 
163  //itkGetConstObjectMacro( FixedImageMask, FixedImageMaskType );
164 
166  MeasureType GetValue( const TransformParametersType & parameters ) const;
167 
169  void GetDerivative( const TransformParametersType & parameters,
170  DerivativeType & Derivative ) const;
171 
173  void GetValueAndDerivative( const TransformParametersType & parameters,
174  MeasureType & Value, DerivativeType & Derivative ) const;
175 
176 protected:
177 
178  MeshPenalty();
179  virtual ~MeshPenalty();
180 
182  void PrintSelf( std::ostream & os, Indent indent ) const;
183 
185  mutable FixedMeshContainerConstPointer m_FixedMeshContainer;
186  mutable MappedMeshContainerPointer m_MappedMeshContainer;
187 
188 private:
189 
190  MeshPenalty( const Self & ); // purposely not implemented
191  void operator=( const Self & ); // purposely not implemented
192 
193 }; // end class MeshPenalty
194 
195 } // end namespace itk
196 
197 #ifndef ITK_MANUAL_INSTANTIATION
198 #include "itkPolydataDummyPenalty.hxx"
199 #endif
200 
201 #endif
202 
vnl_vector< CoordRepType > VnlVectorType
FixedMeshContainerType::ConstPointer FixedMeshContainerConstPointer
Superclass::TransformType TransformType
VectorContainer< MeshIdType, FixedMeshPointer > MappedMeshContainerType
Matrix< ScalarType, OutputSpaceDimension, InputSpaceDimension > SpatialJacobianType
FixedMeshType::PointsContainerConstIterator MeshPointsContainerConstIteratorType
FixedMeshType::PointsContainerIterator MeshPointsContainerIteratorType
SmartPointer< Self > Pointer
FixedMeshType::PointDataContainerIterator MeshPointDataContainerConstIteratorType
DefaultStaticMeshTraits< PointNormalType, FixedPointSetDimension, FixedPointSetDimension, CoordRepType > MeshTraitsType
FixedMeshContainerType::ElementIdentifier FixedMeshContainerElementIdentifier
A dummy metric to generate transformed meshes each iteration.
FixedMeshType::PointDataContainerPointer MeshPointDataContainerPointer
Superclass::OutputPointType OutputPointType
Vector< typename TransformType::ScalarType, FixedPointSetDimension > PointNormalType
Superclass::ScalarType ScalarType
MappedMeshContainerType::Pointer MappedMeshContainerPointer
Superclass::NonZeroJacobianIndicesType NonZeroJacobianIndicesType
Superclass::TransformJacobianType TransformJacobianType
FixedMeshType::Pointer FixedMeshPointer
FixedMeshType::PointDataContainerConstPointer MeshPointDataContainerConstPointer
InputPointType::CoordRepType CoordRepType
MeshPointDataContainerType::Iterator MeshPointDataContainerIteratorType
SmartPointer< const Self > ConstPointer
VectorContainer< MeshIdType, FixedMeshConstPointer > FixedMeshContainerType
Superclass::MeasureType MeasureType
FixedMeshType::ConstPointer FixedMeshConstPointer
TransformType::InputPointType FixedImagePointType
Array< DerivativeValueType > MeshPointsDerivativeValueType
Superclass::TransformPointer TransformPointer
Mesh< PointNormalType, FixedPointSetDimension, MeshTraitsType > FixedMeshType
TransformType::SpatialJacobianType SpatialJacobianType
FixedMeshType::PointType MeshPointType
MeshPointsContainerType::ConstPointer MeshPointsContainerConstPointer
MeshTraitsType::CellType::CellInterface CellInterfaceType
MeshPointsContainerType::Pointer MeshPointsContainerPointer
unsigned char DummyMeshPixelType
FixedMeshType::PointDataContainer MeshPointDataContainerType
Superclass::InputPointType InputPointType
FixedMeshType::PointType::VectorType VectorType
MappedMeshContainerType::ConstPointer MappedMeshContainerConstPointer
TransformType::OutputPointType MovingImagePointType
FixedMeshContainerType::Pointer FixedMeshContainerPointer
Superclass::OutputPointType OutputPointType
Superclass::TransformParametersType TransformParametersType
Superclass::DerivativeType DerivativeType
FixedMeshType::PointsContainer MeshPointsContainerType
Superclass::DerivativeValueType DerivativeValueType
SingleValuedPointSetToPointSetMetric< TFixedPointSet, TMovingPointSet > Superclass
Superclass::InputPointType InputPointType


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