Loading...
Searching...
No Matches
elxPolydataDummyPenalty.h
Go to the documentation of this file.
/*=========================================================================
*
* Copyright UMC Utrecht and contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0.txt
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*=========================================================================*/
#ifndef elxPolydataDummyPenalty_h
#define elxPolydataDummyPenalty_h
#include "elxIncludes.h"
#include "itkPolydataDummyPenalty.h"
//#include "elxMetricBase.h"
#include "itkMeshFileReader.h"
#include "itkMeshFileWriter.h"
namespace elastix
{
// TODO: define a base class templated on meshes in stead of 2 pointsets.
// typedef unsigned char DummyPixelType;
// typedef unsigned char BinaryPixelType;
// typedef itk::Mesh<BinaryPixelType,FixedImageDimension> FixedMeshType;
// typedef itk::Mesh <DummyPixelType, MetricBase<TElastix>::FixedImageDimension> FixedMeshType; //pixeltype is unused,
// but necessary for the declaration, so a type with the smallest memory footprint is used.
// template <class TElastix >
// class PolydataDummyPenalty
// : public
// itk::MeshPenalty < itk::Mesh<DummyPixelType, MetricBase <TElastix>::FixedImageDimension > >,
// public MetricBase<TElastix>
//
template <class TElastix>
class ITK_TEMPLATE_EXPORT PolydataDummyPenalty
: public itk::MeshPenalty<typename MetricBase<TElastix>::FixedPointSetType,
typename MetricBase<TElastix>::MovingPointSetType>
, public MetricBase<TElastix>
{
public:
ITK_DISALLOW_COPY_AND_MOVE(PolydataDummyPenalty);
using Self = PolydataDummyPenalty;
using Superclass1 = itk::MeshPenalty<typename MetricBase<TElastix>::FixedPointSetType,
typename MetricBase<TElastix>::MovingPointSetType>;
using Superclass2 = MetricBase<TElastix>;
using Pointer = itk::SmartPointer<Self>;
using ConstPointer = itk::SmartPointer<const Self>;
itkNewMacro(Self);
itkTypeMacro(PolydataDummyPenalty, itk::MeshPenalty);
elxClassNameMacro("PolydataDummyPenalty");
using typename Superclass1::FixedMeshType;
using typename Superclass1::FixedMeshPointer;
using typename Superclass1::FixedMeshConstPointer;
using typename Superclass1::CoordinateRepresentationType;
using typename Superclass1::FixedPointSetType;
using typename Superclass1::FixedPointSetConstPointer;
using typename Superclass1::FixedMeshContainerType;
using typename Superclass1::FixedMeshContainerPointer;
using typename Superclass1::MappedMeshContainerType;
using typename Superclass1::MappedMeshContainerPointer;
using typename Superclass1::MovingPointSetType;
using typename Superclass1::MovingPointSetConstPointer;
using typename Superclass1::CellInterfaceType;
// using typename Superclass1::FixedImageRegionType;
using typename Superclass1::TransformType;
using typename Superclass1::TransformPointer;
using typename Superclass1::InputPointType;
using typename Superclass1::OutputPointType;
using typename Superclass1::TransformParametersType;
using typename Superclass1::TransformJacobianType;
// using typename Superclass1::RealType;
using typename Superclass1::FixedImageMaskType;
using typename Superclass1::FixedImageMaskPointer;
using typename Superclass1::MovingImageMaskType;
using typename Superclass1::MovingImageMaskPointer;
using typename Superclass1::MeasureType;
using typename Superclass1::DerivativeType;
using typename Superclass1::ParametersType;
using CoordRepType = typename OutputPointType::CoordRepType;
using typename Superclass1::MeshIdType;
/*typedef itk::AdvancedTransform<
CoordRepType,
itkGetStaticConstMacro( FixedImageDimension ),
itkGetStaticConstMacro( MovingImageDimension ) > ITKBaseType;
*/
using CombinationTransformType = itk::AdvancedCombinationTransform<CoordRepType, Self::FixedImageDimension>;
using InitialTransformType = typename CombinationTransformType::InitialTransformType;
using typename Superclass2::ElastixType;
using typename Superclass2::RegistrationType;
using ITKBaseType = typename Superclass2::ITKBaseType;
using typename Superclass2::FixedImageType;
using typename Superclass2::MovingImageType;
itkStaticConstMacro(FixedImageDimension, unsigned int, FixedImageType::ImageDimension);
itkStaticConstMacro(MovingImageDimension, unsigned int, MovingImageType::ImageDimension);
using PointSetType = FixedPointSetType;
using MeshType = FixedMeshType;
using ImageType = FixedImageType;
// typedef tmr::Timer TimerType;
// typedef TimerType::Pointer TimerPointer;
void
Initialize() override;
int
BeforeAllBase() override;
void
BeforeRegistration() override;
void
AfterEachIteration() override;
void
AfterEachResolution() override;
unsigned int
ReadMesh(const std::string & meshFileName, typename FixedMeshType::Pointer & mesh);
void
WriteResultMesh(const std::string & filename, MeshIdType meshId);
unsigned int
ReadTransformixPoints(const std::string & filename, typename MeshType::Pointer & mesh);
void
SelectNewSamples() override
{}
protected:
PolydataDummyPenalty();
~PolydataDummyPenalty() override = default;
private:
elxOverrideGetSelfMacro;
unsigned int m_NumberOfMeshes;
};
} // end namespace elastix
#ifndef ITK_MANUAL_INSTANTIATION
# include "elxPolydataDummyPenalty.hxx"
#endif
#endif // end #ifndef elxPolydataDummyPenalty_h
elastix::MetricBase::MovingPointSetType
itk::PointSet< CoordinateRepresentationType, MovingImageDimension, itk::DefaultStaticMeshTraits< CoordinateRepresentationType, MovingImageDimension, MovingImageDimension, CoordinateRepresentationType, CoordinateRepresentationType, CoordinateRepresentationType > > MovingPointSetType
Definition elxMetricBase.h:116
elastix::MetricBase::FixedPointSetType
itk::PointSet< CoordinateRepresentationType, FixedImageDimension, itk::DefaultStaticMeshTraits< CoordinateRepresentationType, FixedImageDimension, FixedImageDimension, CoordinateRepresentationType, CoordinateRepresentationType, CoordinateRepresentationType > > FixedPointSetType
Definition elxMetricBase.h:108
elastix::MetricBase::MetricBase
MetricBase()=default
elastix::MetricBase::ITKBaseType
itk::SingleValuedCostFunction ITKBaseType
Definition elxMetricBase.h:97
elastix::MetricBase::FixedImageType
typename ElastixType::FixedImageType FixedImageType
Definition elxMetricBase.h:89
elastix::MetricBase::MovingImageType
typename ElastixType::MovingImageType MovingImageType
Definition elxMetricBase.h:92
elastix::MetricBase::RegistrationType
typename ElastixType::RegistrationBaseType RegistrationType
Definition elxBaseComponentSE.h:62
elastix::MetricBase::ElastixType
TElastix ElastixType
Definition elxBaseComponentSE.h:57
elastix::PolydataDummyPenalty::m_NumberOfMeshes
unsigned int m_NumberOfMeshes
Definition elxPolydataDummyPenalty.h:204
elastix::PolydataDummyPenalty::itkStaticConstMacro
itkStaticConstMacro(MovingImageDimension, unsigned int, MovingImageType::ImageDimension)
elastix::PolydataDummyPenalty::SelectNewSamples
void SelectNewSamples() override
Definition elxPolydataDummyPenalty.h:192
elastix::PolydataDummyPenalty::Initialize
void Initialize() override
elastix::PolydataDummyPenalty::AfterEachIteration
void AfterEachIteration() override
elastix::PolydataDummyPenalty::elxOverrideGetSelfMacro
elxOverrideGetSelfMacro
Definition elxPolydataDummyPenalty.h:202
elastix::PolydataDummyPenalty::PolydataDummyPenalty
PolydataDummyPenalty()
elastix::PolydataDummyPenalty::elxClassNameMacro
elxClassNameMacro("PolydataDummyPenalty")
elastix::PolydataDummyPenalty::FixedImageType
typename ElastixType::FixedImageType FixedImageType
Definition elxMetricBase.h:89
elastix::PolydataDummyPenalty::BeforeRegistration
void BeforeRegistration() override
elastix::PolydataDummyPenalty::BeforeAllBase
int BeforeAllBase() override
elastix::PolydataDummyPenalty::ITKBaseType
typename Superclass2::ITKBaseType ITKBaseType
Definition elxPolydataDummyPenalty.h:139
elastix::PolydataDummyPenalty::~PolydataDummyPenalty
~PolydataDummyPenalty() override=default
elastix::PolydataDummyPenalty::Superclass2
MetricBase< TElastix > Superclass2
Definition elxPolydataDummyPenalty.h:76
elastix::PolydataDummyPenalty::ImageType
FixedImageType ImageType
Definition elxPolydataDummyPenalty.h:152
elastix::PolydataDummyPenalty::PointSetType
FixedPointSetType PointSetType
Definition elxPolydataDummyPenalty.h:150
elastix::PolydataDummyPenalty::Self
PolydataDummyPenalty Self
Definition elxPolydataDummyPenalty.h:73
elastix::PolydataDummyPenalty::WriteResultMesh
void WriteResultMesh(const std::string &filename, MeshIdType meshId)
elastix::PolydataDummyPenalty::MeshType
FixedMeshType MeshType
Definition elxPolydataDummyPenalty.h:151
elastix::PolydataDummyPenalty::ITK_DISALLOW_COPY_AND_MOVE
ITK_DISALLOW_COPY_AND_MOVE(PolydataDummyPenalty)
elastix::PolydataDummyPenalty::CoordRepType
typename OutputPointType::CoordRepType CoordRepType
Definition elxPolydataDummyPenalty.h:124
elastix::PolydataDummyPenalty::Superclass1
itk::MeshPenalty< typename MetricBase< TElastix >::FixedPointSetType, typename MetricBase< TElastix >::MovingPointSetType > Superclass1
Definition elxPolydataDummyPenalty.h:74
elastix::PolydataDummyPenalty::ReadMesh
unsigned int ReadMesh(const std::string &meshFileName, typename FixedMeshType::Pointer &mesh)
elastix::PolydataDummyPenalty::Pointer
itk::SmartPointer< Self > Pointer
Definition elxPolydataDummyPenalty.h:77
elastix::PolydataDummyPenalty::AfterEachResolution
void AfterEachResolution() override
elastix::PolydataDummyPenalty::CombinationTransformType
itk::AdvancedCombinationTransform< CoordRepType, Self::FixedImageDimension > CombinationTransformType
Definition elxPolydataDummyPenalty.h:133
elastix::PolydataDummyPenalty::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition elxPolydataDummyPenalty.h:78
elastix::PolydataDummyPenalty::ReadTransformixPoints
unsigned int ReadTransformixPoints(const std::string &filename, typename MeshType::Pointer &mesh)
elastix::PolydataDummyPenalty::InitialTransformType
typename CombinationTransformType::InitialTransformType InitialTransformType
Definition elxPolydataDummyPenalty.h:134
elastix::PolydataDummyPenalty::itkStaticConstMacro
itkStaticConstMacro(FixedImageDimension, unsigned int, FixedImageType::ImageDimension)
itk::AdvancedCombinationTransform
This class combines two transforms: an 'initial transform' with a 'current transform'.
Definition itkAdvancedCombinationTransform.h:57
itk::AdvancedCombinationTransform< CoordRepType, Self::FixedImageDimension >::InitialTransformType
Superclass InitialTransformType
Definition itkAdvancedCombinationTransform.h:110
itk::MeshPenalty
A dummy metric to generate transformed meshes each iteration.
Definition itkPolydataDummyPenalty.h:41
itk::MeshPenalty::FixedMeshType
Mesh< PointNormalType, FixedPointSetDimension, MeshTraitsType > FixedMeshType
Definition itkPolydataDummyPenalty.h:87
itk::MeshPenalty::MeshIdType
unsigned int MeshIdType
Definition itkPolydataDummyPenalty.h:109
elxIncludes.h
itkPolydataDummyPenalty.h
elastix
Definition elxDefaultConstruct.h:25

Generated on 1768596610 for elastix by 1.15.0 |