Skip to content

Commit

Permalink
BUG: ITKElastix issue 93 SimilarityTrans... CreateTransformParametersMap
Browse files Browse the repository at this point in the history
Added `SimilarityTransformElastix<TElastix>::CreateTransformParametersMap` override, which adds the "CenterOfRotationPoint" parameter.

Addresses ITKElastix issue 93: "2D similarity transform parameter map doesn't keep "CenterOfRotationPoint" parameter", by Heath Patterson, 16 December, 2020.
InsightSoftwareConsortium/ITKElastix#93

Bug fixed with help from Stefan Klein and Viktor van der Valk.
  • Loading branch information
N-Dekker committed Dec 23, 2020
1 parent 3eabe70 commit 80716b7
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ class SimilarityTransformElastix
/** Typedef's inherited from TransformBase. */
typedef typename Superclass2::ElastixType ElastixType;
typedef typename Superclass2::ElastixPointer ElastixPointer;
typedef typename Superclass2::ParameterMapType ParameterMapType;
typedef typename Superclass2::ConfigurationType ConfigurationType;
typedef typename Superclass2::ConfigurationPointer ConfigurationPointer;
typedef typename Superclass2::RegistrationType RegistrationType;
Expand Down Expand Up @@ -210,6 +211,12 @@ class SimilarityTransformElastix
void
WriteToFile(const ParametersType & param) const override;

/** Function to create transform-parameters map.
* Creates the TransformParametersmap
*/
void
CreateTransformParametersMap(const ParametersType & param, ParameterMapType * paramsMap) const override;

protected:
/** The constructor. */
SimilarityTransformElastix();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,24 @@ SimilarityTransformElastix<TElastix>::WriteToFile(const ParametersType & param)
} // end WriteToFile()


/**
* ************************* CreateTransformParametersMap ************************
*/

template <class TElastix>
void
SimilarityTransformElastix<TElastix>::CreateTransformParametersMap(const ParametersType & param,
ParameterMapType * paramsMap) const
{
/** Call the CreateTransformParametersMap from the TransformBase. */
this->Superclass2::CreateTransformParametersMap(param, paramsMap);

/** Get the center of rotation point and write it to file. */
paramsMap->insert({ "CenterOfRotationPoint", BaseComponent::ToVectorOfStrings(m_SimilarityTransform->GetCenter()) });

} // end CreateTransformParametersMap()


/**
* ************************* InitializeTransform *********************
*/
Expand Down

0 comments on commit 80716b7

Please sign in to comment.