go home Home | Main Page | Topics | 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 <typename TFixedPointSet, typename 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
57
59 itkNewMacro(Self);
60
63
65 using typename Superclass::TransformType;
66 using typename Superclass::TransformPointer;
67 using typename Superclass::ParametersType;
69
70 using typename Superclass::MeasureType;
71 using typename Superclass::DerivativeType;
73
74 using typename Superclass::InputPointType;
75 using typename Superclass::OutputPointType;
76 using CoordinateType = typename OutputPointType::CoordinateType;
77 using VnlVectorType = vnl_vector<CoordinateType>;
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, CoordinateType>;
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
113 using MeshIdType = unsigned int;
114 using FixedMeshContainerType = VectorContainer<MeshIdType, FixedMeshConstPointer>;
115 using FixedMeshContainerPointer = typename FixedMeshContainerType::Pointer;
116 using FixedMeshContainerConstPointer = typename FixedMeshContainerType::ConstPointer;
117 using FixedMeshContainerElementIdentifier = typename FixedMeshContainerType::ElementIdentifier;
118
119 using MappedMeshContainerType = VectorContainer<MeshIdType, FixedMeshPointer>;
120 using MappedMeshContainerPointer = typename MappedMeshContainerType::Pointer;
121 using MappedMeshContainerConstPointer = typename MappedMeshContainerType::ConstPointer;
122
123 using MeshPointsDerivativeValueType = Array<DerivativeValueType>;
124
125 itkSetConstObjectMacro(FixedMeshContainer, FixedMeshContainerType);
126 itkGetConstObjectMacro(FixedMeshContainer, FixedMeshContainerType);
127
128 itkSetObjectMacro(MappedMeshContainer, MappedMeshContainerType);
130
134 void
135 Initialize() override;
136
138 // \todo: currently not used
139 // itkSetConstObjectMacro( FixedImageMask, FixedImageMaskType );
140
142 // itkGetConstObjectMacro( FixedImageMask, FixedImageMaskType );
143
145 MeasureType
146 GetValue(const ParametersType & parameters) const override;
147
149 void
150 GetDerivative(const ParametersType & parameters, DerivativeType & Derivative) const override;
151
153 void
154 GetValueAndDerivative(const ParametersType & parameters,
155 MeasureType & Value,
156 DerivativeType & Derivative) const override;
157
158protected:
160 ~MissingVolumeMeshPenalty() override = default;
161
163 // void PrintSelf(std::ostream& os, Indent indent) const;
164
167
170
171private:
172 void
173 SubVector(const VectorType & fullVector, SubVectorType & subVector, const unsigned int leaveOutIndex) const;
174};
175
176} // end namespace itk
177
178#ifndef ITK_MANUAL_INSTANTIATION
179# include "itkMissingStructurePenalty.hxx"
180#endif
181
182#endif
ITK_DISALLOW_COPY_AND_MOVE(MissingVolumeMeshPenalty)
itkStaticConstMacro(MovingPointSetDimension, unsigned int, Superclass::MovingPointSetDimension)
~MissingVolumeMeshPenalty() override=default
itkGetModifiableObjectMacro(MappedMeshContainer, MappedMeshContainerType)
void SubVector(const VectorType &fullVector, SubVectorType &subVector, const unsigned int leaveOutIndex) const
itkOverrideGetNameOfClassMacro(MissingVolumeMeshPenalty)
SingleValuedPointSetToPointSetMetric< typename MetricBase< TElastix >::FixedPointSetType, typename MetricBase< TElastix >::MovingPointSetType > Superclass
MeasureType GetValue(const ParametersType &parameters) const override
void GetDerivative(const ParametersType &parameters, DerivativeType &Derivative) const override
itkStaticConstMacro(FixedPointSetDimension, unsigned int, Superclass::FixedPointSetDimension)
void GetValueAndDerivative(const ParametersType &parameters, MeasureType &Value, DerivativeType &Derivative) const override
DefaultStaticMeshTraits< DummyMeshPixelType, FixedPointSetDimension, FixedPointSetDimension, CoordinateType > MeshTraitsType
typename TransformType::NonZeroJacobianIndicesType NonZeroJacobianIndicesType
AdvancedTransform< CoordinateRepresentationType, Self::FixedPointSetDimension, Self::MovingPointSetDimension > TransformType


Generated on 26-02-2026 for elastix by doxygen 1.16.1 (669aeeefca743c148e2d935b3d3c69535c7491e6) elastix logo