37 #include <vtkRenderWindow.h>
38 #include <vtkRenderer.h>
67 this->setObjectName(
"preferences_visualization_widget");
77 double sphereRadius =
settings()->
value(
"View3D/sphereRadius").toDouble();
80 double labelSize =
settings()->
value(
"View3D/labelSize").toDouble();
86 "Set 3D view background color");
91 "Set color of tool in 2D");
94 "View/toolTipPointColor",
95 "Set color of tool tip");
98 "View/toolOffsetPointColor",
99 "Set color of tool offset point");
102 "View/toolOffsetLineColor",
103 "Set color of tool offset line");
106 "View/toolCrossHairColor",
107 "Set color of tool cross hair");
109 bool showDataText =
settings()->
value(
"View/showDataText").value<
bool>();
111 "Show the name of each data set in the views.",
113 bool showLabels =
settings()->
value(
"View/showLabels").value<
bool>();
115 "Attach name labels to entities in the views.",
118 bool toolCrosshair =
settings()->
value(
"View/toolCrosshair").value<
bool>();
120 "Show a crosshair centered on tool for orthogonal (ACS) views.",
124 bool showMetricNamesInCorner =
settings()->
value(
"View/showMetricNamesInCorner").value<
bool>();
126 "Show the metric data in the upper right corner of the view instead of in the scene.",
127 showMetricNamesInCorner);
130 double annotationModelSize =
settings()->
value(
"View3D/annotationModelSize").toDouble();
132 QStringList annotationModelRange;
135 annotationModelRange << QDir(path+
"/models/").entryList(QStringList()<<
"*.stl");
137 annotationModelRange.prepend(
"<default>");
138 QString annotationModel =
settings()->
value(
"View3D/annotationModel").toString();
142 QGroupBox* stereoGroupBox =
new QGroupBox(
"Stereoscopic visualization");
144 connect(
mStereoTypeComboBox, SIGNAL(currentIndexChanged(
int)),
this, SLOT(stereoTypeChangedSlot(
int)));
146 double eyeAngle =
settings()->
value(
"View3D/eyeAngle").toDouble();
148 "Separation between eyes in degrees",
150 connect(
mEyeAngleAdapter.get(), SIGNAL(valueWasSet()),
this, SLOT(eyeAngleSlot()));
152 double anyplaneViewOffset =
settings()->
value(
"Navigation/anyplaneViewOffset").toDouble();
155 "Position of virtual tool tip in anyplane view, % from top.",
156 anyplaneViewOffset,
DoubleRange(-0.5,0.5,0.05), 2, QDomNode());
159 bool followTooltip =
settings()->
value(
"Navigation/followTooltip").value<
bool>();
161 "ACS Views follow the virtual tool tip",
163 double followTooltipBoundary =
settings()->
value(
"Navigation/followTooltipBoundary").toDouble();
165 "Follow Tool Boundary",
166 "Boundary in ACS Views where follow tool tip is applied. % of view size",
167 followTooltipBoundary,
DoubleRange(0.0,0.5,0.05), 2, QDomNode());
171 QStringList clinicalViews;
172 for (
unsigned i=0; i<mdCOUNT; ++i)
173 clinicalViews << enum2string<CLINICAL_VIEW>(CLINICAL_VIEW(i));
175 "Type of clinical view",
177 clinicalViews, QDomNode());
180 QVBoxLayout* stereoLayout =
new QVBoxLayout();
183 stereoGroupBox->setLayout(stereoLayout);
185 QHBoxLayout* toolcolors =
new QHBoxLayout;
186 toolcolors->addWidget(tool2DColor);
187 toolcolors->addWidget(toolTipPointColor);
188 toolcolors->addWidget(toolOffsetPointColor);
189 toolcolors->addWidget(toolOffsetLineColor);
190 toolcolors->addWidget(toolCrossHairColor);
195 mMainLayout->addWidget(backgroundColorButton, counter++, 0);
210 mMainLayout->addWidget(stereoGroupBox, counter++, 0);
212 QHBoxLayout* toptopLayout =
new QHBoxLayout;
214 toptopLayout->addStretch();
231 stereoInterlacedAction->setData(QVariant(
stINTERLACED));
232 stereoDresdenAction->setData(QVariant(
stDRESDEN));
233 stereoRedBlueAction->setData(QVariant(stRED_BLUE));
235 connect(stereoFrameSequentialAction, SIGNAL(triggered()),
this, SLOT(stereoFrameSequentialSlot()));
236 connect(stereoInterlacedAction, SIGNAL(triggered()),
this, SLOT(stereoInterlacedSlot()));
237 connect(stereoDresdenAction, SIGNAL(triggered()),
this, SLOT(stereoDresdenSlot()));
238 connect(stereoRedBlueAction, SIGNAL(triggered()),
this, SLOT(stereoRedBlueSlot()));
244 mStereoTypeComboBox->insertItem(stRED_BLUE, stereoRedBlueAction->text(), stereoRedBlueAction->data());
247 int stereoType =
settings()->
value(
"View3D/stereoType").toInt();
250 void VisualizationTab::stereoTypeChangedSlot(
int index)
253 if (index<0 || index>=actions.size())
255 actions[index]->trigger();
257 void VisualizationTab::stereoFrameSequentialSlot()
261 void VisualizationTab::stereoInterlacedSlot()
265 void VisualizationTab::stereoDresdenSlot()
269 void VisualizationTab::stereoRedBlueSlot()
274 void VisualizationTab::eyeAngleSlot()
301 this->setObjectName(
"preferences_automation_widget");
315 bool autoStartTracking =
settings()->
value(
"Automation/autoStartTracking").toBool();
319 bool autoStartStreaming =
settings()->
value(
"Automation/autoStartStreaming").toBool();
323 bool autoReconstruct =
settings()->
value(
"Automation/autoReconstruct").toBool();
327 bool autoSelectActiveTool =
settings()->
value(
"Automation/autoSelectActiveTool").toBool();
330 "Automatically select an active tool when a tool becomes visible");
333 bool autoSave =
settings()->
value(
"Automation/autoSave").toBool();
336 "Save patient after major events,\n"
337 "such as workflow step change, registration, reconstruction.");
340 bool autoShow =
settings()->
value(
"Automation/autoShowNewData").toBool();
343 "Show new data in the first view.\n"
344 "Occors after load data and reconstruct.");
347 bool autoLoadPatient =
settings()->
value(
"Automation/autoLoadRecentPatient").toBool();
352 bool autoDeleteDICOMDB =
settings()->
value(
"Automation/autoDeleteDICOMDatabase").toBool();
357 double autoLoadPatientWithinHours =
settings()->
value(
"Automation/autoLoadRecentPatientWithinHours").toDouble();
396 this->setObjectName(
"preferences_video_widget");
407 QVBoxLayout* toplayout =
new QVBoxLayout;
408 QHBoxLayout* acqNameLayout =
new QHBoxLayout;
409 toplayout->addLayout(acqNameLayout);
411 acqNameLayout->addWidget(
new QLabel(
"Name prefix"));
416 bool bw =
settings()->
value(
"Ultrasound/8bitAcquisitionData").toBool();
420 m24bitRadioButton->setToolTip(
"Convert color video to 24 bit color. If the video already is 8 bit grayscale it will not be converted to 24 bit");
427 mCompressCheckBox->setToolTip(
"Store the US Acquisition data as compressed MHD");
429 toplayout->addSpacing(5);
454 this->setObjectName(
"preferences_tool_config_widget");
461 connect(
settings(), SIGNAL(valueChangedFor(QString)),
this, SLOT(globalConfigurationFileChangedSlot(QString)));
463 connect(mToolConfigureGroupBox, SIGNAL(toolSelected(QString)), mFilePreviewWidget, SLOT(previewFileSlot(QString)));
464 connect(mToolFilterGroupBox, SIGNAL(toolSelected(QString)), mFilePreviewWidget, SLOT(previewFileSlot(QString)));
466 connect(mToolConfigureGroupBox, SIGNAL(toolSelected(QString)), mImagePreviewWidget, SLOT(previewFileSlot(QString)));
467 connect(mToolFilterGroupBox, SIGNAL(toolSelected(QString)), mImagePreviewWidget, SLOT(previewFileSlot(QString)));
469 this->applicationChangedSlot();
477 QGroupBox* filepreviewGroupBox =
new QGroupBox(
this);
481 filepreviewGroupBox->setTitle(
"Toolfile preview");
482 QHBoxLayout* filepreviewLayout =
new QHBoxLayout();
483 filepreviewGroupBox->setLayout(filepreviewLayout);
485 filepreviewLayout->addWidget(mFilePreviewWidget);
487 QGroupBox* imagepreviewGroupBox =
new QGroupBox(
this);
488 imagepreviewGroupBox->setTitle(
"Tool image preview");
489 QVBoxLayout* imagepreviewLayout =
new QVBoxLayout();
490 imagepreviewGroupBox->setLayout(imagepreviewLayout);
491 imagepreviewLayout->setMargin(0);
492 imagepreviewLayout->addWidget(mImagePreviewWidget);
495 QGridLayout* layout =
new QGridLayout;
498 layout->addWidget(mToolConfigureGroupBox, 0, 0, 1, 2);
499 layout->addWidget(mToolFilterGroupBox, 0, 2, 1, 2);
500 layout->addWidget(filepreviewGroupBox, 1, 0, 1, 3);
501 layout->addWidget(imagepreviewGroupBox, 1, 3, 1, 1);
512 if(newConfigFile.isEmpty())
516 QFile configFile(newConfigFile);
517 QFileInfo info(configFile);
518 if(!configFile.exists())
525 void ToolConfigTab::applicationChangedSlot()
530 void ToolConfigTab::globalConfigurationFileChangedSlot(QString key)
532 if(key !=
"toolConfigFile")
548 mToolBar->setOrientation(Qt::Vertical);
551 mButtonBox =
new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Apply | QDialogButtonBox::Cancel);
554 this->
addTab(
new GeneralTab(viewService, patientModelService), tr(
"General"));
563 QPushButton* applyButton =
mButtonBox->button(QDialogButtonBox::Apply);
565 connect(
mButtonBox, SIGNAL(rejected()),
this, SLOT(reject()));
566 connect(
mButtonBox, SIGNAL(accepted()),
this, SLOT(accept()));
567 connect(applyButton, SIGNAL(clicked()),
this, SLOT(applySlot()));
569 QVBoxLayout *mainLayout =
new QVBoxLayout;
570 QHBoxLayout *tabLayout =
new QHBoxLayout;
571 QFrame* frame =
new QFrame;
572 frame->setLineWidth(3);
573 frame->setFrameShape(QFrame::Panel);
574 frame->setFrameShadow(QFrame::Sunken);
575 frame->setLayout(
new QVBoxLayout);
578 tabLayout->addWidget(frame);
580 mainLayout->addLayout(tabLayout);
582 setLayout(mainLayout);
586 mButtonBox->button(QDialogButtonBox::Ok)->setFocus();
592 void PreferencesDialog::selectTabSlot()
594 QAction* action =
dynamic_cast<QAction*
>(sender());
597 int val = action->data().toInt();
601 void PreferencesDialog::applySlot()
609 connect(
mButtonBox, SIGNAL(accepted()), widget, SLOT(saveParametersSlot()));
610 connect(
this, SIGNAL(
applied()), widget, SLOT(saveParametersSlot()));
614 action->setCheckable(
true);
616 action->setChecked(
true);
617 connect(action, SIGNAL(triggered()),
this, SLOT(selectTabSlot()));
618 QToolButton* button =
new QToolButton(
this);
620 button->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
622 button->setDefaultAction(action);
633 mIGSTKDebugLoggingCheckBox(NULL),
634 mManualToolPhysicalPropertiesCheckBox(NULL),
635 mRenderSpeedLoggingCheckBox(NULL),
638 this->setObjectName(
"preferences_debug_widget");
651 QPushButton* runDebugToolButton =
new QPushButton(
"Run Debug Tool",
this);
652 runDebugToolButton->setToolTip(
"Start a dummy tool that runs in a deterministic pattern inside the bounding box of the first found volume.");
653 connect(runDebugToolButton, SIGNAL(clicked()),
this, SLOT(
runDebugToolSlot()));
664 mMainLayout->addWidget(runDebugToolButton, i++, 0);
682 dummyTool->setToolPositionMovement(dummyTool->createToolPositionMovementTranslationOnly(bb_r));
QString qstring_cast(const T &val)
DoublePropertyPtr mLabelSize
cxResource_EXPORT ProfilePtr profile()
QCheckBox * mRenderSpeedLoggingCheckBox
DoubleBoundingBox3D transform(const Transform3D &m, const DoubleBoundingBox3D &bb)
static BoolPropertyPtr initialize(const QString &uid, QString name, QString help, bool value, QDomNode root=QDomNode())
void saveParametersSlot()
QCheckBox * mManualToolPhysicalPropertiesCheckBox
void saveParametersSlot()
QActionGroup * mActionGroup
QGridLayout * mMainLayout
void applicationStateChanged()
AutomationTab(QWidget *parent=0)
QCheckBox * mAutoShowNewDataCheckBox
boost::shared_ptr< class VisServices > VisServicesPtr
QRadioButton * m24bitRadioButton
BoolPropertyPtr mToolCrosshair
VisualizationTab(PatientModelServicePtr patientModelService, QWidget *parent=0)
void addTab(PreferenceTab *widget, QString name)
Utility class for describing a bounded numeric range.
boost::shared_ptr< class Image > ImagePtr
Automatic execution of actions when applicable.
QCheckBox * mAutoSaveCheckBox
static VisServicesPtr create(ctkPluginContext *context)
QCheckBox * mAutoStartTrackingCheckBox
cxLogicManager_EXPORT StateServicePtr stateService()
Tab for general settings in the system.
virtual ~PreferencesDialog()
DoublePropertyPtr mAnnotationModelSize
QVariant value(const QString &key, const QVariant &defaultValue=QVariant()) const
static QStringList getRootConfigPaths()
DoublePropertyPtr mFollowTooltipBoundary
QCheckBox * mAutoDeleteDICOMDBCheckBox
Various parameters related to ultrasound acquisition and reconstruction.
DoublePropertyPtr mSphereRadius
DebugTab(QWidget *parent=0)
QCheckBox * mAutoLoadPatientCheckBox
void initStereoTypeComboBox()
BoolPropertyPtr mShowDataText
PreferencesDialog(ViewServicePtr viewService, PatientModelServicePtr patientModelService, QWidget *parent=0)
void setValue(const QString &key, const QVariant &value)
boost::shared_ptr< class DummyTool > DummyToolPtr
QLineEdit * mAcquisitionNameLineEdit
QVBoxLayout * mMainLayout
QRadioButton * m8bitRadioButton
DoublePropertyPtr mAutoLoadPatientWithinHours
void saveParametersSlot()
StringPropertyPtr mClinicalView
PatientModelServicePtr mPatientModelService
boost::shared_ptr< class PatientModelService > PatientModelServicePtr
QCheckBox * mAutoStartStreamingCheckBox
QActionGroup * mStereoTypeActionGroup
VideoTab(QWidget *parent=0)
QDialogButtonBox * mButtonBox
Settings * settings()
Shortcut for accessing the settings instance.
Representation of a floating-point bounding box in 3D. The data are stored as {xmin,xmax,ymin,ymax,zmin,zmax}, in order to simplify communication with vtk.
static StringPropertyPtr initialize(const QString &uid, QString name, QString help, QString value, QStringList range, QDomNode root=QDomNode())
LogicManager * logicManager()
QCheckBox * mCompressCheckBox
cxLogicManager_EXPORT ViewServicePtr viewService()
DoublePropertyPtr mEyeAngleAdapter
QComboBox * mStereoTypeComboBox
cxLogicManager_EXPORT PatientModelServicePtr patientService()
static DoublePropertyPtr initialize(const QString &uid, QString name, QString help, double value, DoubleRange range, int decimals, QDomNode root=QDomNode())
QCheckBox * mIGSTKDebugLoggingCheckBox
BoolPropertyPtr mShowLabels
cxLogicManager_EXPORT TrackingServicePtr trackingService()
StringPropertyPtr mAnnotationModel
QCheckBox * mAutoSelectActiveToolCheckBox
QGridLayout * mMainLayout
QCheckBox * mAutoReconstructCheckBox
BoolPropertyPtr mFollowTooltip
void saveParametersSlot()
QStackedWidget * mTabWidget
QVBoxLayout * mMainLayout
BoolPropertyPtr mShowMetricNamesInCorner
DoublePropertyPtr mAnyplaneViewOffset