Transform3D TrackedStream::get_tMu() { //Made tMu by copying and modifying code from ProbeSector::get_tMu() ProbeDefinition probeDefinition = mProbeTool->getProbe()->getProbeData(); Vector3D origin_p = probeDefinition.getOrigin_p(); Vector3D spacing = probeDefinition.getSpacing(); Vector3D origin_u(origin_p[0]*spacing[0], origin_p[1]*spacing[1], origin_p[2]*spacing[2]); Transform3D Rx = createTransformRotateX(M_PI / 2.0); Transform3D Ry = createTransformRotateY(-M_PI / 2.0); Transform3D R = (Rx * Ry); Transform3D T = createTransformTranslate(-origin_u); Transform3D tMu = R * T; return tMu; }
ProbeXmlConfigParser::Configuration createConfigurationFromProbeDefinition(ProbeXmlConfigParser::Configuration basis, ProbeDefinition data) { ProbeXmlConfigParser::Configuration config = basis; QSize storedSize(basis.mImageWidth, basis.mImageHeight); if (storedSize!=data.getSize()) { // wrong size: resample data.resample(storedSize); } config.mLeftEdge = data.getClipRect_p()[0]; config.mRightEdge = data.getClipRect_p()[1]; config.mTopEdge = data.getClipRect_p()[2]; config.mBottomEdge = data.getClipRect_p()[3]; config.mOriginCol = data.getOrigin_p()[0]; config.mOriginRow = data.getOrigin_p()[1]; config.mPixelWidth = data.getSpacing()[0]; config.mPixelHeight = data.getSpacing()[1]; config.mImageWidth = data.getSize().width(); config.mImageHeight = data.getSize().height(); if (data.getType()==ProbeDefinition::tSECTOR) { config.mWidthDeg = data.getWidth() / M_PI*180.0; config.mOffset = data.getDepthStart() / data.getSpacing()[1]; config.mDepth = (data.getDepthEnd() - data.getDepthStart()) / data.getSpacing()[1]; } else { // derived values config.mWidthDeg = 0.0; config.mOffset = 0; config.mDepth = 0; } config.mTemporalCalibration = data.getTemporalCalibration(); return config; }