void Xform3D::getShiftVector(double* s) { double ss[3] = {0}; Xform3D_ShiftGet(this->m_handle, ss); for(int i=0; i<3; i++) s[i] = ss[i]; }
std::vector<double> mitk::ClaronInterface::GetTipPosition(mitk::claronToolHandle c) { std::vector<double> returnValue; double Position[3]; mtHandle t2m = Xform3D_New(); // tooltip to marker xform handle mtHandle t2c = Xform3D_New(); // tooltip to camera xform handle mtHandle m2c = Xform3D_New(); // marker to camera xform handle //Get m2c MTC( Marker_Marker2CameraXfGet (c, CurrCamera, m2c, &IdentifyingCamera) ); //Get t2m MTC( Marker_Tooltip2MarkerXfGet (c, t2m )); //Transform both to t2c MTC(Xform3D_Concatenate(t2m,m2c,t2c)); //Get position MTC( Xform3D_ShiftGet(t2c, Position) ); // Here we have to negate the X- and Y-coordinates because of a bug of the // MTC-library. returnValue.push_back(-Position[0]); returnValue.push_back(-Position[1]); returnValue.push_back(Position[2]); return returnValue; }
std::vector<double> mitk::ClaronInterface::GetPosition(claronToolHandle c) { std::vector<double> returnValue; double Position[3]; MTC( Marker_Marker2CameraXfGet (c, CurrCamera, PoseXf, &IdentifyingCamera) ); MTC( Xform3D_ShiftGet(PoseXf, Position) ); // Here we have to negate the X- and Y-coordinates because of a bug of the // MTC-library. returnValue.push_back(-Position[0]); returnValue.push_back(-Position[1]); returnValue.push_back(Position[2]); return returnValue; }
double Xform3D::getShift(int index) { double s[3] = {0}; Xform3D_ShiftGet(this->m_handle, s ); return s[index]; }