37 #include <vtkRenderWindow.h>
38 #include <vtkRenderer.h>
64 this->setObjectName(
"preferences_visualization_widget");
73 double sphereRadius =
settings()->
value(
"View3D/sphereRadius").toDouble();
76 double labelSize =
settings()->
value(
"View3D/labelSize").toDouble();
80 backgroundColorButton->
setColor(
settings()->value(
"backgroundColor").value<QColor>());
82 connect(backgroundColorButton, SIGNAL(colorChanged(QColor)),
this, SLOT(setBackgroundColorSlot(QColor)));
84 bool showDataText =
settings()->
value(
"View/showDataText").value<
bool>();
86 "Show the name of each data set in the views.",
88 bool showLabels =
settings()->
value(
"View/showLabels").value<
bool>();
90 "Attach name labels to entities in the views.",
93 bool showMetricNamesInCorner =
settings()->
value(
"View/showMetricNamesInCorner").value<
bool>();
95 "Show the metric data in the upper right corner of the view instead of in the scene.",
96 showMetricNamesInCorner);
99 double annotationModelSize =
settings()->
value(
"View3D/annotationModelSize").toDouble();
101 QStringList annotationModelRange;
104 annotationModelRange << QDir(path+
"/models/").entryList(QStringList()<<
"*.stl");
106 annotationModelRange.prepend(
"<default>");
107 QString annotationModel =
settings()->
value(
"View3D/annotationModel").toString();
111 QGroupBox* stereoGroupBox =
new QGroupBox(
"Stereoscopic visualization");
113 connect(
mStereoTypeComboBox, SIGNAL(currentIndexChanged(
int)),
this, SLOT(stereoTypeChangedSlot(
int)));
115 double eyeAngle =
settings()->
value(
"View3D/eyeAngle").toDouble();
117 "Separation between eyes in degrees",
119 connect(
mEyeAngleAdapter.get(), SIGNAL(valueWasSet()),
this, SLOT(eyeAngleSlot()));
121 double anyplaneViewOffset =
settings()->
value(
"Navigation/anyplaneViewOffset").toDouble();
124 "Position of virtual tool tip in anyplane view, % from top.",
125 anyplaneViewOffset,
DoubleRange(-0.5,0.5,0.05), 2, QDomNode());
128 bool followTooltip =
settings()->
value(
"Navigation/followTooltip").value<
bool>();
130 "ACS Views follow the virtual tool tip",
132 double followTooltipBoundary =
settings()->
value(
"Navigation/followTooltipBoundary").toDouble();
134 "Follow Tool Boundary",
135 "Boundary in ACS Views where follow tool tip is applied. % of view size",
136 followTooltipBoundary,
DoubleRange(0.0,0.5,0.05), 2, QDomNode());
140 QStringList clinicalViews;
141 for (
unsigned i=0; i<mdCOUNT; ++i)
142 clinicalViews << enum2string<CLINICAL_VIEW>(CLINICAL_VIEW(i));
144 "Type of clinical view",
146 clinicalViews, QDomNode());
149 QVBoxLayout* stereoLayout =
new QVBoxLayout();
152 stereoGroupBox->setLayout(stereoLayout);
156 mMainLayout->addWidget(backgroundColorButton, 0, 0);
171 QHBoxLayout* toptopLayout =
new QHBoxLayout;
173 toptopLayout->addStretch();
190 stereoInterlacedAction->setData(QVariant(
stINTERLACED));
191 stereoDresdenAction->setData(QVariant(
stDRESDEN));
192 stereoRedBlueAction->setData(QVariant(stRED_BLUE));
194 connect(stereoFrameSequentialAction, SIGNAL(triggered()),
this, SLOT(stereoFrameSequentialSlot()));
195 connect(stereoInterlacedAction, SIGNAL(triggered()),
this, SLOT(stereoInterlacedSlot()));
196 connect(stereoDresdenAction, SIGNAL(triggered()),
this, SLOT(stereoDresdenSlot()));
197 connect(stereoRedBlueAction, SIGNAL(triggered()),
this, SLOT(stereoRedBlueSlot()));
203 mStereoTypeComboBox->insertItem(stRED_BLUE, stereoRedBlueAction->text(), stereoRedBlueAction->data());
206 int stereoType =
settings()->
value(
"View3D/stereoType").toInt();
209 void VisualizationTab::stereoTypeChangedSlot(
int index)
212 if (index<0 || index>=actions.size())
214 actions[index]->trigger();
216 void VisualizationTab::stereoFrameSequentialSlot()
220 void VisualizationTab::stereoInterlacedSlot()
224 void VisualizationTab::stereoDresdenSlot()
228 void VisualizationTab::stereoRedBlueSlot()
233 void VisualizationTab::eyeAngleSlot()
253 void VisualizationTab::setBackgroundColorSlot(QColor color)
264 this->setObjectName(
"preferences_automation_widget");
278 bool autoStartTracking =
settings()->
value(
"Automation/autoStartTracking").toBool();
282 bool autoStartStreaming =
settings()->
value(
"Automation/autoStartStreaming").toBool();
286 bool autoReconstruct =
settings()->
value(
"Automation/autoReconstruct").toBool();
290 bool autoSelectActiveTool =
settings()->
value(
"Automation/autoSelectActiveTool").toBool();
293 "Automatically select an active tool when a tool becomes visible");
296 bool autoSave =
settings()->
value(
"Automation/autoSave").toBool();
299 "Save patient after major events,\n"
300 "such as workflow step change, registration, reconstruction.");
303 bool autoShow =
settings()->
value(
"Automation/autoShowNewData").toBool();
306 "Show new data in the first view.\n"
307 "Occors after load data and reconstruct.");
310 bool autoLoadPatient =
settings()->
value(
"Automation/autoLoadRecentPatient").toBool();
315 bool autoDeleteDICOMDB =
settings()->
value(
"Automation/autoDeleteDICOMDatabase").toBool();
320 double autoLoadPatientWithinHours =
settings()->
value(
"Automation/autoLoadRecentPatientWithinHours").toDouble();
359 this->setObjectName(
"preferences_video_widget");
370 QVBoxLayout* toplayout =
new QVBoxLayout;
371 QHBoxLayout* acqNameLayout =
new QHBoxLayout;
372 toplayout->addLayout(acqNameLayout);
374 acqNameLayout->addWidget(
new QLabel(
"Name prefix"));
379 bool bw =
settings()->
value(
"Ultrasound/8bitAcquisitionData").toBool();
383 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");
390 mCompressCheckBox->setToolTip(
"Store the US Acquisition data as compressed MHD");
392 toplayout->addSpacing(5);
417 this->setObjectName(
"preferences_tool_config_widget");
424 connect(
settings(), SIGNAL(valueChangedFor(QString)),
this, SLOT(globalConfigurationFileChangedSlot(QString)));
426 connect(mToolConfigureGroupBox, SIGNAL(toolSelected(QString)), mFilePreviewWidget, SLOT(previewFileSlot(QString)));
427 connect(mToolFilterGroupBox, SIGNAL(toolSelected(QString)), mFilePreviewWidget, SLOT(previewFileSlot(QString)));
429 connect(mToolConfigureGroupBox, SIGNAL(toolSelected(QString)), mImagePreviewWidget, SLOT(previewFileSlot(QString)));
430 connect(mToolFilterGroupBox, SIGNAL(toolSelected(QString)), mImagePreviewWidget, SLOT(previewFileSlot(QString)));
432 this->applicationChangedSlot();
440 QGroupBox* filepreviewGroupBox =
new QGroupBox(
this);
444 filepreviewGroupBox->setTitle(
"Toolfile preview");
445 QHBoxLayout* filepreviewLayout =
new QHBoxLayout();
446 filepreviewGroupBox->setLayout(filepreviewLayout);
448 filepreviewLayout->addWidget(mFilePreviewWidget);
450 QGroupBox* imagepreviewGroupBox =
new QGroupBox(
this);
451 imagepreviewGroupBox->setTitle(
"Tool image preview");
452 QVBoxLayout* imagepreviewLayout =
new QVBoxLayout();
453 imagepreviewGroupBox->setLayout(imagepreviewLayout);
454 imagepreviewLayout->setMargin(0);
455 imagepreviewLayout->addWidget(mImagePreviewWidget);
458 QGridLayout* layout =
new QGridLayout;
461 layout->addWidget(mToolConfigureGroupBox, 0, 0, 1, 2);
462 layout->addWidget(mToolFilterGroupBox, 0, 2, 1, 2);
463 layout->addWidget(filepreviewGroupBox, 1, 0, 1, 3);
464 layout->addWidget(imagepreviewGroupBox, 1, 3, 1, 1);
475 if(newConfigFile.isEmpty())
479 QFile configFile(newConfigFile);
480 QFileInfo info(configFile);
481 if(!configFile.exists())
488 void ToolConfigTab::applicationChangedSlot()
493 void ToolConfigTab::globalConfigurationFileChangedSlot(QString key)
495 if(key !=
"toolConfigFile")
511 mToolBar->setOrientation(Qt::Vertical);
514 mButtonBox =
new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Apply | QDialogButtonBox::Cancel);
516 this->
addTab(
new GeneralTab(viewService, patientModelService), tr(
"General"));
524 QPushButton* applyButton =
mButtonBox->button(QDialogButtonBox::Apply);
526 connect(
mButtonBox, SIGNAL(rejected()),
this, SLOT(reject()));
527 connect(
mButtonBox, SIGNAL(accepted()),
this, SLOT(accept()));
528 connect(applyButton, SIGNAL(clicked()),
this, SLOT(applySlot()));
530 QVBoxLayout *mainLayout =
new QVBoxLayout;
531 QHBoxLayout *tabLayout =
new QHBoxLayout;
532 QFrame* frame =
new QFrame;
533 frame->setLineWidth(3);
534 frame->setFrameShape(QFrame::Panel);
535 frame->setFrameShadow(QFrame::Sunken);
536 frame->setLayout(
new QVBoxLayout);
539 tabLayout->addWidget(frame);
541 mainLayout->addLayout(tabLayout);
543 setLayout(mainLayout);
547 mButtonBox->button(QDialogButtonBox::Ok)->setFocus();
553 void PreferencesDialog::selectTabSlot()
555 QAction* action =
dynamic_cast<QAction*
>(sender());
558 int val = action->data().toInt();
562 void PreferencesDialog::applySlot()
570 connect(
mButtonBox, SIGNAL(accepted()), widget, SLOT(saveParametersSlot()));
571 connect(
this, SIGNAL(
applied()), widget, SLOT(saveParametersSlot()));
575 action->setCheckable(
true);
577 action->setChecked(
true);
578 connect(action, SIGNAL(triggered()),
this, SLOT(selectTabSlot()));
579 QToolButton* button =
new QToolButton(
this);
581 button->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
583 button->setDefaultAction(action);
594 mIGSTKDebugLoggingCheckBox(NULL),
595 mManualToolPhysicalPropertiesCheckBox(NULL),
596 mRenderSpeedLoggingCheckBox(NULL),
599 this->setObjectName(
"preferences_debug_widget");
612 QPushButton* runDebugToolButton =
new QPushButton(
"Run Debug Tool",
this);
613 runDebugToolButton->setToolTip(
"Start a dummy tool that runs in a deterministic pattern inside the bounding box of the first found volume.");
614 connect(runDebugToolButton, SIGNAL(clicked()),
this, SLOT(
runDebugToolSlot()));
625 mMainLayout->addWidget(runDebugToolButton, i++, 0);
643 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
QRadioButton * m24bitRadioButton
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
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())
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