35 #include <ctkPluginContext.h>
57 this->createInterconnectedDataAndSpace();
73 void PatientModelImplService::createInterconnectedDataAndSpace()
87 mDataService->setDataFactory(mDataFactory);
91 mPatientData.reset(
new PatientData(mDataService, session));
94 void PatientModelImplService::shutdownInterconnectedDataAndSpace()
102 mDataService->clear();
105 mDataFactory.reset();
108 mDataService.reset();
127 this->shutdownInterconnectedDataAndSpace();
132 QString outputBasePath = this->patientData()->getActivePatientFolder();
134 this->dataService()->loadData(data);
135 data->save(outputBasePath);
140 return dataService()->getDataFactory()->create(type, uid, name);
145 return dataService()->getData();
150 std::map<QString, DataPtr> dataMap = this->
getData();
151 std::map<QString, DataPtr>::const_iterator iter = dataMap.find(uid);
152 if (iter == dataMap.end())
159 return dataService()->getPatientLandmarks();
164 return dataService()->getLandmarkProperties();
169 dataService()->setLandmarkName(uid, name);
174 return dataService()->get_rMpr();
179 this->patientData()->autoSave();
189 return dataService()->getActiveImage();
194 dataService()->setActiveImage(activeImage);
199 return dataService()->getClinicalApplication();
204 dataService()->setClinicalApplication(application);
209 dataService()->loadData(data);
214 return dataService()->getStreams();
219 return this->patientData()->getActivePatientFolder();
224 return this->patientData()->isPatientValid();
229 return this->patientData()->importData(fileName, infoText);
234 this->patientData()->exportPatient(niftiFormat);
239 this->patientData()->removeData(uid);
244 return dataService()->getPresetTransferFunctions3D();
249 this->dataService()->setCenter(center);
254 return this->dataService()->getCenter();
260 return dataService()->addLandmark();
265 dataService()->setLandmarkActive(uid, active);
270 return this->dataService()->get_rMpr_History();
284 void PatientModelImplService::newProbe(
const ToolPtr tool)
289 reportWarning(
"PatientModelImplService::newProbe: Tool is not a probe");
293 mProbeTools[tool->getUid()] = tool;
298 void PatientModelImplService::videoSourceAdded(
VideoSourcePtr source)
301 ToolPtr tool = this->getProbeTool(source->getUid());
305 QString uid = source->getUid() + tool->getUid();
306 QString name = source->getName() +
" - " + tool->getName();
307 TrackedStreamPtr trackedStream = this->dataService()->getTrackedStream(uid);
309 trackedStream = this->createSpecificData<TrackedStream>(uid, name);
310 trackedStream->setProbeTool(tool);
311 trackedStream->setVideoSource(source);
312 trackedStream->setSpaceProvider(mDataService->getSpaceProvider());
315 this->dataService()->loadData(trackedStream);
319 ToolPtr PatientModelImplService::getProbeTool(QString videoSourceUid)
321 for (std::map<QString, ToolPtr>::const_iterator iter = mProbeTools.begin(); iter != mProbeTools.end(); ++iter)
325 if(probe && probe->getAvailableVideoSources().contains(videoSourceUid))
void newProbe(const ToolPtr probe)
boost::shared_ptr< class SpaceProvider > SpaceProviderPtr
void rMprChanged()
emitted when the transformation between patient reference and (data) reference is set ...
virtual void setCenter(const Vector3D ¢er)
void activeImageChanged(const QString &uId)
boost::shared_ptr< class RegistrationHistory > RegistrationHistoryPtr
virtual PresetTransferFunctions3DPtr getPresetTransferFunctions3D() const
void dataAddedOrRemoved()
virtual bool isPatientValid() const
void landmarkPropertiesChanged()
emitted when global info about a landmark changed
boost::shared_ptr< class TrackedStream > TrackedStreamPtr
virtual Transform3D get_rMpr() const
get the patient registration transform
Transform3D Transform3D
Transform3D is a representation of an affine 3D transform.
virtual DataPtr importData(QString fileName, QString &infoText)
boost::shared_ptr< class TransferFunctions3DPresets > PresetTransferFunctions3DPtr
boost::shared_ptr< class Image > ImagePtr
virtual DataPtr createData(QString type, QString uid, QString name)
boost::shared_ptr< class DataManagerImpl > DataManagerImplPtr
Functionality for storing patient data in a folder on the disk and access to these data...
static SessionStorageServicePtr create(ctkPluginContext *pluginContext)
static DataManagerImplPtr create()
void landmarkPropertiesChanged()
emitted when global info about a landmark changed
void centerChanged()
emitted when center is changed.
void centerChanged()
emitted when center is changed.
boost::shared_ptr< class Landmarks > LandmarksPtr
virtual void insertData(DataPtr data)
static TrackingServicePtr create(ctkPluginContext *pluginContext)
boost::shared_ptr< Probe > ProbePtr
static PatientModelServicePtr create(ctkPluginContext *pluginContext)
boost::shared_ptr< class Data > DataPtr
void videoSourceAdded(VideoSourcePtr source)
virtual void exportPatient(bool niftiFormat)
virtual void removeData(QString uid)
virtual void setActiveImage(ImagePtr activeImage)
used for system state
void reportWarning(QString msg)
void dataAddedOrRemoved()
boost::shared_ptr< class PatientModelService > PatientModelServicePtr
boost::shared_ptr< class VideoSource > VideoSourcePtr
virtual QString addLandmark()
void clinicalApplicationChanged()
virtual Vector3D getCenter() const
current common center point for user viewing.
virtual QString getActivePatientFolder() const
virtual void loadData(DataPtr data)
virtual LandmarksPtr getPatientLandmarks() const
landmark defined in patient space
cxLogicManager_EXPORT SpaceProviderPtr spaceProvider()
Eigen::Vector3d Vector3D
Vector3D is a representation of a point or vector in 3D.
virtual CLINICAL_VIEW getClinicalApplication() const
virtual void setLandmarkActive(QString uid, bool active)
virtual std::map< QString, VideoSourcePtr > getStreams() const
void activeImageChanged(const QString &uId)
emitted when the active image is changed
boost::shared_ptr< PatientData > PatientDataPtr
virtual ImagePtr getActiveImage() const
used for system state
virtual ~PatientModelImplService()
PatientModelImplService(ctkPluginContext *context)
virtual RegistrationHistoryPtr get_rMpr_History() const
boost::shared_ptr< class DataFactory > DataFactoryPtr
virtual std::map< QString, DataPtr > getData() const
virtual std::map< QString, LandmarkProperty > getLandmarkProperties() const
virtual void setLandmarkName(QString uid, QString name)
void requireUnique(int use_count, QString objectName)
void clinicalApplicationChanged()
virtual void setClinicalApplication(CLINICAL_VIEW application)
boost::shared_ptr< class SessionStorageService > SessionStorageServicePtr
boost::shared_ptr< class Tool > ToolPtr