ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkScaleSkewVersor3DTransform.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 __itkScaleSkewVersor3DTransform_h
00019 #define __itkScaleSkewVersor3DTransform_h
00020 
00021 #include <iostream>
00022 #include "itkVersorRigid3DTransform.h"
00023 
00024 namespace itk
00025 {
00047 template <class TScalarType = double>
00048 // Data type for scalars:float or double
00049 class ITK_EXPORT ScaleSkewVersor3DTransform :
00050   public VersorRigid3DTransform<TScalarType>
00051 {
00052 public:
00054   typedef ScaleSkewVersor3DTransform          Self;
00055   typedef VersorRigid3DTransform<TScalarType> Superclass;
00056   typedef SmartPointer<Self>                  Pointer;
00057   typedef SmartPointer<const Self>            ConstPointer;
00058 
00060   itkNewMacro(Self);
00061 
00063   itkTypeMacro(ScaleSkewVersor3DTransform, VersorRigid3DTransform);
00064 
00066   itkStaticConstMacro(InputSpaceDimension, unsigned int, 3);
00067   itkStaticConstMacro(OutputSpaceDimension, unsigned int, 3);
00068   itkStaticConstMacro(ParametersDimension, unsigned int, 15);
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 
00089   typedef typename Superclass::VersorType VersorType;
00090   typedef typename Superclass::AxisType   AxisType;
00091   typedef typename Superclass::AngleType  AngleType;
00092 
00094   typedef Vector<TScalarType, 3> ScaleVectorType;
00095   typedef Vector<TScalarType, 6> SkewVectorType;
00096 
00097   typedef typename ScaleVectorType::ValueType ScaleVectorValueType;
00098   typedef typename SkewVectorType::ValueType  SkewVectorValueType;
00099   typedef typename TranslationType::ValueType TranslationValueType;
00100 
00101   typedef typename Superclass::AxisValueType      AxisValueType;
00102   typedef typename Superclass::ParameterValueType ParameterValueType;
00103 
00107   virtual void SetMatrix(const MatrixType & matrix);
00108 
00117   virtual void SetParameters(const ParametersType & parameters);
00118 
00119   virtual const ParametersType & GetParameters(void) const;
00120 
00121   void SetScale(const ScaleVectorType & scale);
00122 
00123   itkGetConstReferenceMacro(Scale, ScaleVectorType);
00124 
00125   void SetSkew(const SkewVectorType & skew);
00126 
00127   itkGetConstReferenceMacro(Skew, SkewVectorType);
00128 
00129   void SetIdentity();
00130 
00135   virtual void ComputeJacobianWithRespectToParameters( const InputPointType  & p, JacobianType & jacobian) const;
00136 
00137 protected:
00138   ScaleSkewVersor3DTransform();
00139   ScaleSkewVersor3DTransform(const MatrixType & matrix, const OutputVectorType & offset);
00140   ScaleSkewVersor3DTransform(unsigned int paramDims);
00141   ~ScaleSkewVersor3DTransform()
00142   {
00143   }
00144 
00145   void PrintSelf(std::ostream & os, Indent indent) const;
00146 
00147   void SetVarScale(const ScaleVectorType & scale)
00148   {
00149     m_Scale = scale;
00150   }
00151 
00152   void SetVarSkew(const SkewVectorType & skew)
00153   {
00154     m_Skew = skew;
00155   }
00156 
00158   void ComputeMatrix(void);
00159 
00160   void ComputeMatrixParameters(void);
00161 
00162 private:
00163   ScaleSkewVersor3DTransform(const Self &); // purposely not implemented
00164   void operator=(const Self &);             // purposely not implemented
00165 
00167   ScaleVectorType m_Scale;
00168 
00170   SkewVectorType m_Skew;
00171 }; // class ScaleSkewVersor3DTransform
00172 }  // namespace itk
00173 
00174 // Define instantiation macro for this template.
00175 #define ITK_TEMPLATE_ScaleSkewVersor3DTransform(_, EXPORT, TypeX, TypeY)     \
00176   namespace itk                                                              \
00177   {                                                                          \
00178   _( 1 ( class EXPORT ScaleSkewVersor3DTransform<ITK_TEMPLATE_1 TypeX> ) ) \
00179   namespace Templates                                                        \
00180   {                                                                          \
00181   typedef ScaleSkewVersor3DTransform<ITK_TEMPLATE_1 TypeX>                 \
00182   ScaleSkewVersor3DTransform##TypeY;                                       \
00183   }                                                                          \
00184   }
00185 
00186 #if ITK_TEMPLATE_EXPLICIT
00187 #include "Templates/itkScaleSkewVersor3DTransform+-.h"
00188 #endif
00189 
00190 #if ITK_TEMPLATE_TXX
00191 #include "itkScaleSkewVersor3DTransform.hxx"
00192 #endif
00193 
00194 #endif /* __ScaleSkewVersor3DTransform_h */
00195