go home Home | Main Page | Topics | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
Loading...
Searching...
No Matches
elxPolydataDummyPenalty.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 elxPolydataDummyPenalty_h
19#define elxPolydataDummyPenalty_h
20
21#include "elxIncludes.h"
23
24// #include "elxMetricBase.h"
25
26namespace elastix
27{
47
48// TODO: define a base class templated on meshes in stead of 2 pointsets.
49// typedef unsigned char DummyPixelType;
50// typedef unsigned char BinaryPixelType;
51// typedef itk::Mesh<BinaryPixelType,FixedImageDimension> FixedMeshType;
52// typedef itk::Mesh <DummyPixelType, MetricBase<TElastix>::FixedImageDimension> FixedMeshType; //pixeltype is unused,
53// but necessary for the declaration, so a type with the smallest memory footprint is used.
54// template <typename TElastix >
55// class PolydataDummyPenalty
56// : public
57// itk::MeshPenalty < itk::Mesh<DummyPixelType, MetricBase <TElastix>::FixedImageDimension > >,
58// public MetricBase<TElastix>
59//
60template <typename TElastix>
61class ITK_TEMPLATE_EXPORT PolydataDummyPenalty
62 : public itk::MeshPenalty<typename MetricBase<TElastix>::FixedPointSetType,
63 typename MetricBase<TElastix>::MovingPointSetType>
64 , public MetricBase<TElastix>
65{
66public:
68
74 using Pointer = itk::SmartPointer<Self>;
75 using ConstPointer = itk::SmartPointer<const Self>;
76
78 itkNewMacro(Self);
79
82
87 elxClassNameMacro("PolydataDummyPenalty");
88
90 using typename Superclass1::FixedMeshType;
91 using typename Superclass1::FixedMeshPointer;
92 using typename Superclass1::FixedMeshConstPointer;
93
94 using typename Superclass1::CoordinateRepresentationType;
95 using typename Superclass1::FixedPointSetType;
96 using typename Superclass1::FixedPointSetConstPointer;
97 using typename Superclass1::FixedMeshContainerType;
98 using typename Superclass1::FixedMeshContainerPointer;
99 using typename Superclass1::MappedMeshContainerType;
100 using typename Superclass1::MappedMeshContainerPointer;
101 using typename Superclass1::MovingPointSetType;
102 using typename Superclass1::MovingPointSetConstPointer;
103 using typename Superclass1::CellInterfaceType;
104
105 // using typename Superclass1::FixedImageRegionType;
106 using typename Superclass1::TransformType;
107 using typename Superclass1::TransformPointer;
108 using typename Superclass1::InputPointType;
109 using typename Superclass1::OutputPointType;
110 using typename Superclass1::TransformJacobianType;
111 // using typename Superclass1::RealType;
112 using typename Superclass1::FixedImageMaskType;
113 using typename Superclass1::FixedImageMaskPointer;
114 using typename Superclass1::MovingImageMaskType;
115 using typename Superclass1::MovingImageMaskPointer;
116 using typename Superclass1::MeasureType;
117 using typename Superclass1::DerivativeType;
118 using typename Superclass1::ParametersType;
119
120 using CoordinateType = typename OutputPointType::CoordinateType;
121
122 using typename Superclass1::MeshIdType;
124 /*typedef itk::AdvancedTransform<
125 CoordinateType,
126 itkGetStaticConstMacro( FixedImageDimension ),
127 itkGetStaticConstMacro( MovingImageDimension ) > ITKBaseType;
128 */
131
133 using typename Superclass2::ElastixType;
134 using typename Superclass2::RegistrationType;
136 using typename Superclass2::FixedImageType;
137 using typename Superclass2::MovingImageType;
138
140 itkStaticConstMacro(FixedImageDimension, unsigned int, FixedImageType::ImageDimension);
141 itkStaticConstMacro(MovingImageDimension, unsigned int, MovingImageType::ImageDimension);
142
149
151 // typedef tmr::Timer TimerType;
152 // typedef TimerType::Pointer TimerPointer;
153
157 void
158 Initialize() override;
159
164 int
165 BeforeAllBase() override;
166
167 void
169
170 void
172
173 void
175
177 unsigned int
178 ReadMesh(const std::string & meshFileName, typename FixedMeshType::Pointer & mesh);
179
180 void
181 WriteResultMesh(const std::string & filename, MeshIdType meshId);
182
183 unsigned int
184 ReadTransformixPoints(const std::string & filename, typename MeshType::Pointer & mesh);
185
187 void
189 {}
190
191protected:
195 ~PolydataDummyPenalty() override = default;
196
197private:
199
200 unsigned int m_NumberOfMeshes;
201};
202
203} // end namespace elastix
204
205#ifndef ITK_MANUAL_INSTANTIATION
206# include "elxPolydataDummyPenalty.hxx"
207#endif
208
209#endif // end #ifndef elxPolydataDummyPenalty_h
itk::PointSet< CoordinateRepresentationType, MovingImageDimension, itk::DefaultStaticMeshTraits< CoordinateRepresentationType, MovingImageDimension, MovingImageDimension, CoordinateRepresentationType, CoordinateRepresentationType, CoordinateRepresentationType > > MovingPointSetType
itk::PointSet< CoordinateRepresentationType, FixedImageDimension, itk::DefaultStaticMeshTraits< CoordinateRepresentationType, FixedImageDimension, FixedImageDimension, CoordinateRepresentationType, CoordinateRepresentationType, CoordinateRepresentationType > > FixedPointSetType
itk::SingleValuedCostFunction ITKBaseType
typename ElastixType::FixedImageType FixedImageType
typename ElastixType::MovingImageType MovingImageType
typename ElastixType::RegistrationBaseType RegistrationType
itkStaticConstMacro(MovingImageDimension, unsigned int, MovingImageType::ImageDimension)
void AfterEachIteration() override
typename OutputPointType::CoordinateType CoordinateType
itk::AdvancedCombinationTransform< CoordinateType, Self::FixedImageDimension > CombinationTransformType
elxClassNameMacro("PolydataDummyPenalty")
typename ElastixType::FixedImageType FixedImageType
void BeforeRegistration() override
itkOverrideGetNameOfClassMacro(PolydataDummyPenalty)
typename Superclass2::ITKBaseType ITKBaseType
~PolydataDummyPenalty() override=default
void WriteResultMesh(const std::string &filename, MeshIdType meshId)
ITK_DISALLOW_COPY_AND_MOVE(PolydataDummyPenalty)
itk::MeshPenalty< typename MetricBase< TElastix >::FixedPointSetType, typename MetricBase< TElastix >::MovingPointSetType > Superclass1
unsigned int ReadMesh(const std::string &meshFileName, typename FixedMeshType::Pointer &mesh)
itk::SmartPointer< Self > Pointer
void AfterEachResolution() override
itk::SmartPointer< const Self > ConstPointer
unsigned int ReadTransformixPoints(const std::string &filename, typename MeshType::Pointer &mesh)
typename CombinationTransformType::InitialTransformType InitialTransformType
itkStaticConstMacro(FixedImageDimension, unsigned int, FixedImageType::ImageDimension)
This class combines two transforms: an 'initial transform' with a 'current transform'.
A dummy metric to generate transformed meshes each iteration.
Mesh< PointNormalType, FixedPointSetDimension, MeshTraitsType > FixedMeshType


Generated on 1774142652 for elastix by doxygen 1.15.0 elastix logo