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
28namespace itk
29{
30
39template <class TFixedPointSet, class TMovingPointSet>
40class ITK_TEMPLATE_EXPORT MeshPenalty : public SingleValuedPointSetToPointSetMetric<TFixedPointSet, TMovingPointSet>
41{
42public:
44
48 using Pointer = SmartPointer<Self>;
49 using ConstPointer = SmartPointer<const Self>;
50
54 itkNewMacro(Self);
55
58
60 using typename Superclass::TransformType;
61 using typename Superclass::TransformPointer;
64
65 using typename Superclass::MeasureType;
66 using typename Superclass::DerivativeType;
68
70 using typename Superclass::InputPointType;
71 using typename Superclass::OutputPointType;
72 using CoordRepType = typename InputPointType::CoordRepType;
73 using VnlVectorType = vnl_vector<CoordRepType>;
74 using FixedImagePointType = typename TransformType::InputPointType;
75 using MovingImagePointType = typename TransformType::OutputPointType;
77
79
81 itkStaticConstMacro(FixedPointSetDimension, unsigned int, Superclass::FixedPointSetDimension);
82
83 using PointNormalType = Vector<typename TransformType::ScalarType, FixedPointSetDimension>;
84 using DummyMeshPixelType = unsigned char;
86 DefaultStaticMeshTraits<PointNormalType, FixedPointSetDimension, FixedPointSetDimension, CoordRepType>;
87 using FixedMeshType = Mesh<PointNormalType, FixedPointSetDimension, MeshTraitsType>;
88
89 using FixedMeshConstPointer = typename FixedMeshType::ConstPointer;
90 using FixedMeshPointer = typename FixedMeshType::Pointer;
91 using CellInterfaceType = typename MeshTraitsType::CellType;
92
93 using MeshPointType = typename FixedMeshType::PointType;
94 using VectorType = typename FixedMeshType::PointType::VectorType;
95
96 using MeshPointsContainerType = typename FixedMeshType::PointsContainer;
97 using MeshPointsContainerPointer = typename MeshPointsContainerType::Pointer;
98 using MeshPointsContainerConstPointer = typename MeshPointsContainerType::ConstPointer;
99 using MeshPointsContainerConstIteratorType = typename FixedMeshType::PointsContainerConstIterator;
100 using MeshPointsContainerIteratorType = typename FixedMeshType::PointsContainerIterator;
101
102 using MeshPointDataContainerType = typename FixedMeshType::PointDataContainer;
103 using MeshPointDataContainerConstPointer = typename FixedMeshType::PointDataContainerConstPointer;
104 using MeshPointDataContainerPointer = typename FixedMeshType::PointDataContainerPointer;
105 // typedef typename FixedMeshType::PointDataContainerConstIterator MeshPointDataContainerConstIteratorType;
106 using MeshPointDataContainerConstIteratorType = typename FixedMeshType::PointDataContainerIterator;
107 using MeshPointDataContainerIteratorType = typename MeshPointDataContainerType::Iterator;
108
109 using MeshIdType = unsigned int;
110 using FixedMeshContainerType = VectorContainer<MeshIdType, FixedMeshConstPointer>;
111 using FixedMeshContainerPointer = typename FixedMeshContainerType::Pointer;
112 using FixedMeshContainerConstPointer = typename FixedMeshContainerType::ConstPointer;
113 using FixedMeshContainerElementIdentifier = typename FixedMeshContainerType::ElementIdentifier;
114
115 using MappedMeshContainerType = VectorContainer<MeshIdType, FixedMeshPointer>;
116 using MappedMeshContainerPointer = typename MappedMeshContainerType::Pointer;
117 using MappedMeshContainerConstPointer = typename MappedMeshContainerType::ConstPointer;
118
119 using MeshPointsDerivativeValueType = Array<DerivativeValueType>;
120
121 itkSetConstObjectMacro(FixedMeshContainer, FixedMeshContainerType);
122 itkGetConstObjectMacro(FixedMeshContainer, FixedMeshContainerType);
123
124 itkSetObjectMacro(MappedMeshContainer, MappedMeshContainerType);
126
128 // itkGetObjectMacro( MappedPoints, MeshPointsContainerPointer );
129
131 // itkSetConstObjectMacro( FixedMesh, FixedMeshType );
132
134 // itkGetConstObjectMacro( FixedMesh, FixedMeshType );
135
137 // itkSetObjectMacro( Transform, TransformType );
138
140 // itkGetConstObjectMacro( Transform, TransformType );
141
143 // void SetTransformParameters( const ParametersType & parameters ) const;
144
146 // unsigned int GetNumberOfParameters() const
147 //{ return this->m_Transform->GetNumberOfParameters(); }
148
152 void
153 Initialize() override;
154
156 // \todo: currently not used
157 // itkSetConstObjectMacro( FixedImageMask, FixedImageMaskType );
158
160 // itkGetConstObjectMacro( FixedImageMask, FixedImageMaskType );
161
163 MeasureType
164 GetValue(const TransformParametersType & parameters) const override;
165
167 void
168 GetDerivative(const TransformParametersType & parameters, DerivativeType & Derivative) const override;
169
171 void
173 MeasureType & Value,
174 DerivativeType & Derivative) const override;
175
176protected:
178 ~MeshPenalty() override = default;
179
181 void
182 PrintSelf(std::ostream & os, Indent indent) const override;
183
185 mutable FixedMeshContainerConstPointer m_FixedMeshContainer{};
186 mutable MappedMeshContainerPointer m_MappedMeshContainer{};
187};
188
189} // end namespace itk
190
191#ifndef ITK_MANUAL_INSTANTIATION
192# include "itkPolydataDummyPenalty.hxx"
193#endif
194
195#endif
Transform maps points, vectors and covariant vectors from an input space to an output space.
Matrix< ScalarType, OutputSpaceDimension, InputSpaceDimension > SpatialJacobianType
A dummy metric to generate transformed meshes each iteration.
typename MappedMeshContainerType::ConstPointer MappedMeshContainerConstPointer
typename FixedMeshType::PointType MeshPointType
void PrintSelf(std::ostream &os, Indent indent) const override
itkGetModifiableObjectMacro(MappedMeshContainer, MappedMeshContainerType)
VectorContainer< MeshIdType, FixedMeshPointer > MappedMeshContainerType
typename MeshPointsContainerType::ConstPointer MeshPointsContainerConstPointer
~MeshPenalty() override=default
typename FixedMeshType::PointsContainerIterator MeshPointsContainerIteratorType
typename TransformType::InputPointType FixedImagePointType
VectorContainer< MeshIdType, FixedMeshConstPointer > FixedMeshContainerType
typename MeshPointDataContainerType::Iterator MeshPointDataContainerIteratorType
typename FixedMeshType::PointDataContainerConstPointer MeshPointDataContainerConstPointer
typename TransformType::OutputPointType MovingImagePointType
Array< DerivativeValueType > MeshPointsDerivativeValueType
typename TransformType::SpatialJacobianType SpatialJacobianType
ITK_DISALLOW_COPY_AND_MOVE(MeshPenalty)
unsigned char DummyMeshPixelType
typename MeshPointsContainerType::Pointer MeshPointsContainerPointer
void GetValueAndDerivative(const TransformParametersType &parameters, MeasureType &Value, DerivativeType &Derivative) const override
typename FixedMeshContainerType::ElementIdentifier FixedMeshContainerElementIdentifier
SmartPointer< const Self > ConstPointer
void Initialize() override
itkStaticConstMacro(FixedPointSetDimension, unsigned int, Superclass::FixedPointSetDimension)
Vector< typename TransformType::ScalarType, FixedPointSetDimension > PointNormalType
typename FixedMeshType::PointDataContainerPointer MeshPointDataContainerPointer
typename FixedMeshType::PointsContainerConstIterator MeshPointsContainerConstIteratorType
typename FixedMeshType::Pointer FixedMeshPointer
DefaultStaticMeshTraits< PointNormalType, FixedPointSetDimension, FixedPointSetDimension, CoordRepType > MeshTraitsType
typename FixedMeshType::PointType::VectorType VectorType
typename InputPointType::CoordRepType CoordRepType
typename TransformType::ParametersType TransformParametersType
typename FixedMeshType::PointDataContainerIterator MeshPointDataContainerConstIteratorType
typename FixedMeshType::PointDataContainer MeshPointDataContainerType
typename FixedMeshType::ConstPointer FixedMeshConstPointer
typename FixedMeshContainerType::ConstPointer FixedMeshContainerConstPointer
typename FixedMeshType::PointsContainer MeshPointsContainerType
Mesh< PointNormalType, FixedPointSetDimension, MeshTraitsType > FixedMeshType
typename MeshTraitsType::CellType CellInterfaceType
void GetDerivative(const TransformParametersType &parameters, DerivativeType &Derivative) const override
typename MappedMeshContainerType::Pointer MappedMeshContainerPointer
MeasureType GetValue(const TransformParametersType &parameters) const override
typename FixedMeshContainerType::Pointer FixedMeshContainerPointer
typename TransformType::NonZeroJacobianIndicesType NonZeroJacobianIndicesType


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