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.1,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");
277 bool autoStartTracking =
settings()->
value(
"Automation/autoStartTracking").toBool();
281 bool autoStartStreaming =
settings()->
value(
"Automation/autoStartStreaming").toBool();
285 bool autoReconstruct =
settings()->
value(
"Automation/autoReconstruct").toBool();
289 bool autoSelectActiveTool =
settings()->
value(
"Automation/autoSelectActiveTool").toBool();
292 "Automatically select an active tool when a tool becomes visible");
295 bool autoSave =
settings()->
value(
"Automation/autoSave").toBool();
298 "Save patient after major events,\n"
299 "such as workflow step change, registration, reconstruction.");
302 bool autoShow =
settings()->
value(
"Automation/autoShowNewData").toBool();
305 "Show new data in the first view.\n"
306 "Occors after load data and reconstruct.");
309 bool autoLoadPatient =
settings()->
value(
"Automation/autoLoadRecentPatient").toBool();
314 double autoLoadPatientWithinHours =
settings()->
value(
"Automation/autoLoadRecentPatientWithinHours").toDouble();
351 this->setObjectName(
"preferences_video_widget");
362 QVBoxLayout* toplayout =
new QVBoxLayout;
363 QHBoxLayout* acqNameLayout =
new QHBoxLayout;
364 toplayout->addLayout(acqNameLayout);
366 acqNameLayout->addWidget(
new QLabel(
"Name prefix"));
371 bool bw =
settings()->
value(
"Ultrasound/8bitAcquisitionData").toBool();
375 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");
382 mCompressCheckBox->setToolTip(
"Store the US Acquisition data as compressed MHD");
384 toplayout->addSpacing(5);
409 this->setObjectName(
"preferences_tool_config_widget");
416 connect(
settings(), SIGNAL(valueChangedFor(QString)),
this, SLOT(globalConfigurationFileChangedSlot(QString)));
418 connect(mToolConfigureGroupBox, SIGNAL(toolSelected(QString)), mFilePreviewWidget, SLOT(previewFileSlot(QString)));
419 connect(mToolFilterGroupBox, SIGNAL(toolSelected(QString)), mFilePreviewWidget, SLOT(previewFileSlot(QString)));
421 connect(mToolConfigureGroupBox, SIGNAL(toolSelected(QString)), mImagePreviewWidget, SLOT(previewFileSlot(QString)));
422 connect(mToolFilterGroupBox, SIGNAL(toolSelected(QString)), mImagePreviewWidget, SLOT(previewFileSlot(QString)));
424 this->applicationChangedSlot();
432 QGroupBox* filepreviewGroupBox =
new QGroupBox(
this);
436 filepreviewGroupBox->setTitle(
"Toolfile preview");
437 QHBoxLayout* filepreviewLayout =
new QHBoxLayout();
438 filepreviewGroupBox->setLayout(filepreviewLayout);
440 filepreviewLayout->addWidget(mFilePreviewWidget);
442 QGroupBox* imagepreviewGroupBox =
new QGroupBox(
this);
443 imagepreviewGroupBox->setTitle(
"Tool image preview");
444 QVBoxLayout* imagepreviewLayout =
new QVBoxLayout();
445 imagepreviewGroupBox->setLayout(imagepreviewLayout);
446 imagepreviewLayout->setMargin(0);
447 imagepreviewLayout->addWidget(mImagePreviewWidget);
450 QGridLayout* layout =
new QGridLayout;
453 layout->addWidget(mToolConfigureGroupBox, 0, 0, 1, 2);
454 layout->addWidget(mToolFilterGroupBox, 0, 2, 1, 2);
455 layout->addWidget(filepreviewGroupBox, 1, 0, 1, 3);
456 layout->addWidget(imagepreviewGroupBox, 1, 3, 1, 1);
467 if(newConfigFile.isEmpty())
471 QFile configFile(newConfigFile);
472 QFileInfo info(configFile);
473 if(!configFile.exists())
480 void ToolConfigTab::applicationChangedSlot()
485 void ToolConfigTab::globalConfigurationFileChangedSlot(QString key)
487 if(key !=
"toolConfigFile")
503 mToolBar->setOrientation(Qt::Vertical);
506 mButtonBox =
new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Apply | QDialogButtonBox::Cancel);
508 this->
addTab(
new GeneralTab(visualizationService, patientModelService), tr(
"General"));
516 QPushButton* applyButton =
mButtonBox->button(QDialogButtonBox::Apply);
518 connect(
mButtonBox, SIGNAL(rejected()),
this, SLOT(reject()));
519 connect(
mButtonBox, SIGNAL(accepted()),
this, SLOT(accept()));
520 connect(applyButton, SIGNAL(clicked()),
this, SLOT(applySlot()));
522 QVBoxLayout *mainLayout =
new QVBoxLayout;
523 QHBoxLayout *tabLayout =
new QHBoxLayout;
524 QFrame* frame =
new QFrame;
525 frame->setLineWidth(3);
526 frame->setFrameShape(QFrame::Panel);
527 frame->setFrameShadow(QFrame::Sunken);
528 frame->setLayout(
new QVBoxLayout);
531 tabLayout->addWidget(frame);
533 mainLayout->addLayout(tabLayout);
535 setLayout(mainLayout);
539 mButtonBox->button(QDialogButtonBox::Ok)->setFocus();
545 void PreferencesDialog::selectTabSlot()
547 QAction* action =
dynamic_cast<QAction*
>(sender());
550 int val = action->data().toInt();
554 void PreferencesDialog::applySlot()
562 connect(
mButtonBox, SIGNAL(accepted()), widget, SLOT(saveParametersSlot()));
563 connect(
this, SIGNAL(
applied()), widget, SLOT(saveParametersSlot()));
567 action->setCheckable(
true);
569 action->setChecked(
true);
570 connect(action, SIGNAL(triggered()),
this, SLOT(selectTabSlot()));
571 QToolButton* button =
new QToolButton(
this);
573 button->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
575 button->setDefaultAction(action);
586 mIGSTKDebugLoggingCheckBox(NULL),
587 mManualToolPhysicalPropertiesCheckBox(NULL),
588 mRenderSpeedLoggingCheckBox(NULL),
591 this->setObjectName(
"preferences_debug_widget");
604 QPushButton* runDebugToolButton =
new QPushButton(
"Run Debug Tool",
this);
605 runDebugToolButton->setToolTip(
"Start a dummy tool that runs in a deterministic pattern inside the bounding box of the first found volume.");
606 connect(runDebugToolButton, SIGNAL(clicked()),
this, SLOT(
runDebugToolSlot()));
617 mMainLayout->addWidget(runDebugToolButton, i++, 0);
635 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
Various parameters related to ultrasound acquisition and reconstruction.
DoublePropertyPtr mSphereRadius
DebugTab(QWidget *parent=0)
QCheckBox * mAutoLoadPatientCheckBox
void initStereoTypeComboBox()
BoolPropertyPtr mShowDataText
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
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
PreferencesDialog(VisualizationServicePtr visualizationService, PatientModelServicePtr patientModelService, QWidget *parent=0)
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