ITK  4.13.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 
65 
68 
72  typedef TTransform TransformType;
73  typedef typename TransformType::Pointer TransformPointer;
78 
80  itkSetObjectMacro( Transform, TransformType );
81 
82  virtual void SetTransform( TransformBaseType * _arg, void * ) ITK_OVERRIDE
83  {
84  TransformType *tx = dynamic_cast<TransformType *>(_arg);
85  itkAssertOrThrowMacro( tx != ITK_NULLPTR, "Unable to convert Transform to require concrete transform!" );
86  this->SetTransform(tx);
87  }
88 
90  itkNewMacro( Self );
91 
93  virtual void SetRequiredFixedParameters( const FixedParametersType fixedParameters ) ITK_OVERRIDE
94  {
95  itkDebugMacro("setting RequiredFixedParameters to " << fixedParameters );
96  if ( this->m_RequiredFixedParameters != fixedParameters )
97  {
98  this->m_RequiredFixedParameters = fixedParameters;
99  this->Modified();
100  }
101  }
103 
105  virtual const FixedParametersType & GetRequiredFixedParameters() const ITK_OVERRIDE
106  {
107  return this->m_RequiredFixedParameters;
108  }
109 
111  virtual void AdaptTransformParameters() ITK_OVERRIDE {};
112 
113 protected:
115  ~TransformParametersAdaptor() ITK_OVERRIDE {}
116 
117  void PrintSelf( std::ostream & os, Indent indent ) const ITK_OVERRIDE
118  {
119  Superclass::PrintSelf( os, indent );
120  itkPrintSelfObjectMacro( Transform );
121  }
122 
124 
125 private:
126  ITK_DISALLOW_COPY_AND_ASSIGN(TransformParametersAdaptor);
127 
128 }; //class TransformParametersAdaptor
129 } // namespace itk
130 
131 #endif /* itkTransformParametersAdaptor_h */
TransformBaseType::ParametersType ParametersType
Superclass::FixedParametersType FixedParametersType
Base helper class intended for multi-resolution image registration.
Superclass::FixedParametersValueType FixedParametersValueType
void PrintSelf(std::ostream &os, Indent indent) const override
virtual void PrintSelf(std::ostream &os, Indent indent) const override
virtual const FixedParametersType & GetRequiredFixedParameters() const override
Base helper class intended for multi-resolution image registration.
Transform points and vectors from an input space to an output space.
Definition: itkTransform.h:82
TransformBaseType::FixedParametersType FixedParametersType
Superclass::TransformBaseType TransformBaseType
TransformBaseType::FixedParametersValueType FixedParametersValueType
Superclass::ParametersValueType ParametersValueType
virtual void SetTransform(TransformType *_arg)
virtual void Modified() const
virtual void SetTransform(TransformBaseType *_arg, void *) override
Control indentation during Print() invocation.
Definition: itkIndent.h:49
TransformParametersAdaptorBase< Transform< typename TTransform::ScalarType, TTransform::InputSpaceDimension, TTransform::OutputSpaceDimension > > Superclass
virtual void SetRequiredFixedParameters(const FixedParametersType fixedParameters) override