35 #include <ctkPluginContext.h>
36 #include <vtkImageData.h>
58 this->createInterconnectedDataAndSpace();
74 void PatientModelImplService::createInterconnectedDataAndSpace()
88 mDataService->setDataFactory(mDataFactory);
92 mPatientData.reset(
new PatientData(mDataService, session));
95 void PatientModelImplService::shutdownInterconnectedDataAndSpace()
103 mDataService->clear();
106 mDataFactory.reset();
109 mDataService.reset();
128 this->shutdownInterconnectedDataAndSpace();
133 QString outputBasePath = this->patientData()->getActivePatientFolder();
135 this->dataService()->loadData(data);
136 data->save(outputBasePath);
141 return dataService()->getDataFactory()->create(type, uid, name);
146 return dataService()->getData();
151 std::map<QString, DataPtr> dataMap = this->
getData();
152 std::map<QString, DataPtr>::const_iterator iter = dataMap.find(uid);
153 if (iter == dataMap.end())
160 return dataService()->getPatientLandmarks();
165 return dataService()->getLandmarkProperties();
170 dataService()->setLandmarkName(uid, name);
175 return dataService()->get_rMpr();
180 this->patientData()->autoSave();
190 return dataService()->getActiveImage();
195 dataService()->setActiveImage(activeImage);
200 return dataService()->getClinicalApplication();
205 dataService()->setClinicalApplication(application);
210 dataService()->loadData(data);
215 return dataService()->getStreams();
220 return this->patientData()->getActivePatientFolder();
225 return this->patientData()->isPatientValid();
230 return this->patientData()->importData(fileName, infoText);
235 this->patientData()->exportPatient(niftiFormat);
240 this->patientData()->removeData(uid);
245 return dataService()->getPresetTransferFunctions3D();
250 this->dataService()->setCenter(center);
255 return this->dataService()->getCenter();
261 return dataService()->addLandmark();
266 dataService()->setLandmarkActive(uid, active);
271 return this->dataService()->get_rMpr_History();
285 void PatientModelImplService::newProbe(
const ToolPtr tool)
290 reportWarning(
"PatientModelImplService::newProbe: Tool is not a probe");
294 mProbeTools[tool->getUid()] = tool;
299 void PatientModelImplService::videoSourceAdded(
VideoSourcePtr source)
302 ToolPtr tool = this->getProbeTool(source->getUid());
307 if (!source || !source->getVtkImageData() || source->getVtkImageData()->GetDataDimension() != 3)
310 QString uid = source->getUid() + tool->getUid();
311 QString name = source->getName() +
" - " + tool->getName();
312 TrackedStreamPtr trackedStream = this->dataService()->getTrackedStream(uid);
314 trackedStream = this->createSpecificData<TrackedStream>(uid, name);
315 trackedStream->setProbeTool(tool);
316 trackedStream->setVideoSource(source);
317 trackedStream->setSpaceProvider(mDataService->getSpaceProvider());
320 this->dataService()->loadData(trackedStream);
324 ToolPtr PatientModelImplService::getProbeTool(QString videoSourceUid)
326 for (std::map<QString, ToolPtr>::const_iterator iter = mProbeTools.begin(); iter != mProbeTools.end(); ++iter)
330 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