X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?p=creaRigidRegistration.git;a=blobdiff_plain;f=PackRecalage%2Fsrc%2FbbPackRecalageTransform3D3PointsBox.cxx;fp=PackRecalage%2Fsrc%2FbbPackRecalageTransform3D3PointsBox.cxx;h=219da2bc1218f1697bca4b91492cba2c95b1272b;hp=d5c2467a95e56f4668c0e843d0f11a428f709c9a;hb=7051738fb1c92724bd6d15907edc4d517527a3b2;hpb=877893bd98980a3d730fd9a65f8c65a21f56c14a diff --git a/PackRecalage/src/bbPackRecalageTransform3D3PointsBox.cxx b/PackRecalage/src/bbPackRecalageTransform3D3PointsBox.cxx index d5c2467..219da2b 100644 --- a/PackRecalage/src/bbPackRecalageTransform3D3PointsBox.cxx +++ b/PackRecalage/src/bbPackRecalageTransform3D3PointsBox.cxx @@ -186,18 +186,18 @@ void Transform3D3PointsBox::Process() //Calculates the new position of the points after the first transformation double A2N[3]; A2N[0] = A2[0]*newMatrix[0][0] + A2[0]*newMatrix[0][1] + A2[0]*newMatrix[0][2]; - A2N[1] = A2[1]*newMatrix[1][0] + A2[0]*newMatrix[1][1] + A2[0]*newMatrix[1][2]; - A2N[2] = A2[2]*newMatrix[2][0] + A2[0]*newMatrix[2][1] + A2[0]*newMatrix[2][2]; + A2N[1] = A2[1]*newMatrix[1][0] + A2[1]*newMatrix[1][1] + A2[1]*newMatrix[1][2]; + A2N[2] = A2[2]*newMatrix[2][0] + A2[2]*newMatrix[2][1] + A2[2]*newMatrix[2][2]; double B2N[3]; B2N[0] = B2[0]*newMatrix[0][0] + B2[0]*newMatrix[0][1] + B2[0]*newMatrix[0][2]; - B2N[1] = B2[1]*newMatrix[1][0] + B2[0]*newMatrix[1][1] + B2[0]*newMatrix[1][2]; - B2N[2] = B2[2]*newMatrix[2][0] + B2[0]*newMatrix[2][1] + B2[0]*newMatrix[2][2]; + B2N[1] = B2[1]*newMatrix[1][0] + B2[1]*newMatrix[1][1] + B2[1]*newMatrix[1][2]; + B2N[2] = B2[2]*newMatrix[2][0] + B2[2]*newMatrix[2][1] + B2[2]*newMatrix[2][2]; double O2N[3]; O2N[0] = O2[0]*newMatrix[0][0] + O2[0]*newMatrix[0][1] + O2[0]*newMatrix[0][2]; - O2N[1] = O2[1]*newMatrix[1][0] + O2[0]*newMatrix[1][1] + O2[0]*newMatrix[1][2]; - O2N[2] = O2[2]*newMatrix[2][0] + O2[0]*newMatrix[2][1] + O2[0]*newMatrix[2][2]; + O2N[1] = O2[1]*newMatrix[1][0] + O2[1]*newMatrix[1][1] + O2[1]*newMatrix[1][2]; + O2N[2] = O2[2]*newMatrix[2][0] + O2[2]*newMatrix[2][1] + O2[2]*newMatrix[2][2]; /////////////////////////////////////////////////////////////////////////////// //Creation of the two planes for the second transformation @@ -235,6 +235,22 @@ void Transform3D3PointsBox::Process() transformer->SetSecondAngle(-anglePlanes); + + double * vector2B; + vector2B = planes->makeVector(O2, B2); + double mag1= planes->getMagnitud(vector1B); + double mag2= planes->getMagnitud(vector2B); + transformer->SetScale(mag1/mag2); + + +/* + double * vector2B; + vector2B = planes->makeVector(O2, B2); + double mag1= planes->getMagnitud(vector1); + double mag2= planes->getMagnitud(vector2); + transformer->SetScale(mag2/mag1); +*/ + // The calculation of the transformations are made transformer->Run();