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
29namespace itk
30{
31
43template <class TFixedPointSet, class TMovingPointSet>
44class ITK_TEMPLATE_EXPORT MissingVolumeMeshPenalty
45 : public SingleValuedPointSetToPointSetMetric<TFixedPointSet, TMovingPointSet>
46{
47public:
49
53 using Pointer = SmartPointer<Self>;
54 using ConstPointer = SmartPointer<const Self>;
55
59 itkNewMacro(Self);
60
63
65 using typename Superclass::TransformType;
66 using typename Superclass::TransformPointer;
69
70 using typename Superclass::MeasureType;
71 using typename Superclass::DerivativeType;
73
74 using typename Superclass::InputPointType;
75 using typename Superclass::OutputPointType;
76 using CoordRepType = typename OutputPointType::CoordRepType;
77 using VnlVectorType = vnl_vector<CoordRepType>;
78
80
82 itkStaticConstMacro(FixedPointSetDimension, unsigned int, Superclass::FixedPointSetDimension);
83 itkStaticConstMacro(MovingPointSetDimension, unsigned int, Superclass::MovingPointSetDimension);
84
86 using DummyMeshPixelType = unsigned char;
88 DefaultStaticMeshTraits<DummyMeshPixelType, FixedPointSetDimension, FixedPointSetDimension, CoordRepType>;
89 using FixedMeshType = Mesh<DummyMeshPixelType, FixedPointSetDimension, MeshTraitsType>;
90 using FixedMeshPointIdentifier = typename FixedMeshType::PointIdentifier;
91
92 using FixedMeshConstPointer = typename FixedMeshType::ConstPointer;
93 using FixedMeshPointer = typename FixedMeshType::Pointer;
94 using CellInterfaceType = typename MeshTraitsType::CellType;
95
96 using MeshPointType = typename FixedMeshType::PointType;
97 using VectorType = typename FixedMeshType::PointType::VectorType;
98 using VectorConstPointer = typename VectorType::const_pointer;
99 using SubVectorType = itk::Vector<typename VectorType::ValueType, FixedPointSetDimension - 1>;
100
101 using MeshPointsContainerType = typename FixedMeshType::PointsContainer;
102 using MeshPointsContainerPointer = typename MeshPointsContainerType::Pointer;
103 using MeshPointsContainerConstPointer = typename MeshPointsContainerType::ConstPointer;
104 using MeshPointsContainerConstIteratorType = typename FixedMeshType::PointsContainerConstIterator;
105 using MeshPointsContainerIteratorType = typename FixedMeshType::PointsContainerIterator;
106
107 using MeshPointDataContainerType = typename FixedMeshType::PointDataContainer;
108 using MeshPointDataContainerConstPointer = typename FixedMeshType::PointDataContainerConstPointer;
109 using MeshPointDataContainerPointer = typename FixedMeshType::PointDataContainerPointer;
110 // typedef typename FixedMeshType::PointDataContainerConstIterator MeshPointDataContainerConstIteratorType;
111 using MeshPointDataContainerConstIteratorType = typename FixedMeshType::PointDataContainerIterator;
112 using MeshPointDataContainerIteratorType = typename MeshPointDataContainerType::Iterator;
113
114 using MeshIdType = unsigned int;
115 using FixedMeshContainerType = VectorContainer<MeshIdType, FixedMeshConstPointer>;
116 using FixedMeshContainerPointer = typename FixedMeshContainerType::Pointer;
117 using FixedMeshContainerConstPointer = typename FixedMeshContainerType::ConstPointer;
118 using FixedMeshContainerElementIdentifier = typename FixedMeshContainerType::ElementIdentifier;
119
120 using MappedMeshContainerType = VectorContainer<MeshIdType, FixedMeshPointer>;
121 using MappedMeshContainerPointer = typename MappedMeshContainerType::Pointer;
122 using MappedMeshContainerConstPointer = typename MappedMeshContainerType::ConstPointer;
123
124 using MeshPointsDerivativeValueType = Array<DerivativeValueType>;
125
126 itkSetConstObjectMacro(FixedMeshContainer, FixedMeshContainerType);
127 itkGetConstObjectMacro(FixedMeshContainer, FixedMeshContainerType);
128
129 itkSetObjectMacro(MappedMeshContainer, MappedMeshContainerType);
131
135 void
136 Initialize() override;
137
139 // \todo: currently not used
140 // itkSetConstObjectMacro( FixedImageMask, FixedImageMaskType );
141
143 // itkGetConstObjectMacro( FixedImageMask, FixedImageMaskType );
144
146 MeasureType
147 GetValue(const TransformParametersType & parameters) const override;
148
150 void
151 GetDerivative(const TransformParametersType & parameters, DerivativeType & Derivative) const override;
152
154 void
156 MeasureType & Value,
157 DerivativeType & Derivative) const override;
158
159protected:
161 ~MissingVolumeMeshPenalty() override = default;
162
164 // void PrintSelf(std::ostream& os, Indent indent) const;
165
168
169 mutable FixedMeshContainerConstPointer m_FixedMeshContainer{};
170 mutable MappedMeshContainerPointer m_MappedMeshContainer{};
171
172private:
173 void
174 SubVector(const VectorType & fullVector, SubVectorType & subVector, const unsigned int leaveOutIndex) const;
175};
176
177} // end namespace itk
178
179#ifndef ITK_MANUAL_INSTANTIATION
180# include "itkMissingStructurePenalty.hxx"
181#endif
182
183#endif
Transform maps points, vectors and covariant vectors from an input space to an output space.
Computes the (pseudo) volume of the transformed surface mesh of a structure. .
void GetValueAndDerivative(const TransformParametersType &parameters, MeasureType &Value, DerivativeType &Derivative) const override
ITK_DISALLOW_COPY_AND_MOVE(MissingVolumeMeshPenalty)
typename MeshPointsContainerType::Pointer MeshPointsContainerPointer
typename FixedMeshType::PointType MeshPointType
MeasureType GetValue(const TransformParametersType &parameters) const override
typename FixedMeshType::PointsContainer MeshPointsContainerType
VectorContainer< MeshIdType, FixedMeshConstPointer > FixedMeshContainerType
SmartPointer< const Self > ConstPointer
typename FixedMeshType::PointDataContainerPointer MeshPointDataContainerPointer
itkStaticConstMacro(MovingPointSetDimension, unsigned int, Superclass::MovingPointSetDimension)
~MissingVolumeMeshPenalty() override=default
Mesh< DummyMeshPixelType, FixedPointSetDimension, MeshTraitsType > FixedMeshType
typename MeshPointsContainerType::ConstPointer MeshPointsContainerConstPointer
typename OutputPointType::CoordRepType CoordRepType
typename FixedMeshType::PointDataContainer MeshPointDataContainerType
typename FixedMeshType::PointType::VectorType VectorType
Array< DerivativeValueType > MeshPointsDerivativeValueType
typename FixedMeshType::PointIdentifier FixedMeshPointIdentifier
typename FixedMeshType::PointDataContainerConstPointer MeshPointDataContainerConstPointer
itkGetModifiableObjectMacro(MappedMeshContainer, MappedMeshContainerType)
typename MeshTraitsType::CellType CellInterfaceType
void SubVector(const VectorType &fullVector, SubVectorType &subVector, const unsigned int leaveOutIndex) const
DefaultStaticMeshTraits< DummyMeshPixelType, FixedPointSetDimension, FixedPointSetDimension, CoordRepType > MeshTraitsType
typename VectorType::const_pointer VectorConstPointer
typename FixedMeshContainerType::ConstPointer FixedMeshContainerConstPointer
void GetDerivative(const TransformParametersType &parameters, DerivativeType &Derivative) const override
itk::Vector< typename VectorType::ValueType, FixedPointSetDimension - 1 > SubVectorType
typename FixedMeshType::PointsContainerConstIterator MeshPointsContainerConstIteratorType
itkStaticConstMacro(FixedPointSetDimension, unsigned int, Superclass::FixedPointSetDimension)
typename FixedMeshContainerType::Pointer FixedMeshContainerPointer
typename TransformType::ParametersType TransformParametersType
typename MeshPointDataContainerType::Iterator MeshPointDataContainerIteratorType
typename FixedMeshType::PointDataContainerIterator MeshPointDataContainerConstIteratorType
typename FixedMeshType::ConstPointer FixedMeshConstPointer
typename FixedMeshType::PointsContainerIterator MeshPointsContainerIteratorType
typename FixedMeshType::Pointer FixedMeshPointer
typename MappedMeshContainerType::Pointer MappedMeshContainerPointer
typename FixedMeshContainerType::ElementIdentifier FixedMeshContainerElementIdentifier
typename MappedMeshContainerType::ConstPointer MappedMeshContainerConstPointer
VectorContainer< MeshIdType, FixedMeshPointer > MappedMeshContainerType
typename TransformType::NonZeroJacobianIndicesType NonZeroJacobianIndicesType


Generated on 2024-07-17 for elastix by doxygen 1.11.0 (9b424b03c9833626cd435af22a444888fbbb192d) elastix logo