]> Creatis software - clitk.git/blob - registration/clitkGenericAffineTransform.h
Debug RTStruct conversion with empty struc
[clitk.git] / registration / clitkGenericAffineTransform.h
1 /*=========================================================================
2   Program:   vv                     http://www.creatis.insa-lyon.fr/rio/vv
3
4   Authors belong to:
5   - University of LYON              http://www.universite-lyon.fr/
6   - Léon Bérard cancer center       http://www.centreleonberard.fr
7   - CREATIS CNRS laboratory         http://www.creatis.insa-lyon.fr
8
9   This software is distributed WITHOUT ANY WARRANTY; without even
10   the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11   PURPOSE.  See the copyright notices for more information.
12
13   It is distributed under dual licence
14
15   - BSD        See included LICENSE.txt file
16   - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
17 ===========================================================================**/
18
19 #ifndef __clitkGenericAffineTransform_h
20 #define __clitkGenericAffineTransform_h
21
22
23 //itk include
24 #include <itkIdentityTransform.h>
25 #include <itkTranslationTransform.h>
26 #include <itkAffineTransform.h>
27
28 /*
29
30 Requires at least the following section is the .ggo file
31
32 option "transform"  - "Type: 0=Identity, 1=Translation, 2=Rigid, 3=Affine" int no  default="2"
33 option "transX"     x "1-3: Initial translation in mm along the X axis"  float no  default="0.0"
34 option "transY"     y "1-3: Initial translation in mm along the Y axis"  float no  default="0.0"
35 option "transZ"     z "1-3: Initial translation in mm along the Z axis"  float no  default="0.0"
36 option "initMatrix" - "1-3: Initial matrix (reference to object space) filename " string  no
37 option "moment"     - "1-3: Initialize translation by aligning the center of gravities for the respective intensities" flag off
38
39 The use will look something like
40
41   typedef clitk::GenericAffineTransform<args_info_clitkAffineRegistration, TCoordRep, Dimension > GenericAffineTransformType;
42   typename GenericAffineTransformType::Pointer genericAffineTransform = GenericAffineTransformType::New();
43   genericAffineTransform->SetArgsInfo(m_ArgsInfo);
44   typedef itk::Transform< double, Dimension, Dimension > TransformType;
45   typename TransformType::Pointer transform = genericAffineTransform->GetTransform();
46 */
47
48 namespace clitk
49 {
50 template <class args_info_type, class TCoordRep, unsigned int Dimension>
51 class GenericAffineTransform : public itk::LightObject
52 {
53 public:
54   //==============================================
55   typedef GenericAffineTransform     Self;
56   typedef itk::LightObject     Superclass;
57   typedef itk::SmartPointer<Self>            Pointer;
58   typedef itk::SmartPointer<const Self>      ConstPointer;
59
60   typedef itk::Transform< TCoordRep, Dimension, Dimension> TransformType;
61   typedef typename TransformType::Pointer TransformPointer;
62
63   /** Method for creation through the object factory. */
64   itkNewMacro(Self);
65
66   //==============================================
67   //Set members
68   void SetArgsInfo(args_info_type args_info) {
69     m_ArgsInfo = args_info;
70     m_Verbose = m_ArgsInfo.verbose_flag;
71   }
72
73   //==============================================
74   //Get members
75   TransformPointer GetTransform(void);
76
77   //==============================================
78 protected:
79   GenericAffineTransform();
80   ~GenericAffineTransform() {};
81
82   typename itk::MatrixOffsetTransformBase<TCoordRep, Dimension, Dimension>::Pointer GetNewEulerTransform();
83
84 private:
85   args_info_type m_ArgsInfo;
86   TransformPointer m_Transform;
87   bool m_Verbose;
88 };
89 }
90
91 #ifndef ITK_MANUAL_INSTANTIATION
92 #include "clitkGenericAffineTransform.txx"
93 #endif
94
95 #endif // #define __clitkGenericAffineTransform_h