PatientModelServicePtr PatientModelService::getNullObject()
{
	static PatientModelServicePtr mNull;
	if (!mNull)
		mNull.reset(new PatientModelServiceNull);
	return mNull;
}
示例#2
0
void loadMeshFromToolTransforms(PatientModelServicePtr dataManager, TimedTransformMap transforms_prMt)
{
  //create polydata from positions
	Transform3D rMpr = dataManager->get_rMpr();
  vtkPolyDataPtr centerlinePolydata = polydataFromTransforms(transforms_prMt, rMpr);
  QString uid = "tool_positions_mesh_%1";
  QString name = "Tool positions mesh %1";
  MeshPtr mesh = dataManager->createSpecificData<Mesh>(uid, name);
  mesh->setVtkPolyData(centerlinePolydata);
  mesh->setColor(QColor("red"));
  dataManager->insertData(mesh);
}
示例#3
0
ColorWidget::ColorWidget(PatientModelServicePtr patientModelService, QWidget* parent) :
		BaseWidget(parent, "ColorWidget", "Color")
{
	this->setToolTip("Set 2D image properties");
	QVBoxLayout* layout = new QVBoxLayout(this);
	layout->setMargin(0);
	layout->addWidget(new TransferFunction2DColorWidget(patientModelService->getActiveData(), this), 0);
	layout->addStretch(1);
	layout->addWidget(new TransferFunctionPresetWidget(patientModelService, this, false), 0);
}
VolumeInfoWidget::VolumeInfoWidget(PatientModelServicePtr patientModelService, QWidget* parent) :
  InfoWidget(parent, "volume_info_widget", "Volume Info"),
  mPatientModelService(patientModelService),
  mActiveData(patientModelService->getActiveData())
{
	this->setToolTip("Display volume info");
	mActiveImageProxy = ActiveImageProxy::New(mActiveData);
	connect(mActiveImageProxy.get(), &ActiveImageProxy::activeImageChanged, this, &VolumeInfoWidget::updateSlot);

	this->addWidgets();

	this->updateSlot();
}
TransferFunctionWidget::TransferFunctionWidget(PatientModelServicePtr patientModelService, QWidget* parent, bool connectToActiveImage) :
  BaseWidget(parent, "TransferFunctionWidget", "Transfer Function")
{
	this->setToolTip("Set a new or predefined transfer function on a volume");
  QVBoxLayout* mLayout = new QVBoxLayout(this);

  TransferFunction3DWidget* transferFunctionWidget = new TransferFunction3DWidget(patientModelService->getActiveData(), this, connectToActiveImage);

  mLayout->setMargin(0);
  mLayout->addWidget(transferFunctionWidget);
  mLayout->addWidget(new TransferFunctionPresetWidget(patientModelService, this, true));

  this->setLayout(mLayout);
}
UsReconstructionImplService::UsReconstructionImplService(ctkPluginContext *pluginContext, PatientModelServicePtr patientModelService, ViewServicePtr viewService, XmlOptionFile settings) :
	mPatientModelService(patientModelService),
	mViewService(viewService)
{
	mSettings = settings;
	mSettings.getElement("algorithms");

	mParams.reset(new ReconstructParams(patientModelService, settings));
	connect(mParams.get(), SIGNAL(changedInputSettings()), this, SLOT(setSettings()));
	connect(patientModelService.get(), &PatientModelService::patientChanged, this, &UsReconstructionImplService::patientChangedSlot);

	mServiceListener = boost::shared_ptr<ServiceTrackerListener<ReconstructionMethodService> >(new ServiceTrackerListener<ReconstructionMethodService>(
			pluginContext,
			boost::bind(&UsReconstructionImplService::onServiceAdded, this, _1),
			boost::bind(&UsReconstructionImplService::onServiceModified, this, _1),
			boost::bind(&UsReconstructionImplService::onServiceRemoved, this, _1)
	));

	mServiceListener->open();
}