37 #include <vtkRenderWindow.h>
38 #include <vtkRenderer.h>
72 double sphereRadius =
settings()->
value(
"View3D/sphereRadius").toDouble();
75 double labelSize =
settings()->
value(
"View3D/labelSize").toDouble();
79 backgroundColorButton->
setColor(
settings()->value(
"backgroundColor").value<QColor>());
81 connect(backgroundColorButton, SIGNAL(colorChanged(QColor)),
this, SLOT(setBackgroundColorSlot(QColor)));
83 bool showDataText =
settings()->
value(
"View/showDataText").value<
bool>();
85 "Show the name of each data set in the views.",
87 bool showLabels =
settings()->
value(
"View/showLabels").value<
bool>();
89 "Attach name labels to entities in the views.",
92 bool showMetricNamesInCorner =
settings()->
value(
"View/showMetricNamesInCorner").value<
bool>();
94 "Show the metric data in the upper right corner of the view instead of in the scene.",
95 showMetricNamesInCorner);
98 double annotationModelSize =
settings()->
value(
"View3D/annotationModelSize").toDouble();
100 QStringList annotationModelRange;
103 annotationModelRange << QDir(path+
"/models/").entryList(QStringList()<<
"*.stl");
105 annotationModelRange.prepend(
"<default>");
106 QString annotationModel =
settings()->
value(
"View3D/annotationModel").toString();
110 QGroupBox* stereoGroupBox =
new QGroupBox(
"Stereoscopic visualization");
112 connect(
mStereoTypeComboBox, SIGNAL(currentIndexChanged(
int)),
this, SLOT(stereoTypeChangedSlot(
int)));
114 double eyeAngle =
settings()->
value(
"View3D/eyeAngle").toDouble();
116 "Separation between eyes in degrees",
118 connect(
mEyeAngleAdapter.get(), SIGNAL(valueWasSet()),
this, SLOT(eyeAngleSlot()));
120 double anyplaneViewOffset =
settings()->
value(
"Navigation/anyplaneViewOffset").toDouble();
123 "Position of virtual tool tip in anyplane view, % from top.",
124 anyplaneViewOffset,
DoubleRange(0.1,0.5,0.05), 2, QDomNode());
127 bool followTooltip =
settings()->
value(
"Navigation/followTooltip").value<
bool>();
129 "ACS Views follow the virtual tool tip",
131 double followTooltipBoundary =
settings()->
value(
"Navigation/followTooltipBoundary").toDouble();
133 "Follow Tool Boundary",
134 "Boundary in ACS Views where follow tool tip is applied. % of view size",
135 followTooltipBoundary,
DoubleRange(0.0,0.5,0.05), 2, QDomNode());
139 QStringList clinicalViews;
140 for (
unsigned i=0; i<mdCOUNT; ++i)
141 clinicalViews << enum2string<CLINICAL_VIEW>(CLINICAL_VIEW(i));
143 "Type of clinical view",
145 clinicalViews, QDomNode());
148 QVBoxLayout* stereoLayout =
new QVBoxLayout();
151 stereoGroupBox->setLayout(stereoLayout);
155 mMainLayout->addWidget(backgroundColorButton, 0, 0);
170 QHBoxLayout* toptopLayout =
new QHBoxLayout;
172 toptopLayout->addStretch();
189 stereoInterlacedAction->setData(QVariant(
stINTERLACED));
190 stereoDresdenAction->setData(QVariant(
stDRESDEN));
191 stereoRedBlueAction->setData(QVariant(stRED_BLUE));
193 connect(stereoFrameSequentialAction, SIGNAL(triggered()),
this, SLOT(stereoFrameSequentialSlot()));
194 connect(stereoInterlacedAction, SIGNAL(triggered()),
this, SLOT(stereoInterlacedSlot()));
195 connect(stereoDresdenAction, SIGNAL(triggered()),
this, SLOT(stereoDresdenSlot()));
196 connect(stereoRedBlueAction, SIGNAL(triggered()),
this, SLOT(stereoRedBlueSlot()));
202 mStereoTypeComboBox->insertItem(stRED_BLUE, stereoRedBlueAction->text(), stereoRedBlueAction->data());
205 int stereoType =
settings()->
value(
"View3D/stereoType").toInt();
208 void VisualizationTab::stereoTypeChangedSlot(
int index)
211 if (index<0 || index>=actions.size())
213 actions[index]->trigger();
215 void VisualizationTab::stereoFrameSequentialSlot()
219 void VisualizationTab::stereoInterlacedSlot()
223 void VisualizationTab::stereoDresdenSlot()
227 void VisualizationTab::stereoRedBlueSlot()
232 void VisualizationTab::eyeAngleSlot()
252 void VisualizationTab::setBackgroundColorSlot(QColor color)
275 bool autoStartTracking =
settings()->
value(
"Automation/autoStartTracking").toBool();
279 bool autoStartStreaming =
settings()->
value(
"Automation/autoStartStreaming").toBool();
283 bool autoReconstruct =
settings()->
value(
"Automation/autoReconstruct").toBool();
287 bool autoSelectActiveTool =
settings()->
value(
"Automation/autoSelectActiveTool").toBool();
290 "Automatically select an active tool when a tool becomes visible");
293 bool autoSave =
settings()->
value(
"Automation/autoSave").toBool();
296 "Save patient after major events,\n"
297 "such as workflow step change, registration, reconstruction.");
300 bool autoShow =
settings()->
value(
"Automation/autoShowNewData").toBool();
303 "Show new data in the first view.\n"
304 "Occors after load data and reconstruct.");
307 bool autoLoadPatient =
settings()->
value(
"Automation/autoLoadRecentPatient").toBool();
312 double autoLoadPatientWithinHours =
settings()->
value(
"Automation/autoLoadRecentPatientWithinHours").toDouble();
358 QVBoxLayout* toplayout =
new QVBoxLayout;
359 QHBoxLayout* acqNameLayout =
new QHBoxLayout;
360 toplayout->addLayout(acqNameLayout);
362 acqNameLayout->addWidget(
new QLabel(
"Description"));
366 bool bw =
settings()->
value(
"Ultrasound/8bitAcquisitionData").toBool();
375 mCompressCheckBox->setToolTip(
"Store the US Acquisition data as compressed MHD");
377 toplayout->addSpacing(5);
408 connect(
settings(), SIGNAL(valueChangedFor(QString)),
this, SLOT(globalConfigurationFileChangedSlot(QString)));
410 connect(mToolConfigureGroupBox, SIGNAL(toolSelected(QString)), mFilePreviewWidget, SLOT(previewFileSlot(QString)));
411 connect(mToolFilterGroupBox, SIGNAL(toolSelected(QString)), mFilePreviewWidget, SLOT(previewFileSlot(QString)));
413 connect(mToolConfigureGroupBox, SIGNAL(toolSelected(QString)), mImagePreviewWidget, SLOT(previewFileSlot(QString)));
414 connect(mToolFilterGroupBox, SIGNAL(toolSelected(QString)), mImagePreviewWidget, SLOT(previewFileSlot(QString)));
416 this->applicationChangedSlot();
424 QGroupBox* filepreviewGroupBox =
new QGroupBox(
this);
428 filepreviewGroupBox->setTitle(
"Toolfile preview");
429 QHBoxLayout* filepreviewLayout =
new QHBoxLayout();
430 filepreviewGroupBox->setLayout(filepreviewLayout);
432 filepreviewLayout->addWidget(mFilePreviewWidget);
434 QGroupBox* imagepreviewGroupBox =
new QGroupBox(
this);
435 imagepreviewGroupBox->setTitle(
"Tool image preview");
436 QVBoxLayout* imagepreviewLayout =
new QVBoxLayout();
437 imagepreviewGroupBox->setLayout(imagepreviewLayout);
438 imagepreviewLayout->setMargin(0);
439 imagepreviewLayout->addWidget(mImagePreviewWidget);
442 QGridLayout* layout =
new QGridLayout;
445 layout->addWidget(mToolConfigureGroupBox, 0, 0, 1, 2);
446 layout->addWidget(mToolFilterGroupBox, 0, 2, 1, 2);
447 layout->addWidget(filepreviewGroupBox, 1, 0, 1, 3);
448 layout->addWidget(imagepreviewGroupBox, 1, 3, 1, 1);
459 if(newConfigFile.isEmpty())
463 QFile configFile(newConfigFile);
464 QFileInfo info(configFile);
465 if(!configFile.exists())
472 void ToolConfigTab::applicationChangedSlot()
477 void ToolConfigTab::globalConfigurationFileChangedSlot(QString key)
479 if(key !=
"toolConfigFile")
495 mToolBar->setOrientation(Qt::Vertical);
498 mButtonBox =
new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Apply | QDialogButtonBox::Cancel);
500 this->
addTab(
new GeneralTab(visualizationService, patientModelService), tr(
"General"));
508 QPushButton* applyButton =
mButtonBox->button(QDialogButtonBox::Apply);
510 connect(
mButtonBox, SIGNAL(rejected()),
this, SLOT(reject()));
511 connect(
mButtonBox, SIGNAL(accepted()),
this, SLOT(accept()));
512 connect(applyButton, SIGNAL(clicked()),
this, SLOT(applySlot()));
514 QVBoxLayout *mainLayout =
new QVBoxLayout;
515 QHBoxLayout *tabLayout =
new QHBoxLayout;
516 QFrame* frame =
new QFrame;
517 frame->setLineWidth(3);
518 frame->setFrameShape(QFrame::Panel);
519 frame->setFrameShadow(QFrame::Sunken);
520 frame->setLayout(
new QVBoxLayout);
523 tabLayout->addWidget(frame);
525 mainLayout->addLayout(tabLayout);
527 setLayout(mainLayout);
531 mButtonBox->button(QDialogButtonBox::Ok)->setFocus();
537 void PreferencesDialog::selectTabSlot()
539 QAction* action =
dynamic_cast<QAction*
>(sender());
542 int val = action->data().toInt();
546 void PreferencesDialog::applySlot()
554 connect(
mButtonBox, SIGNAL(accepted()), widget, SLOT(saveParametersSlot()));
555 connect(
this, SIGNAL(
applied()), widget, SLOT(saveParametersSlot()));
559 action->setCheckable(
true);
561 action->setChecked(
true);
562 connect(action, SIGNAL(triggered()),
this, SLOT(selectTabSlot()));
563 QToolButton* button =
new QToolButton(
this);
565 button->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
567 button->setDefaultAction(action);
578 mIGSTKDebugLoggingCheckBox(NULL),
579 mManualToolPhysicalPropertiesCheckBox(NULL),
580 mRenderSpeedLoggingCheckBox(NULL),
595 QPushButton* runDebugToolButton =
new QPushButton(
"Run Debug Tool",
this);
596 runDebugToolButton->setToolTip(
"Start a dummy tool that runs in a deterministic pattern inside the bounding box of the first found volume.");
597 connect(runDebugToolButton, SIGNAL(clicked()),
this, SLOT(
runDebugToolSlot()));
608 mMainLayout->addWidget(runDebugToolButton, i++, 0);
626 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