ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkTransformParametersAdaptor.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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>
56 : public TransformParametersAdaptorBase< Transform<typename TTransform::ScalarType, TTransform::InputSpaceDimension, TTransform::OutputSpaceDimension> >
57 {
58 public:
59  ITK_DISALLOW_COPY_AND_ASSIGN(TransformParametersAdaptor);
60 
66 
69 
73  using TransformType = TTransform;
74  using TransformPointer = typename TransformType::Pointer;
79 
81  itkSetObjectMacro( Transform, TransformType );
82 
83  void SetTransform( TransformBaseType * _arg, void * ) override
84  {
85  auto * tx = dynamic_cast<TransformType *>(_arg);
86  itkAssertOrThrowMacro( tx != nullptr, "Unable to convert Transform to require concrete transform!" );
87  this->SetTransform(tx);
88  }
89 
91  itkNewMacro( Self );
92 
94  void SetRequiredFixedParameters( const FixedParametersType fixedParameters ) override
95  {
96  itkDebugMacro("setting RequiredFixedParameters to " << fixedParameters );
97  if ( this->m_RequiredFixedParameters != fixedParameters )
98  {
99  this->m_RequiredFixedParameters = fixedParameters;
100  this->Modified();
101  }
102  }
104 
107  {
108  return this->m_RequiredFixedParameters;
109  }
110 
112  void AdaptTransformParameters() override {};
113 
114 protected:
115  TransformParametersAdaptor() = default;
116  ~TransformParametersAdaptor() override = default;
117 
118  void PrintSelf( std::ostream & os, Indent indent ) const override
119  {
120  Superclass::PrintSelf( os, indent );
121  itkPrintSelfObjectMacro( Transform );
122  }
123 
125 }; //class TransformParametersAdaptor
126 } // namespace itk
127 
128 #endif /* itkTransformParametersAdaptor_h */
Light weight base class for most itk classes.
typename TransformType::Pointer TransformPointer
Base helper class intended for multi-resolution image registration.
void SetTransform(TransformBaseType *_arg, void *) override
typename Superclass::FixedParametersType FixedParametersType
void PrintSelf(std::ostream &os, Indent indent) const override
Base helper class intended for multi-resolution image registration.
void SetRequiredFixedParameters(const FixedParametersType fixedParameters) override
typename Superclass::ParametersType ParametersType
Transform points and vectors from an input space to an output space.
Definition: itkTransform.h:83
typename Superclass::ParametersValueType ParametersValueType
typename ParametersType::ValueType ParametersValueType
virtual void SetTransform(TransformType *_arg)
virtual void Modified() const
typename TransformBaseType::FixedParametersValueType FixedParametersValueType
typename TransformBaseType::FixedParametersType FixedParametersType
typename Superclass::FixedParametersValueType FixedParametersValueType
~TransformParametersAdaptor() override=default
void PrintSelf(std::ostream &os, Indent indent) const override
const FixedParametersType & GetRequiredFixedParameters() const override
typename Superclass::TransformBaseType TransformBaseType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
typename TransformBaseType::ParametersType ParametersType