1 /*=========================================================================
2 Program: vv http://www.creatis.insa-lyon.fr/rio/vv
5 - University of LYON http://www.universite-lyon.fr/
6 - Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr
7 - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
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.
13 It is distributed under dual licence
15 - BSD See included LICENSE.txt file
16 - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
17 ======================================================================-====*/
19 #ifndef __clitkGenericAffineTransform_h
20 #define __clitkGenericAffineTransform_h
24 #include <itkIdentityTransform.h>
25 #include <itkTranslationTransform.h>
26 #include <itkAffineTransform.h>
30 Requires at least the following section is the .ggo file
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
39 The use will look something like
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();
50 template <class args_info_type, class TCoordRep, unsigned int Dimension>
51 class GenericAffineTransform : public itk::LightObject
54 //==============================================
55 typedef GenericAffineTransform Self;
56 typedef itk::LightObject Superclass;
57 typedef itk::SmartPointer<Self> Pointer;
58 typedef itk::SmartPointer<const Self> ConstPointer;
60 typedef itk::Transform< TCoordRep, Dimension, Dimension> TransformType;
61 typedef typename TransformType::Pointer TransformPointer;
63 /** Method for creation through the object factory. */
66 //==============================================
68 void SetArgsInfo(args_info_type args_info) {
69 m_ArgsInfo = args_info;
70 m_Verbose = m_ArgsInfo.verbose_flag;
73 //==============================================
75 TransformPointer GetTransform(void);
77 //==============================================
79 GenericAffineTransform();
80 ~GenericAffineTransform() {};
82 typename itk::MatrixOffsetTransformBase<TCoordRep, Dimension, Dimension>::Pointer GetNewEulerTransform();
85 args_info_type m_ArgsInfo;
86 TransformPointer m_Transform;
91 #ifndef ITK_MANUAL_INSTANTIATION
92 #include "clitkGenericAffineTransform.txx"
95 #endif // #define __clitkGenericAffineTransform_h