void LandmarkRegistrationWidget::cellClickedSlot(int row, int column) { if (row < 0 || column < 0) return; if (!mLandmarkTableWidget) reportDebug("mLandmarkTableWidget is null"); mActiveLandmark = mLandmarkTableWidget->item(row, column)->data(Qt::UserRole).toString(); LandmarkMap targetData = this->getTargetLandmarks(); if (targetData.count(mActiveLandmark)) { Vector3D p_d = targetData[mActiveLandmark].getCoord(); Vector3D p_r = this->getTargetTransform().coord(p_d); Vector3D p_pr = mServices->patient()->get_rMpr().coord(p_r); this->setManualToolPosition(p_r); } }
cx::CompositeTimedAlgorithmPtr ReconstructionExecuter::assembleReconstructionPipeline(std::vector<ReconstructCorePtr> cores, ReconstructCore::InputParams par, USReconstructInputData fileData) { cx::CompositeSerialTimedAlgorithmPtr pipeline(new cx::CompositeSerialTimedAlgorithm("US Reconstruction")); ReconstructPreprocessorPtr preprocessor = this->createPreprocessor(par, fileData); pipeline->append(ThreadedTimedReconstructPreprocessor::create(mPatientModelService, preprocessor, cores)); cx::CompositeTimedAlgorithmPtr temp = pipeline; if(this->canCoresRunInParallel(cores) && cores.size()>1) { cx::CompositeParallelTimedAlgorithmPtr parallel(new cx::CompositeParallelTimedAlgorithm()); pipeline->append(parallel); temp = parallel; reportDebug("Running reconstruction cores in parallel."); } for (unsigned i=0; i<cores.size(); ++i) temp->append(ThreadedTimedReconstructCore::create(mPatientModelService, mViewService, cores[i])); return pipeline; }
void TrackingSystemIGSTKService::trackerConfiguredSlot(bool on) { if (!on) { this->deconfigure(); return; } if (!mTrackerThread) { reportDebug("Received a configured signal in ToolManager, but we don't have a mTrackerThread, this should never happen, contact programmer."); return; } //new all tools mTools.clear(); std::map<QString, IgstkToolPtr> igstkTools = mTrackerThread->getTools(); IgstkToolPtr reference = mTrackerThread->getRefereceTool(); std::map<QString, IgstkToolPtr>::iterator it = igstkTools.begin(); for (; it != igstkTools.end(); ++it) { IgstkToolPtr igstkTool = it->second; cxToolPtr tool(new ToolUsingIGSTK(igstkTool)); if (tool->isValid()) { mTools.push_back(tool); if (tool->getProbe()) emit newProbe(tool); } else reportWarning("Creation of the cxTool " + it->second->getUid() + " failed."); } mState = Tool::tsCONFIGURED; reportSuccess("IGSTK Tracking Service Configured."); emit configured(); emit stateChanged(); }
void PickerRep::addRepActorsToViewRenderer(ViewPtr view) { if (view == NULL) { reportDebug("Cannot add rep actor to a NULL view."); return; } this->connectInteractor(); mGraphicalPoint.reset(new GraphicalPoint3D(this->getRenderer())); mGraphicalPoint->setColor(QColor(Qt::blue)); mGraphicalPoint->setRadius(mSphereRadius); mGraphicalPoint->getActor()->SetVisibility(mSnapToSurface); // show even if disabled if (mGlyphRep) { this->getView()->addRep(mGlyphRep); } mViewportListener->startListen(this->getRenderer()); this->scaleSphere(); }