ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkEuler3DTransform.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 __itkEuler3DTransform_h
00019 #define __itkEuler3DTransform_h
00020 
00021 #include <iostream>
00022 #include "itkRigid3DTransform.h"
00023 
00024 namespace itk
00025 {
00046 template <class TScalarType = double>
00047 // Data type for scalars (float or double)
00048 class ITK_EXPORT Euler3DTransform :
00049   public Rigid3DTransform<TScalarType>
00050 {
00051 public:
00053   typedef Euler3DTransform              Self;
00054   typedef Rigid3DTransform<TScalarType> Superclass;
00055   typedef SmartPointer<Self>            Pointer;
00056   typedef SmartPointer<const Self>      ConstPointer;
00057 
00059   itkNewMacro(Self);
00060 
00062   itkTypeMacro(Euler3DTransform, Rigid3DTransform);
00063 
00065   itkStaticConstMacro(SpaceDimension, unsigned int, 3);
00066   itkStaticConstMacro(InputSpaceDimension, unsigned int, 3);
00067   itkStaticConstMacro(OutputSpaceDimension, unsigned int, 3);
00068   itkStaticConstMacro(ParametersDimension, unsigned int, 6);
00070 
00071   typedef typename Superclass::ParametersType            ParametersType;
00072   typedef typename Superclass::ParametersValueType       ParametersValueType;
00073   typedef typename Superclass::JacobianType              JacobianType;
00074   typedef typename Superclass::ScalarType                ScalarType;
00075   typedef typename Superclass::InputVectorType           InputVectorType;
00076   typedef typename Superclass::OutputVectorType          OutputVectorType;
00077   typedef typename Superclass::InputCovariantVectorType  InputCovariantVectorType;
00078   typedef typename Superclass::OutputCovariantVectorType OutputCovariantVectorType;
00079   typedef typename Superclass::InputVnlVectorType        InputVnlVectorType;
00080   typedef typename Superclass::OutputVnlVectorType       OutputVnlVectorType;
00081   typedef typename Superclass::InputPointType            InputPointType;
00082   typedef typename Superclass::OutputPointType           OutputPointType;
00083   typedef typename Superclass::MatrixType                MatrixType;
00084   typedef typename Superclass::InverseMatrixType         InverseMatrixType;
00085   typedef typename Superclass::CenterType                CenterType;
00086   typedef typename Superclass::TranslationType           TranslationType;
00087   typedef typename Superclass::OffsetType                OffsetType;
00088   typedef typename Superclass::ScalarType                AngleType;
00089 
00094   void SetParameters(const ParametersType & parameters);
00095 
00096   const ParametersType & GetParameters(void) const;
00097 
00099   void SetRotation(ScalarType angleX, ScalarType angleY, ScalarType angleZ);
00100 
00101   itkGetConstMacro(AngleX, ScalarType);
00102   itkGetConstMacro(AngleY, ScalarType);
00103   itkGetConstMacro(AngleZ, ScalarType);
00104 
00109   virtual void ComputeJacobianWithRespectToParameters( const InputPointType  & p, JacobianType & jacobian) const;
00110 
00112   itkSetMacro(ComputeZYX, bool);
00113   itkGetConstMacro(ComputeZYX, bool);
00115 
00116   virtual void SetIdentity(void);
00117 
00118 protected:
00119   Euler3DTransform(const MatrixType & matrix, const OutputPointType & offset);
00120   Euler3DTransform(unsigned int paramsSpaceDims);
00121   Euler3DTransform();
00122 
00123   ~Euler3DTransform()
00124   {
00125   }
00126 
00127   void PrintSelf(std::ostream & os, Indent indent) const;
00128 
00130   void SetVarRotation(ScalarType angleX, ScalarType angleY, ScalarType angleZ);
00131 
00133   void ComputeMatrix(void);
00134 
00135   void ComputeMatrixParameters(void);
00136 
00137 private:
00138   Euler3DTransform(const Self &); // purposely not implemented
00139   void operator=(const Self &);   // purposely not implemented
00140 
00141   ScalarType m_AngleX;
00142   ScalarType m_AngleY;
00143   ScalarType m_AngleZ;
00144   bool       m_ComputeZYX;
00145 }; // class Euler3DTransform
00146 }  // namespace itk
00147 
00148 // Define instantiation macro for this template.
00149 #define ITK_TEMPLATE_Euler3DTransform(_, EXPORT, TypeX, TypeY)     \
00150   namespace itk                                                    \
00151   {                                                                \
00152   _( 1 ( class EXPORT Euler3DTransform<ITK_TEMPLATE_1 TypeX> ) ) \
00153   namespace Templates                                              \
00154   {                                                                \
00155   typedef Euler3DTransform<ITK_TEMPLATE_1 TypeX>                 \
00156   Euler3DTransform##TypeY;                                       \
00157   }                                                                \
00158   }
00159 
00160 #if ITK_TEMPLATE_EXPLICIT
00161 #include "Templates/itkEuler3DTransform+-.h"
00162 #endif
00163 
00164 #if ITK_TEMPLATE_TXX
00165 #include "itkEuler3DTransform.hxx"
00166 #endif
00167 
00168 #endif /* __itkEuler3DTransform_h */
00169