Loading...
Searching...
No Matches
elxBSplineStackTransform.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 elxBSplineStackTransform_h
#define elxBSplineStackTransform_h
#include "elxIncludes.h" // include first to avoid MSVS warning
#include "itkAdvancedCombinationTransform.h"
#include "itkAdvancedBSplineDeformableTransform.h"
#include "itkBSplineStackTransform.h"
#include "itkGridScheduleComputer.h"
#include "itkUpsampleBSplineParametersFilter.h"
namespace elastix
{
template <class TElastix>
class ITK_TEMPLATE_EXPORT BSplineStackTransform
: public itk::AdvancedCombinationTransform<typename elx::TransformBase<TElastix>::CoordRepType,
elx::TransformBase<TElastix>::FixedImageDimension>
, public TransformBase<TElastix>
{
public:
ITK_DISALLOW_COPY_AND_MOVE(BSplineStackTransform);
using Self = BSplineStackTransform;
using Superclass1 = itk::AdvancedCombinationTransform<typename elx::TransformBase<TElastix>::CoordRepType,
elx::TransformBase<TElastix>::FixedImageDimension>;
using Superclass2 = elx::TransformBase<TElastix>;
using Pointer = itk::SmartPointer<Self>;
using ConstPointer = itk::SmartPointer<const Self>;
itkNewMacro(Self);
itkTypeMacro(BSplineStackTransform, itk::AdvancedCombinationTransform);
elxClassNameMacro("BSplineStackTransform");
itkStaticConstMacro(SpaceDimension, unsigned int, Superclass2::FixedImageDimension);
itkStaticConstMacro(ReducedSpaceDimension, unsigned int, Superclass2::FixedImageDimension - 1);
using BSplineTransformBaseType =
itk::AdvancedBSplineDeformableTransformBase<typename elx::TransformBase<TElastix>::CoordRepType,
Self::SpaceDimension>;
using BSplineTransformBasePointer = typename BSplineTransformBaseType::Pointer;
using ReducedDimensionBSplineTransformBaseType =
itk::AdvancedBSplineDeformableTransformBase<typename elx::TransformBase<TElastix>::CoordRepType,
Self::ReducedSpaceDimension>;
using ReducedDimensionBSplineTransformBasePointer = typename ReducedDimensionBSplineTransformBaseType::Pointer;
using typename Superclass1::ParametersType;
using typename Superclass2::ParameterMapType;
using typename Superclass1::NumberOfParametersType;
using PixelType = typename BSplineTransformBaseType::PixelType;
using ImageType = typename BSplineTransformBaseType::ImageType;
using ImagePointer = typename BSplineTransformBaseType::ImagePointer;
using RegionType = typename BSplineTransformBaseType::RegionType;
using IndexType = typename BSplineTransformBaseType::IndexType;
using SizeType = typename BSplineTransformBaseType::SizeType;
using SpacingType = typename BSplineTransformBaseType::SpacingType;
using OriginType = typename BSplineTransformBaseType::OriginType;
using DirectionType = typename BSplineTransformBaseType::DirectionType;
using typename Superclass2::ElastixType;
using typename Superclass2::RegistrationType;
using typename Superclass2::CoordRepType;
using typename Superclass2::FixedImageType;
using typename Superclass2::MovingImageType;
using ITKBaseType = typename Superclass2::ITKBaseType;
using CombinationTransformType = typename Superclass2::CombinationTransformType;
using ReducedDimensionImageType = itk::Image<PixelType, Self::ReducedSpaceDimension>;
using ReducedDimensionRegionType = itk::ImageRegion<Self::ReducedSpaceDimension>;
using ReducedDimensionSizeType = typename ReducedDimensionRegionType::SizeType;
using ReducedDimensionIndexType = typename ReducedDimensionRegionType::IndexType;
using ReducedDimensionSpacingType = typename ReducedDimensionImageType::SpacingType;
using ReducedDimensionDirectionType = typename ReducedDimensionImageType::DirectionType;
using ReducedDimensionOriginType = typename ReducedDimensionImageType::PointType;
using GridScheduleComputerType = itk::GridScheduleComputer<CoordRepType, ReducedSpaceDimension>;
using GridScheduleComputerPointer = typename GridScheduleComputerType::Pointer;
using GridScheduleType = typename GridScheduleComputerType ::VectorGridSpacingFactorType;
using GridUpsamplerType = itk::UpsampleBSplineParametersFilter<ParametersType, ReducedDimensionImageType>;
using GridUpsamplerPointer = typename GridUpsamplerType::Pointer;
using ParameterValueType = std::vector<std::string>;
int
BeforeAll() override;
void
BeforeRegistration() override;
void
BeforeEachResolution() override;
virtual void
IncreaseScale();
void
ReadFromFile() override;
virtual void
SetOptimizerScales(const unsigned int edgeWidth);
protected:
BSplineStackTransform() { this->Superclass1::SetCurrentTransform(m_StackTransform); }
~BSplineStackTransform() override = default;
virtual void
PreComputeGridInformation();
private:
elxOverrideGetSelfMacro;
void
InitializeTransform();
ParameterMapType
CreateDerivedTransformParameterMap() const override;
using StackTransformType = itk::BSplineStackTransform<SpaceDimension>;
const typename StackTransformType::Pointer m_StackTransform{ StackTransformType::New() };
ReducedDimensionBSplineTransformBasePointer m_DummySubTransform;
GridScheduleComputerPointer m_GridScheduleComputer;
GridUpsamplerPointer m_GridUpsampler;
unsigned int m_SplineOrder;
unsigned int m_NumberOfSubTransforms;
double m_StackOrigin, m_StackSpacing;
unsigned int
InitializeBSplineTransform();
};
} // end namespace elastix
#ifndef ITK_MANUAL_INSTANTIATION
# include "elxBSplineStackTransform.hxx"
#endif
#endif // end #ifndef elxBSplineStackTransform_h
elastix::BSplineStackTransform::ReducedDimensionRegionType
itk::ImageRegion< Self::ReducedSpaceDimension > ReducedDimensionRegionType
Definition elxBSplineStackTransform.h:185
elastix::BSplineStackTransform::m_SplineOrder
unsigned int m_SplineOrder
Definition elxBSplineStackTransform.h:291
elastix::BSplineStackTransform::ReducedDimensionIndexType
typename ReducedDimensionRegionType::IndexType ReducedDimensionIndexType
Definition elxBSplineStackTransform.h:187
elastix::BSplineStackTransform::BSplineTransformBasePointer
typename BSplineTransformBaseType::Pointer BSplineTransformBasePointer
Definition elxBSplineStackTransform.h:150
elastix::BSplineStackTransform::BeforeAll
int BeforeAll() override
elastix::BSplineStackTransform::GridScheduleType
typename GridScheduleComputerType ::VectorGridSpacingFactorType GridScheduleType
Definition elxBSplineStackTransform.h:195
elastix::BSplineStackTransform::ReducedDimensionSpacingType
typename ReducedDimensionImageType::SpacingType ReducedDimensionSpacingType
Definition elxBSplineStackTransform.h:188
elastix::BSplineStackTransform::m_StackOrigin
double m_StackOrigin
Definition elxBSplineStackTransform.h:295
elastix::BSplineStackTransform::ImagePointer
typename BSplineTransformBaseType::ImagePointer ImagePointer
Definition elxBSplineStackTransform.h:166
elastix::BSplineStackTransform::BSplineTransformBaseType
itk::AdvancedBSplineDeformableTransformBase< typename elx::TransformBase< TElastix >::CoordRepType, Self::SpaceDimension > BSplineTransformBaseType
Definition elxBSplineStackTransform.h:147
elastix::BSplineStackTransform::CombinationTransformType
typename Superclass2::CombinationTransformType CombinationTransformType
Definition elxBSplineStackTransform.h:181
elastix::BSplineStackTransform::m_NumberOfSubTransforms
unsigned int m_NumberOfSubTransforms
Definition elxBSplineStackTransform.h:294
elastix::BSplineStackTransform::RegionType
typename BSplineTransformBaseType::RegionType RegionType
Definition elxBSplineStackTransform.h:167
elastix::BSplineStackTransform::CreateDerivedTransformParameterMap
ParameterMapType CreateDerivedTransformParameterMap() const override
elastix::BSplineStackTransform::ReducedDimensionOriginType
typename ReducedDimensionImageType::PointType ReducedDimensionOriginType
Definition elxBSplineStackTransform.h:190
elastix::BSplineStackTransform::m_GridScheduleComputer
GridScheduleComputerPointer m_GridScheduleComputer
Definition elxBSplineStackTransform.h:287
elastix::BSplineStackTransform::ITKBaseType
typename Superclass2::ITKBaseType ITKBaseType
Definition elxBSplineStackTransform.h:180
elastix::BSplineStackTransform::ImageType
typename BSplineTransformBaseType::ImageType ImageType
Definition elxBSplineStackTransform.h:165
elastix::BSplineStackTransform::ReducedDimensionDirectionType
typename ReducedDimensionImageType::DirectionType ReducedDimensionDirectionType
Definition elxBSplineStackTransform.h:189
elastix::BSplineStackTransform::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition elxBSplineStackTransform.h:126
elastix::BSplineStackTransform::GridScheduleComputerPointer
typename GridScheduleComputerType::Pointer GridScheduleComputerPointer
Definition elxBSplineStackTransform.h:194
elastix::BSplineStackTransform::m_DummySubTransform
ReducedDimensionBSplineTransformBasePointer m_DummySubTransform
Definition elxBSplineStackTransform.h:284
elastix::BSplineStackTransform::ReducedDimensionImageType
itk::Image< PixelType, Self::ReducedSpaceDimension > ReducedDimensionImageType
Definition elxBSplineStackTransform.h:184
elastix::BSplineStackTransform::BSplineStackTransform
BSplineStackTransform()
Definition elxBSplineStackTransform.h:252
elastix::BSplineStackTransform::InitializeTransform
void InitializeTransform()
elastix::BSplineStackTransform::IncreaseScale
virtual void IncreaseScale()
elastix::BSplineStackTransform::ITK_DISALLOW_COPY_AND_MOVE
ITK_DISALLOW_COPY_AND_MOVE(BSplineStackTransform)
elastix::BSplineStackTransform::IndexType
typename BSplineTransformBaseType::IndexType IndexType
Definition elxBSplineStackTransform.h:168
elastix::BSplineStackTransform::itkStaticConstMacro
itkStaticConstMacro(SpaceDimension, unsigned int, Superclass2::FixedImageDimension)
elastix::BSplineStackTransform::ParameterMapType
typename TElastix::ParameterMapType ParameterMapType
Definition elxTransformBase.h:199
elastix::BSplineStackTransform::OriginType
typename BSplineTransformBaseType::OriginType OriginType
Definition elxBSplineStackTransform.h:171
elastix::BSplineStackTransform::BeforeRegistration
void BeforeRegistration() override
elastix::BSplineStackTransform::elxOverrideGetSelfMacro
elxOverrideGetSelfMacro
Definition elxBSplineStackTransform.h:262
elastix::BSplineStackTransform::ReducedDimensionSizeType
typename ReducedDimensionRegionType::SizeType ReducedDimensionSizeType
Definition elxBSplineStackTransform.h:186
elastix::BSplineStackTransform::Superclass2
elx::TransformBase< TElastix > Superclass2
Definition elxBSplineStackTransform.h:124
elastix::BSplineStackTransform::m_StackTransform
const StackTransformType::Pointer m_StackTransform
Definition elxBSplineStackTransform.h:281
elastix::BSplineStackTransform::BeforeEachResolution
void BeforeEachResolution() override
elastix::BSplineStackTransform::Pointer
itk::SmartPointer< Self > Pointer
Definition elxBSplineStackTransform.h:125
elastix::BSplineStackTransform::SizeType
typename BSplineTransformBaseType::SizeType SizeType
Definition elxBSplineStackTransform.h:169
elastix::BSplineStackTransform::~BSplineStackTransform
~BSplineStackTransform() override=default
elastix::BSplineStackTransform::ParameterValueType
std::vector< std::string > ParameterValueType
Definition elxBSplineStackTransform.h:200
elastix::BSplineStackTransform::Self
BSplineStackTransform Self
Definition elxBSplineStackTransform.h:121
elastix::BSplineStackTransform::elxClassNameMacro
elxClassNameMacro("BSplineStackTransform")
elastix::BSplineStackTransform::PreComputeGridInformation
virtual void PreComputeGridInformation()
elastix::BSplineStackTransform::DirectionType
typename BSplineTransformBaseType::DirectionType DirectionType
Definition elxBSplineStackTransform.h:172
elastix::BSplineStackTransform::GridScheduleComputerType
itk::GridScheduleComputer< CoordRepType, ReducedSpaceDimension > GridScheduleComputerType
Definition elxBSplineStackTransform.h:193
elastix::BSplineStackTransform::InitializeBSplineTransform
unsigned int InitializeBSplineTransform()
elastix::BSplineStackTransform::GridUpsamplerPointer
typename GridUpsamplerType::Pointer GridUpsamplerPointer
Definition elxBSplineStackTransform.h:197
elastix::BSplineStackTransform::ReducedDimensionBSplineTransformBaseType
itk::AdvancedBSplineDeformableTransformBase< typename elx::TransformBase< TElastix >::CoordRepType, Self::ReducedSpaceDimension > ReducedDimensionBSplineTransformBaseType
Definition elxBSplineStackTransform.h:153
elastix::BSplineStackTransform::SpacingType
typename BSplineTransformBaseType::SpacingType SpacingType
Definition elxBSplineStackTransform.h:170
elastix::BSplineStackTransform::Superclass1
itk::AdvancedCombinationTransform< typename elx::TransformBase< TElastix >::CoordRepType, elx::TransformBase< TElastix >::FixedImageDimension > Superclass1
Definition elxBSplineStackTransform.h:122
elastix::BSplineStackTransform::ReadFromFile
void ReadFromFile() override
elastix::BSplineStackTransform::SetOptimizerScales
virtual void SetOptimizerScales(const unsigned int edgeWidth)
elastix::BSplineStackTransform::StackTransformType
itk::BSplineStackTransform< SpaceDimension > StackTransformType
Definition elxBSplineStackTransform.h:278
elastix::BSplineStackTransform::GridUpsamplerType
itk::UpsampleBSplineParametersFilter< ParametersType, ReducedDimensionImageType > GridUpsamplerType
Definition elxBSplineStackTransform.h:196
elastix::BSplineStackTransform::ReducedDimensionBSplineTransformBasePointer
typename ReducedDimensionBSplineTransformBaseType::Pointer ReducedDimensionBSplineTransformBasePointer
Definition elxBSplineStackTransform.h:156
elastix::BSplineStackTransform::itkStaticConstMacro
itkStaticConstMacro(ReducedSpaceDimension, unsigned int, Superclass2::FixedImageDimension - 1)
elastix::BSplineStackTransform::m_GridUpsampler
GridUpsamplerPointer m_GridUpsampler
Definition elxBSplineStackTransform.h:288
elastix::BSplineStackTransform::m_StackSpacing
double m_StackSpacing
Definition elxBSplineStackTransform.h:295
elastix::BaseComponentSE::ElastixType
TElastix ElastixType
Definition elxBaseComponentSE.h:57
elastix::TransformBase
This class is the elastix base class for all Transforms.
Definition elxTransformBase.h:138
elastix::TransformBase::FixedImageType
typename TElastix::FixedImageType FixedImageType
Definition elxTransformBase.h:157
elastix::TransformBase::CoordRepType
ElastixBase::CoordRepType CoordRepType
Definition elxTransformBase.h:156
elastix::TransformBase::ParameterMapType
typename TElastix::ParameterMapType ParameterMapType
Definition elxTransformBase.h:199
elastix::TransformBase::MovingImageType
typename TElastix::MovingImageType MovingImageType
Definition elxTransformBase.h:158
elastix::TransformBase::RegistrationType
typename ElastixType::RegistrationBaseType RegistrationType
Definition elxBaseComponentSE.h:62
elastix::TransformBase::TransformBase
TransformBase()=default
elastix::TransformBase::CombinationTransformType
itk::AdvancedCombinationTransform< CoordRepType, Self::FixedImageDimension > CombinationTransformType
Definition elxTransformBase.h:171
elastix::TransformBase::ITKBaseType
CombinationTransformType ITKBaseType
Definition elxTransformBase.h:172
itk::AdvancedBSplineDeformableTransformBase
Base class for deformable transform using a B-spline representation.
Definition itkAdvancedBSplineDeformableTransformBase.h:43
itk::AdvancedCombinationTransform
This class combines two transforms: an 'initial transform' with a 'current transform'.
Definition itkAdvancedCombinationTransform.h:57
itk::BSplineStackTransform
Definition itkBSplineStackTransform.h:30
itk::BSplineStackTransform< SpaceDimension >::Pointer
itk::SmartPointer< BSplineStackTransform > Pointer
Definition itkBSplineStackTransform.h:39
itk::BSplineStackTransform< SpaceDimension >::New
static Pointer New()
itk::GridScheduleComputer
This class computes all information about the B-spline grid, given the image information and the desi...
Definition itkGridScheduleComputer.h:41
itk::GridScheduleComputer< CoordRepType, ReducedSpaceDimension >::Pointer
SmartPointer< Self > Pointer
Definition itkGridScheduleComputer.h:48
itk::UpsampleBSplineParametersFilter
Convenience class for upsampling a B-spline coefficient image.
Definition itkUpsampleBSplineParametersFilter.h:40
itk::UpsampleBSplineParametersFilter< ParametersType, ReducedDimensionImageType >::Pointer
SmartPointer< Self > Pointer
Definition itkUpsampleBSplineParametersFilter.h:47
elxIncludes.h
itkAdvancedBSplineDeformableTransform.h
itkAdvancedCombinationTransform.h
itkBSplineStackTransform.h
itkGridScheduleComputer.h
itkUpsampleBSplineParametersFilter.h
elastix
Definition elxDefaultConstruct.h:25

Generated on 1768596610 for elastix by 1.15.0 |