ITK  5.2.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  * http://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 
71 
75  using TransformType = TTransform;
76  using TransformPointer = typename TransformType::Pointer;
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  }
108 
110  const FixedParametersType &
111  GetRequiredFixedParameters() const override
112  {
113  return this->m_RequiredFixedParameters;
114  }
115 
117  void
119 
120 protected:
121  TransformParametersAdaptor() = default;
122  ~TransformParametersAdaptor() override = default;
123 
124  void
125  PrintSelf(std::ostream & os, Indent indent) const override
126  {
127  Superclass::PrintSelf(os, indent);
128  itkPrintSelfObjectMacro(Transform);
129  }
130 
132 }; // class TransformParametersAdaptor
133 } // namespace itk
134 
135 #endif /* itkTransformParametersAdaptor_h */
itk::TransformParametersAdaptorBase::ParametersType
typename TransformBaseType::ParametersType ParametersType
Definition: itkTransformParametersAdaptorBase.h:72
itk::TransformParametersAdaptor::ParametersValueType
typename Superclass::ParametersValueType ParametersValueType
Definition: itkTransformParametersAdaptor.h:78
itk::TransformParametersAdaptorBase
Base helper class intended for multi-resolution image registration.
Definition: itkTransformParametersAdaptorBase.h:55
itk::TransformParametersAdaptor::GetRequiredFixedParameters
const FixedParametersType & GetRequiredFixedParameters() const override
Definition: itkTransformParametersAdaptor.h:111
itk::TransformParametersAdaptorBase::FixedParametersType
typename TransformBaseType::FixedParametersType FixedParametersType
Definition: itkTransformParametersAdaptorBase.h:74
itk::TransformParametersAdaptor::ParametersType
typename Superclass::ParametersType ParametersType
Definition: itkTransformParametersAdaptor.h:77
itk::TransformParametersAdaptor::TransformParametersAdaptor
TransformParametersAdaptor()=default
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::TransformParametersAdaptor::FixedParametersType
typename Superclass::FixedParametersType FixedParametersType
Definition: itkTransformParametersAdaptor.h:80
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:59
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:125
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: itkAnnulusOperator.h:24
itk::TransformParametersAdaptor::SetTransform
virtual void SetTransform(TransformType *_arg)
itk::TransformParametersAdaptor::AdaptTransformParameters
void AdaptTransformParameters() override
Definition: itkTransformParametersAdaptor.h:118
itk::TransformParametersAdaptor::m_Transform
TransformPointer m_Transform
Definition: itkTransformParametersAdaptor.h:131
itk::TransformParametersAdaptor::TransformBaseType
typename Superclass::TransformBaseType TransformBaseType
Definition: itkTransformParametersAdaptor.h:74
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:82
itkTransform.h
itk::Object::Modified
virtual void Modified() const
itk::TransformParametersAdaptor::FixedParametersValueType
typename Superclass::FixedParametersValueType FixedParametersValueType
Definition: itkTransformParametersAdaptor.h:79
itk::TransformParametersAdaptor::Self
TransformParametersAdaptor Self
Definition: itkTransformParametersAdaptor.h:63