ITK  4.0.0
Insight Segmentation and Registration Toolkit
itkSimilarity3DTransform.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 #ifndef __itkSimilarity3DTransform_h
00019 #define __itkSimilarity3DTransform_h
00020 
00021 #include <iostream>
00022 #include "itkVersorRigid3DTransform.h"
00023 
00024 namespace itk
00025 {
00046 template <class TScalarType = double>
00047 // Data type for scalars (float or double)
00048 class ITK_EXPORT Similarity3DTransform :
00049   public VersorRigid3DTransform<TScalarType>
00050 {
00051 public:
00053   typedef Similarity3DTransform               Self;
00054   typedef VersorRigid3DTransform<TScalarType> Superclass;
00055   typedef SmartPointer<Self>                  Pointer;
00056   typedef SmartPointer<const Self>            ConstPointer;
00057 
00059   itkNewMacro(Self);
00060 
00062   itkTypeMacro(Similarity3DTransform, VersorRigid3DTransform);
00063 
00065   itkStaticConstMacro(SpaceDimension, unsigned int, 3);
00066   itkStaticConstMacro(InputSpaceDimension, unsigned int, 3);
00067   itkStaticConstMacro(OutputSpaceDimension, unsigned int, 3);
00068   itkStaticConstMacro(ParametersDimension, unsigned int, 7);
00070 
00072   typedef typename Superclass::ParametersType            ParametersType;
00073   typedef typename Superclass::JacobianType              JacobianType;
00074   typedef typename Superclass::ScalarType                ScalarType;
00075   typedef typename Superclass::InputPointType            InputPointType;
00076   typedef typename Superclass::OutputPointType           OutputPointType;
00077   typedef typename Superclass::InputVectorType           InputVectorType;
00078   typedef typename Superclass::OutputVectorType          OutputVectorType;
00079   typedef typename Superclass::InputVnlVectorType        InputVnlVectorType;
00080   typedef typename Superclass::OutputVnlVectorType       OutputVnlVectorType;
00081   typedef typename Superclass::InputCovariantVectorType  InputCovariantVectorType;
00082   typedef typename Superclass::OutputCovariantVectorType OutputCovariantVectorType;
00083   typedef typename Superclass::MatrixType                MatrixType;
00084   typedef typename Superclass::InverseMatrixType         InverseMatrixType;
00085   typedef typename Superclass::CenterType                CenterType;
00086   typedef typename Superclass::OffsetType                OffsetType;
00087   typedef typename Superclass::TranslationType           TranslationType;
00088 
00090   typedef typename Superclass::VersorType VersorType;
00091   typedef typename Superclass::AxisType   AxisType;
00092   typedef typename Superclass::AngleType  AngleType;
00093   typedef          TScalarType            ScaleType;
00094 
00096   virtual void SetIdentity(void);
00097 
00103   virtual void SetMatrix(const MatrixType & matrix);
00104 
00109   void SetParameters(const ParametersType & parameters);
00110 
00111   virtual const ParametersType & GetParameters(void) const;
00112 
00114   void SetScale(ScaleType scale);
00115 
00116   itkGetConstReferenceMacro(Scale, ScaleType);
00117 
00122   virtual void ComputeJacobianWithRespectToParameters( const InputPointType  & p, JacobianType & jacobian) const;
00123 
00124 protected:
00125   Similarity3DTransform(const MatrixType & matrix, const OutputVectorType & offset);
00126   Similarity3DTransform(unsigned int paramDim);
00127   Similarity3DTransform();
00128   ~Similarity3DTransform()
00129   {
00130   }
00131 
00132   void PrintSelf(std::ostream & os, Indent indent) const;
00133 
00136   void ComputeMatrix();
00137 
00139   void ComputeMatrixParameters();
00140 
00141 private:
00142   Similarity3DTransform(const Self &); // purposely not implemented
00143   void operator=(const Self &);        // purposely not implemented
00144 
00145   ScaleType m_Scale;
00146 }; // class Similarity3DTransform
00147 }  // namespace itk
00148 
00149 // Define instantiation macro for this template.
00150 #define ITK_TEMPLATE_Similarity3DTransform(_, EXPORT, TypeX, TypeY)                     \
00151   namespace itk                                                                         \
00152   {                                                                                     \
00153   _( 1 ( class EXPORT Similarity3DTransform<ITK_TEMPLATE_1 TypeX> ) )                 \
00154   namespace Templates                                                                   \
00155   {                                                                                     \
00156   typedef Similarity3DTransform<ITK_TEMPLATE_1 TypeX> Similarity3DTransform##TypeY; \
00157   }                                                                                     \
00158   }
00159 
00160 #if ITK_TEMPLATE_EXPLICIT
00161 #include "Templates/itkSimilarity3DTransform+-.h"
00162 #endif
00163 
00164 #if ITK_TEMPLATE_TXX
00165 #include "itkSimilarity3DTransform.hxx"
00166 #endif
00167 
00168 #endif /* __itkSimilarity3DTransform_h */
00169