X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=sidebyside;f=common%2FclitkTransformUtilities.h;h=b9a540a672a23602a33a8b919ed208eba4156823;hb=9758b89e72c312fa4b6f0ee23482b587ec517666;hp=a6fdd8c6a33f2670d9d665896d458f9cb1c7462c;hpb=765020625fbc092d283e221e36c83e60a1844cb7;p=clitk.git diff --git a/common/clitkTransformUtilities.h b/common/clitkTransformUtilities.h index a6fdd8c..b9a540a 100644 --- a/common/clitkTransformUtilities.h +++ b/common/clitkTransformUtilities.h @@ -38,6 +38,8 @@ namespace clitk template itk::Matrix GetBackwardAffineMatrix(itk::Array transformParameters); itk::Matrix GetRotationMatrix3D(itk::Array rotationParameters); + itk::Matrix GetRotationMatrix2D(itk::Array rotationParameters); + template itk::Matrix GetRotationMatrix(itk::Array rotationParameters); itk::Point GetRotatedPoint3D(itk::Array rotationParameters, itk::Point input); itk::Matrix GetCenteredRotationMatrix3D(itk::Array rotationParameters,itk::Point centerOfRotation); // itk::Matrix GetComposedMatrix3D(itk::Matrix firstTransform, itk::Matrix secondTransform); @@ -166,9 +168,17 @@ namespace clitk matrix[2][2]= cos(rotationParameters[0])*cos(rotationParameters[1]); return matrix; } - - - + + inline itk::Matrix GetRotationMatrix2D(itk::Array rotationParameters) + { + itk::Matrix matrix; + matrix[0][0] = cos(rotationParameters[0]); + matrix[1][0] = sin(rotationParameters[0]); + matrix[0][1] = -matrix[1][0]; + matrix[1][1] = matrix[0][0]; + return matrix; + } + //======================================================================================== inline itk::Point GetRotatedPoint3D(itk::Array rotationParameters, itk::Point input) {