18#ifndef elxTransformIO_h
19#define elxTransformIO_h
24#include <itkCompositeTransform.h>
25#include <itkTransform.h>
26#include <itkTransformBase.h>
42 return fixed ? transform.GetFixedParameters() : transform.GetParameters();
48 fixed ? transform.SetFixedParameters(parameters) : transform.SetParameters(parameters);
61 template <
unsigned NDimension>
62 static itk::SmartPointer<itk::CompositeTransform<double, NDimension>>
68 if ((numberOfTransforms > 1) && (!advancedCombinationTransform.
GetUseComposition()))
75 const auto compositeTransform = itk::CompositeTransform<double, NDimension>::New();
77 for (itk::SizeValueType n{}; n < numberOfTransforms; ++n)
79 const auto nthTransform = advancedCombinationTransform.
GetNthTransform(n);
81 compositeTransform->AddTransform((singleItkTransform ==
nullptr) ? nthTransform : singleItkTransform);
83 return compositeTransform;
90 template <
unsigned NDimension>
91 static itk::SmartPointer<itk::CompositeTransform<double, NDimension>>
97 if ((numberOfTransforms > 1) && (!advancedCombinationTransform.
GetUseComposition()))
104 const auto compositeTransform = itk::CompositeTransform<double, NDimension>::New();
106 for (itk::SizeValueType n{}; n < numberOfTransforms; ++n)
108 const auto nthTransform = advancedCombinationTransform.
GetNthTransform(n);
111 if (singleItkTransform ==
nullptr)
115 compositeTransform->AddTransform(singleItkTransform);
117 return compositeTransform;
123 template <
unsigned NDimension>
124 static itk::SmartPointer<itk::Transform<double, NDimension, NDimension>>
129 assert(
dynamic_cast<const CombinationTransformType *
>(&elxTransform) ==
nullptr);
133 return transformAdapter->GetModifiableExternalTransform();
135 return dynamic_cast<itk::Transform<double, NDimension, NDimension> *
>(
145 Write(
const itk::Object & itkTransform,
const std::string & fileName);
147 static itk::TransformBase::Pointer
148 Read(
const std::string & fileName);
151 template <
typename TElastixTransform>
156 elxTransform.GetElastix()->GetCurrentTransformParameterFileName());
160 static itk::TransformBase::Pointer
A class that deals with user given parameters and command line arguments.
class ITK_TEMPLATE_EXPORT OptimizerParameters