ITK  6.0.0
Insight Toolkit
itkTransformParametersAdaptor.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
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  * https://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 itkTransformParametersAdaptor_h
19 #define itkTransformParametersAdaptor_h
20 
22 #include "itkTransform.h"
23 
24 namespace itk
25 {
54 template <typename TTransform>
57  Transform<typename TTransform::ScalarType, TTransform::InputSpaceDimension, TTransform::OutputSpaceDimension>>
58 {
59 public:
60  ITK_DISALLOW_COPY_AND_MOVE(TransformParametersAdaptor);
61 
68 
70  itkOverrideGetNameOfClassMacro(TransformParametersAdaptor);
71 
74  using typename Superclass::TransformBaseType;
75  using TransformType = TTransform;
77  using typename Superclass::ParametersType;
78  using typename Superclass::ParametersValueType;
80  using typename Superclass::FixedParametersType;
81 
83  itkSetObjectMacro(Transform, TransformType);
84 
85  void
86  SetTransform(TransformBaseType * _arg, void *) override
87  {
88  auto * tx = dynamic_cast<TransformType *>(_arg);
89  itkAssertOrThrowMacro(tx != nullptr, "Unable to convert Transform to require concrete transform!");
90  this->SetTransform(tx);
91  }
92 
94  itkNewMacro(Self);
95 
97  void
98  SetRequiredFixedParameters(const FixedParametersType fixedParameters) override
99  {
100  itkDebugMacro("setting RequiredFixedParameters to " << fixedParameters);
101  if (this->m_RequiredFixedParameters != fixedParameters)
102  {
103  this->m_RequiredFixedParameters = fixedParameters;
104  this->Modified();
105  }
106  }
110  void
112  {}
113 
114 protected:
115  TransformParametersAdaptor() = default;
116  ~TransformParametersAdaptor() override = default;
117 
118  void
119  PrintSelf(std::ostream & os, Indent indent) const override
120  {
121  Superclass::PrintSelf(os, indent);
122  itkPrintSelfObjectMacro(Transform);
123  }
124 
126 }; // class TransformParametersAdaptor
127 } // namespace itk
128 
129 #endif /* itkTransformParametersAdaptor_h */
itk::TransformParametersAdaptorBase::ParametersType
typename TransformBaseType::ParametersType ParametersType
Definition: itkTransformParametersAdaptorBase.h:72
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
itk::TransformParametersAdaptorBase
Base helper class intended for multi-resolution image registration.
Definition: itkTransformParametersAdaptorBase.h:55
itk::TransformParametersAdaptorBase::FixedParametersType
typename TransformBaseType::FixedParametersType FixedParametersType
Definition: itkTransformParametersAdaptorBase.h:74
itk::TransformParametersAdaptor::TransformParametersAdaptor
TransformParametersAdaptor()=default
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::TransformParametersAdaptorBase::ParametersValueType
typename ParametersType::ValueType ParametersValueType
Definition: itkTransformParametersAdaptorBase.h:73
itkTransformParametersAdaptorBase.h
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itk::TransformParametersAdaptor::TransformType
TTransform TransformType
Definition: itkTransformParametersAdaptor.h:75
itk::TransformParametersAdaptor::~TransformParametersAdaptor
~TransformParametersAdaptor() override=default
itk::TransformParametersAdaptorBase::PrintSelf
void PrintSelf(std::ostream &os, Indent indent) const override
Definition: itkTransformParametersAdaptorBase.h:97
itk::TransformParametersAdaptor::PrintSelf
void PrintSelf(std::ostream &os, Indent indent) const override
Definition: itkTransformParametersAdaptor.h:119
itk::TransformParametersAdaptor::SetTransform
void SetTransform(TransformBaseType *_arg, void *) override
Definition: itkTransformParametersAdaptor.h:86
itk::TransformParametersAdaptor::TransformPointer
typename TransformType::Pointer TransformPointer
Definition: itkTransformParametersAdaptor.h:76
itk::TransformParametersAdaptorBase< Transform< TTransform::ScalarType, TTransform::InputSpaceDimension, TTransform::OutputSpaceDimension > >::m_RequiredFixedParameters
FixedParametersType m_RequiredFixedParameters
Definition: itkTransformParametersAdaptorBase.h:103
itk::TransformParametersAdaptor
Base helper class intended for multi-resolution image registration.
Definition: itkTransformParametersAdaptor.h:55
itk::TransformParametersAdaptorBase::FixedParametersValueType
typename TransformBaseType::FixedParametersValueType FixedParametersValueType
Definition: itkTransformParametersAdaptorBase.h:75
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itk::TransformParametersAdaptor::SetTransform
virtual void SetTransform(TransformType *_arg)
itk::TransformParametersAdaptor::AdaptTransformParameters
void AdaptTransformParameters() override
Definition: itkTransformParametersAdaptor.h:111
itk::TransformParametersAdaptor::m_Transform
TransformPointer m_Transform
Definition: itkTransformParametersAdaptor.h:125
itk::TransformParametersAdaptor::SetRequiredFixedParameters
void SetRequiredFixedParameters(const FixedParametersType fixedParameters) override
Definition: itkTransformParametersAdaptor.h:98
itk::TransformParametersAdaptorBase::TransformBaseType
TTransform TransformBaseType
Definition: itkTransformParametersAdaptorBase.h:70
itk::Transform
Transform points and vectors from an input space to an output space.
Definition: itkTransform.h:83
AddImageFilter
Definition: itkAddImageFilter.h:81
itkTransform.h
itk::Object::Modified
virtual void Modified() const