go home Home | Main Page | Modules | 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
26#include "itkMeshFileReader.h"
27#include "itkMeshFileWriter.h"
28
29namespace elastix
30{
50
51// TODO: define a base class templated on meshes in stead of 2 pointsets.
52// typedef unsigned char DummyPixelType;
53// typedef unsigned char BinaryPixelType;
54// typedef itk::Mesh<BinaryPixelType,FixedImageDimension> FixedMeshType;
55// typedef itk::Mesh <DummyPixelType, MetricBase<TElastix>::FixedImageDimension> FixedMeshType; //pixeltype is unused,
56// but necessary for the declaration, so a type with the smallest memory footprint is used.
57// template <class TElastix >
58// class PolydataDummyPenalty
59// : public
60// itk::MeshPenalty < itk::Mesh<DummyPixelType, MetricBase <TElastix>::FixedImageDimension > >,
61// public MetricBase<TElastix>
62//
63template <class TElastix>
64class ITK_TEMPLATE_EXPORT PolydataDummyPenalty
65 : public itk::MeshPenalty<typename MetricBase<TElastix>::FixedPointSetType,
66 typename MetricBase<TElastix>::MovingPointSetType>
67 , public MetricBase<TElastix>
68{
69public:
71
77 using Pointer = itk::SmartPointer<Self>;
78 using ConstPointer = itk::SmartPointer<const Self>;
79
81 itkNewMacro(Self);
82
85
90 elxClassNameMacro("PolydataDummyPenalty");
91
93 using typename Superclass1::FixedMeshType;
94 using typename Superclass1::FixedMeshPointer;
95 using typename Superclass1::FixedMeshConstPointer;
96
97 using typename Superclass1::CoordinateRepresentationType;
98 using typename Superclass1::FixedPointSetType;
99 using typename Superclass1::FixedPointSetConstPointer;
100 using typename Superclass1::FixedMeshContainerType;
101 using typename Superclass1::FixedMeshContainerPointer;
102 using typename Superclass1::MappedMeshContainerType;
103 using typename Superclass1::MappedMeshContainerPointer;
104 using typename Superclass1::MovingPointSetType;
105 using typename Superclass1::MovingPointSetConstPointer;
106 using typename Superclass1::CellInterfaceType;
107
108 // using typename Superclass1::FixedImageRegionType;
109 using typename Superclass1::TransformType;
110 using typename Superclass1::TransformPointer;
111 using typename Superclass1::InputPointType;
112 using typename Superclass1::OutputPointType;
113 using typename Superclass1::TransformParametersType;
114 using typename Superclass1::TransformJacobianType;
115 // using typename Superclass1::RealType;
116 using typename Superclass1::FixedImageMaskType;
117 using typename Superclass1::FixedImageMaskPointer;
118 using typename Superclass1::MovingImageMaskType;
119 using typename Superclass1::MovingImageMaskPointer;
120 using typename Superclass1::MeasureType;
121 using typename Superclass1::DerivativeType;
122 using typename Superclass1::ParametersType;
123
124 using CoordRepType = typename OutputPointType::CoordRepType;
125
126 using typename Superclass1::MeshIdType;
128 /*typedef itk::AdvancedTransform<
129 CoordRepType,
130 itkGetStaticConstMacro( FixedImageDimension ),
131 itkGetStaticConstMacro( MovingImageDimension ) > ITKBaseType;
132 */
135
137 using typename Superclass2::ElastixType;
138 using typename Superclass2::RegistrationType;
140 using typename Superclass2::FixedImageType;
141 using typename Superclass2::MovingImageType;
142
144 itkStaticConstMacro(FixedImageDimension, unsigned int, FixedImageType::ImageDimension);
145 itkStaticConstMacro(MovingImageDimension, unsigned int, MovingImageType::ImageDimension);
146
153
155 // typedef tmr::Timer TimerType;
156 // typedef TimerType::Pointer TimerPointer;
157
161 void
162 Initialize() override;
163
168 int
169 BeforeAllBase() override;
170
171 void
173
174 void
176
177 void
179
181 unsigned int
182 ReadMesh(const std::string & meshFileName, typename FixedMeshType::Pointer & mesh);
183
184 void
185 WriteResultMesh(const std::string & filename, MeshIdType meshId);
186
187 unsigned int
188 ReadTransformixPoints(const std::string & filename, typename MeshType::Pointer & mesh);
189
191 void
193 {}
194
195protected:
199 ~PolydataDummyPenalty() override = default;
200
201private:
203
204 unsigned int m_NumberOfMeshes;
205};
206
207} // end namespace elastix
208
209#ifndef ITK_MANUAL_INSTANTIATION
210# include "elxPolydataDummyPenalty.hxx"
211#endif
212
213#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
elxClassNameMacro("PolydataDummyPenalty")
typename ElastixType::FixedImageType FixedImageType
void BeforeRegistration() override
typename Superclass2::ITKBaseType ITKBaseType
~PolydataDummyPenalty() override=default
void WriteResultMesh(const std::string &filename, MeshIdType meshId)
ITK_DISALLOW_COPY_AND_MOVE(PolydataDummyPenalty)
typename OutputPointType::CoordRepType CoordRepType
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::AdvancedCombinationTransform< CoordRepType, Self::FixedImageDimension > CombinationTransformType
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 1768596610 for elastix by doxygen 1.15.0 elastix logo