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 CLITKAFFINEREGISTRATIONGENERICFILTER_CXX
20 #define CLITKAFFINEREGISTRATIONGENERICFILTER_CXX
22 #include "clitkAffineRegistrationGenericFilter.h"
27 //====================================================================
29 AffineRegistrationGenericFilter::AffineRegistrationGenericFilter()
34 //====================================================================
36 void AffineRegistrationGenericFilter::Update()
38 //Read the PixelType and dimension of the reference image
40 std::string PixelType;
41 clitk::ReadImageDimensionAndPixelType(m_ArgsInfo.reference_arg, Dimension, PixelType);
42 if (Dimension == 2) UpdateWithDim<2>(PixelType);
43 else if (Dimension == 3) UpdateWithDim<3>(PixelType);
45 itkExceptionMacro(<< "Reference Image dimension is " << Dimension
46 << " but I can only work on 2D and 3D images.");
50 //void AffineRegistrationGenericFilter::SetTransfo( itk::MultiResolutionImageRegistrationMethod<itk::Image<float,2>,itk::Image<float,2> >::Pointer & registration )
52 // typedef itk::Euler2DTransform < double > Transform2DType;
53 // Transform2DType::Pointer t2 =Transform2DType::New();
55 // //Initializing the transform
56 // Transform2DType::OutputVectorType translation;
57 // translation[0] = m_ArgsInfo.transX_arg;
58 // translation[1] = m_ArgsInfo.transY_arg;
59 // t2->SetTranslation(translation);
60 // t2->SetRotation(m_ArgsInfo.rotX_arg);
62 // //For simplicity we set the center to the top left corner
63 // Transform2DType::InputPointType center;
66 // t2->SetCenter(center);
67 // registration->SetTransform(t2);
68 // registration->SetInitialTransformParameters(t2->GetParameters());
71 //void clitk::AffineRegistrationGenericFilter::SetTransfo( itk::MultiResolutionImageRegistrationMethod<itk::Image<float,3>,itk::Image<float,3> >::Pointer & registration )
73 // typedef itk::Euler3DTransform < double > Transform3DType;
74 // Transform3DType::Pointer t3 = Transform3DType::New();
76 // t3->SetComputeZYX(true);
77 // //Initializing the transform
78 // Transform3DType::OutputVectorType translation;
79 // translation[0] = m_ArgsInfo.transX_arg;
80 // translation[1] = m_ArgsInfo.transY_arg;
81 // translation[2] = m_ArgsInfo.transZ_arg;
82 // t3->SetTranslation(translation);
83 // t3->SetRotation(m_ArgsInfo.rotX_arg, m_ArgsInfo.rotY_arg, m_ArgsInfo.rotZ_arg);
85 // //For simplicity we set the center to the top left corner
86 // Transform3DType::InputPointType center;
90 // t3->SetCenter(center);
91 // registration->SetTransform(t3);
92 // registration->SetInitialTransformParameters( t3->GetParameters());
96 //====================================================================
98 #endif //#define CLITKAFFINEREGISTRATIONCGENERICFILTER_CXX