go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkMissingStructurePenalty.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 __itkMissingStructurePenalty_h
19 #define __itkMissingStructurePenalty_h
20 
22 #include "itkPoint.h"
23 #include "itkPointSet.h"
24 #include "itkImage.h"
25 #include "itkMesh.h"
26 #include "itkVectorContainer.h"
27 #include "vnl_adjugate_fixed.h"
28 
29 namespace itk
30 {
31 
43 template< class TFixedPointSet, class TMovingPointSet >
45  public SingleValuedPointSetToPointSetMetric< TFixedPointSet, TMovingPointSet >
46 {
47 public:
48 
52  TFixedPointSet, TMovingPointSet > Superclass;
54  typedef SmartPointer< const Self > ConstPointer;
55 
59  itkNewMacro( Self );
60 
62  itkTypeMacro( MissingVolumeMeshPenalty,
64 
70 
74 
77  typedef typename OutputPointType::CoordRepType CoordRepType;
79 
81 
83  itkStaticConstMacro( FixedPointSetDimension, unsigned int,
84  Superclass::FixedPointSetDimension );
85  itkStaticConstMacro( MovingPointSetDimension, unsigned int,
86  Superclass::MovingPointSetDimension );
87 
89  typedef unsigned char DummyMeshPixelType;
90  typedef DefaultStaticMeshTraits< DummyMeshPixelType,
91  FixedPointSetDimension, FixedPointSetDimension, CoordRepType > MeshTraitsType;
92  typedef Mesh< DummyMeshPixelType, FixedPointSetDimension,
93  MeshTraitsType > FixedMeshType;
94  typedef typename FixedMeshType::PointIdentifier FixedMeshPointIdentifier;
95 
96  typedef typename FixedMeshType::ConstPointer FixedMeshConstPointer;
97  typedef typename FixedMeshType::Pointer FixedMeshPointer;
98  typedef typename MeshTraitsType::CellType::CellInterface CellInterfaceType;
99 
100  typedef typename FixedMeshType::PointType MeshPointType;
101  typedef typename FixedMeshType::PointType::VectorType VectorType;
102  typedef typename VectorType::const_pointer VectorConstPointer;
103  typedef itk::Vector<
104  typename VectorType::ValueType, FixedPointSetDimension - 1 > SubVectorType;
105 
106  typedef typename FixedMeshType::PointsContainer MeshPointsContainerType;
107  typedef typename MeshPointsContainerType::Pointer MeshPointsContainerPointer;
108  typedef typename MeshPointsContainerType::ConstPointer MeshPointsContainerConstPointer;
109  typedef typename FixedMeshType::PointsContainerConstIterator MeshPointsContainerConstIteratorType;
110  typedef typename FixedMeshType::PointsContainerIterator MeshPointsContainerIteratorType;
111 
112  typedef typename FixedMeshType::PointDataContainer MeshPointDataContainerType;
113  typedef typename FixedMeshType::PointDataContainerConstPointer MeshPointDataContainerConstPointer;
114  typedef typename FixedMeshType::PointDataContainerPointer MeshPointDataContainerPointer;
115  //typedef typename FixedMeshType::PointDataContainerConstIterator MeshPointDataContainerConstIteratorType;
116  typedef typename FixedMeshType::PointDataContainerIterator MeshPointDataContainerConstIteratorType;
117  typedef typename MeshPointDataContainerType::Iterator MeshPointDataContainerIteratorType;
118 
119  typedef unsigned int MeshIdType;
120  typedef VectorContainer< MeshIdType, FixedMeshConstPointer > FixedMeshContainerType;
121  typedef typename FixedMeshContainerType::Pointer FixedMeshContainerPointer;
122  typedef typename FixedMeshContainerType::ConstPointer FixedMeshContainerConstPointer;
123  typedef typename FixedMeshContainerType::ElementIdentifier FixedMeshContainerElementIdentifier;
124 
125  typedef VectorContainer< MeshIdType, FixedMeshPointer > MappedMeshContainerType;
126  typedef typename MappedMeshContainerType::Pointer MappedMeshContainerPointer;
127  typedef typename MappedMeshContainerType::ConstPointer MappedMeshContainerConstPointer;
128 
129  typedef Array< DerivativeValueType > MeshPointsDerivativeValueType;
130 
131  itkSetConstObjectMacro( FixedMeshContainer, FixedMeshContainerType );
132  itkGetConstObjectMacro( FixedMeshContainer, FixedMeshContainerType );
133 
134  itkSetObjectMacro( MappedMeshContainer, MappedMeshContainerType );
135  itkGetObjectMacro( MappedMeshContainer, MappedMeshContainerType );
136 
140  virtual void Initialize( void ) throw ( ExceptionObject );
141 
143  // \todo: currently not used
144  //itkSetConstObjectMacro( FixedImageMask, FixedImageMaskType );
145 
147  //itkGetConstObjectMacro( FixedImageMask, FixedImageMaskType );
148 
150  MeasureType GetValue( const TransformParametersType & parameters ) const;
151 
153  void GetDerivative( const TransformParametersType & parameters,
154  DerivativeType & Derivative ) const;
155 
157  void GetValueAndDerivative( const TransformParametersType & parameters,
158  MeasureType & Value, DerivativeType & Derivative ) const;
159 
160 protected:
161 
163  virtual ~MissingVolumeMeshPenalty();
164 
166  //void PrintSelf(std::ostream& os, Indent indent) const;
167 
169  FixedMeshConstPointer m_FixedMesh;
170 
171  mutable FixedMeshContainerConstPointer m_FixedMeshContainer;
172  mutable MappedMeshContainerPointer m_MappedMeshContainer;
173 
174 private:
175 
176  void SubVector( const VectorType & fullVector, SubVectorType & subVector, const unsigned int leaveOutIndex ) const;
177 
178  MissingVolumeMeshPenalty( const Self & ); // purposely not implemented
179  void operator=( const Self & ); // purposely not implemented
180 
181 }; // end class MissingVolumeMeshPenalty
182 
183 } // end namespace itk
184 
185 #ifndef ITK_MANUAL_INSTANTIATION
186 #include "itkMissingStructurePenalty.hxx"
187 #endif
188 
189 #endif
190 
itk::Vector< typename VectorType::ValueType, FixedPointSetDimension-1 > SubVectorType
Superclass::TransformPointer TransformPointer
Superclass::TransformJacobianType TransformJacobianType
FixedMeshType::PointIdentifier FixedMeshPointIdentifier
FixedMeshType::PointDataContainerPointer MeshPointDataContainerPointer
FixedMeshContainerConstPointer m_FixedMeshContainer
Superclass::NonZeroJacobianIndicesType NonZeroJacobianIndicesType
SmartPointer< const Self > ConstPointer
VectorContainer< MeshIdType, FixedMeshPointer > MappedMeshContainerType
Mesh< DummyMeshPixelType, FixedPointSetDimension, MeshTraitsType > FixedMeshType
FixedMeshType::PointsContainer MeshPointsContainerType
FixedMeshType::PointDataContainerIterator MeshPointDataContainerConstIteratorType
Superclass::DerivativeType DerivativeType
MeshPointsContainerType::ConstPointer MeshPointsContainerConstPointer
OutputPointType::CoordRepType CoordRepType
VectorContainer< MeshIdType, FixedMeshConstPointer > FixedMeshContainerType
MappedMeshContainerType::ConstPointer MappedMeshContainerConstPointer
MeshTraitsType::CellType::CellInterface CellInterfaceType
FixedMeshType::PointsContainerIterator MeshPointsContainerIteratorType
MappedMeshContainerType::Pointer MappedMeshContainerPointer
FixedMeshContainerType::Pointer FixedMeshContainerPointer
FixedMeshType::PointDataContainer MeshPointDataContainerType
MeshPointDataContainerType::Iterator MeshPointDataContainerIteratorType
Superclass::TransformParametersType TransformParametersType
MeasureType GetValue(const TransformParametersType &parameters) const
itkStaticConstMacro(FixedPointSetDimension, unsigned int, Superclass::FixedPointSetDimension)
TransformType::NonZeroJacobianIndicesType NonZeroJacobianIndicesType
DefaultStaticMeshTraits< DummyMeshPixelType, FixedPointSetDimension, FixedPointSetDimension, CoordRepType > MeshTraitsType
Superclass::DerivativeValueType DerivativeValueType
SingleValuedPointSetToPointSetMetric< TFixedPointSet, TMovingPointSet > Superclass
Superclass::TransformType TransformType
FixedMeshType::ConstPointer FixedMeshConstPointer
vnl_vector< CoordRepType > VnlVectorType
Array< DerivativeValueType > MeshPointsDerivativeValueType
virtual void Initialize(void)
VectorType::const_pointer VectorConstPointer
Superclass::InputPointType InputPointType
MappedMeshContainerPointer m_MappedMeshContainer
FixedMeshType::PointsContainerConstIterator MeshPointsContainerConstIteratorType
Superclass::OutputPointType OutputPointType
FixedMeshType::PointDataContainerConstPointer MeshPointDataContainerConstPointer
FixedMeshContainerType::ElementIdentifier FixedMeshContainerElementIdentifier
void GetDerivative(const TransformParametersType &parameters, DerivativeType &Derivative) const
FixedMeshType::PointType::VectorType VectorType
void GetValueAndDerivative(const TransformParametersType &parameters, MeasureType &Value, DerivativeType &Derivative) const
FixedMeshContainerType::ConstPointer FixedMeshContainerConstPointer
void SubVector(const VectorType &fullVector, SubVectorType &subVector, const unsigned int leaveOutIndex) const
AdvancedTransform< CoordinateRepresentationType, itkGetStaticConstMacro(FixedPointSetDimension), itkGetStaticConstMacro(MovingPointSetDimension) > TransformType
Computes the (pseudo) volume of the transformed surface mesh of a structure. .
MeshPointsContainerType::Pointer MeshPointsContainerPointer


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