--- /dev/null
+/*=========================================================================
+ Program: vv http://www.creatis.insa-lyon.fr/rio/vv
+
+ Authors belong to:
+ - University of LYON http://www.universite-lyon.fr/
+ - Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr
+ - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
+
+ This software is distributed WITHOUT ANY WARRANTY; without even
+ the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ PURPOSE. See the copyright notices for more information.
+
+ It is distributed under dual licence
+
+ - BSD See included LICENSE.txt file
+ - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+======================================================================-====*/
+
+#include "clitkTransformUtilities.h"
+
+namespace clitk
+{
+
+//--------------------------------------------------------------------
+template < >
+itk::Matrix<double, 3, 3>
+GetBackwardAffineMatrix<2>(itk::Array<double> transformParameters)
+{
+ return GetBackwardAffineMatrix2D(transformParameters);
+}
+
+//--------------------------------------------------------------------
+template < >
+itk::Matrix<double, 4, 4>
+GetBackwardAffineMatrix<3>(itk::Array<double> transformParameters)
+{
+ return GetBackwardAffineMatrix3D(transformParameters);
+}
+
+}
- BSD See included LICENSE.txt file
- CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
======================================================================-====*/
+
#ifndef CLITKTRANSFORMUTILITIES_H
#define CLITKTRANSFORMUTILITIES_H
#include "itkMatrix.h"
//Declarations
//============================================================================
itk::Matrix<double, 3, 3> GetForwardAffineMatrix2D(itk::Array<double> transformParameters);
- itk::Matrix<double, 3, 3> GetBackwardAffineMatrix2D(itk::Array<double> transformParameters);
itk::Matrix<double, 4, 4> GetForwardAffineMatrix3D(itk::Array<double> transformParameters);
+
+ itk::Matrix<double, 3, 3> GetBackwardAffineMatrix2D(itk::Array<double> transformParameters);
itk::Matrix<double, 4, 4> GetBackwardAffineMatrix3D(itk::Array<double> transformParameters);
+ template <unsigned int Dimension > itk::Matrix<double, Dimension+1, Dimension+1> GetBackwardAffineMatrix(itk::Array<double> transformParameters);
+
itk::Matrix<double, 3, 3> GetRotationMatrix3D(itk::Array<double> rotationParameters);
itk::Point<double, 3> GetRotatedPoint3D(itk::Array<double> rotationParameters, itk::Point<double, 3> input);
itk::Matrix<double, 4, 4> GetCenteredRotationMatrix3D(itk::Array<double> rotationParameters,itk::Point<double,3> centerOfRotation);
return matrix;
}
- inline itk::Matrix<double, 3, 3> GetBackwardAffineMatrix2D(itk::Array<double> transformParameters)
- {
- itk::Matrix<double, 3, 3> matrix;
- //rotation part
- matrix[0][0]=cos(transformParameters[0]);
- matrix[0][1]=sin(transformParameters[0]);
- matrix[1][0]=-sin(transformParameters[0]);
- matrix[1][1]=cos(transformParameters[0]);
- //translation part
- matrix[0][2]=transformParameters[1];
- matrix[1][2]=transformParameters[2];
- //homogenize
- matrix[2][0]=0.;
- matrix[2][1]=0.;
- matrix[2][2]=1.;
- return matrix;
- }
-
-
inline itk::Matrix<double, 4, 4> GetForwardAffineMatrix3D(itk::Array<double> transformParameters)
{
itk::Matrix<double, 4, 4> matrix;
}
+ inline itk::Matrix<double, 3, 3> GetBackwardAffineMatrix2D(itk::Array<double> transformParameters)
+ {
+ itk::Matrix<double, 3, 3> matrix;
+ //rotation part
+ matrix[0][0]=cos(transformParameters[0]);
+ matrix[0][1]=sin(transformParameters[0]);
+ matrix[1][0]=-sin(transformParameters[0]);
+ matrix[1][1]=cos(transformParameters[0]);
+ //translation part
+ matrix[0][2]=transformParameters[1];
+ matrix[1][2]=transformParameters[2];
+ //homogenize
+ matrix[2][0]=0.;
+ matrix[2][1]=0.;
+ matrix[2][2]=1.;
+ return matrix;
+ }
+
+
inline itk::Matrix<double, 4, 4> GetBackwardAffineMatrix3D(itk::Array<double> transformParameters)
{
itk::Matrix<double, 4, 4> matrix;
return matrix;
}
+ template <unsigned int Dimension >
+ inline itk::Matrix<double, Dimension+1, Dimension+1>
+ GetBackwardAffineMatrix(itk::Array<double> transformParameters)
+ {
+ }
+
inline itk::Matrix<double, 3, 3> GetRotationMatrix3D(itk::Array<double> rotationParameters)
{
itk::Matrix<double, 3, 3> matrix;