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 the color of the tool in 2D");
94 "View/toolTipPointColor",
95 "Set the color of the tool tip in 2D/3D");
98 "View/toolOffsetPointColor",
99 "Set the color of the tool offset point in 2D/3D");
102 "View/toolOffsetLineColor",
103 "Set the color of the tool offset line in 2D/3D");
106 "View2D/toolCrossHairColor",
107 "Set the color of the tool 2D crosshair");
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(
"View2D/showToolCrosshair").value<
bool>();
120 "Show a crosshair centered on the tool in the 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);
453 mStateService(stateService)
455 this->setObjectName(
"preferences_tool_config_widget");
462 connect(
settings(), SIGNAL(valueChangedFor(QString)),
this, SLOT(globalConfigurationFileChangedSlot(QString)));
464 connect(mToolConfigureGroupBox, SIGNAL(toolSelected(QString)), mFilePreviewWidget, SLOT(previewFileSlot(QString)));
465 connect(mToolFilterGroupBox, SIGNAL(toolSelected(QString)), mFilePreviewWidget, SLOT(previewFileSlot(QString)));
467 connect(mToolConfigureGroupBox, SIGNAL(toolSelected(QString)), mImagePreviewWidget, SLOT(previewFileSlot(QString)));
468 connect(mToolFilterGroupBox, SIGNAL(toolSelected(QString)), mImagePreviewWidget, SLOT(previewFileSlot(QString)));
470 this->applicationChangedSlot();
478 QGroupBox* filepreviewGroupBox =
new QGroupBox(
this);
482 filepreviewGroupBox->setTitle(
"Toolfile preview");
483 QHBoxLayout* filepreviewLayout =
new QHBoxLayout();
484 filepreviewGroupBox->setLayout(filepreviewLayout);
486 filepreviewLayout->addWidget(mFilePreviewWidget);
488 QGroupBox* imagepreviewGroupBox =
new QGroupBox(
this);
489 imagepreviewGroupBox->setTitle(
"Tool image preview");
490 QVBoxLayout* imagepreviewLayout =
new QVBoxLayout();
491 imagepreviewGroupBox->setLayout(imagepreviewLayout);
492 imagepreviewLayout->setMargin(0);
493 imagepreviewLayout->addWidget(mImagePreviewWidget);
496 QGridLayout* layout =
new QGridLayout;
499 layout->addWidget(mToolConfigureGroupBox, 0, 0, 1, 2);
500 layout->addWidget(mToolFilterGroupBox, 0, 2, 1, 2);
501 layout->addWidget(filepreviewGroupBox, 1, 0, 1, 3);
502 layout->addWidget(imagepreviewGroupBox, 1, 3, 1, 1);
513 if(newConfigFile.isEmpty())
517 QFile configFile(newConfigFile);
518 QFileInfo info(configFile);
519 if(!configFile.exists())
526 void ToolConfigTab::applicationChangedSlot()
531 void ToolConfigTab::globalConfigurationFileChangedSlot(QString key)
533 if(key !=
"toolConfigFile")
549 mToolBar->setOrientation(Qt::Vertical);
552 mButtonBox =
new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Apply | QDialogButtonBox::Cancel);
555 this->
addTab(
new GeneralTab(viewService, patientModelService), tr(
"General"));
562 this->
addTab(
new DebugTab(patientModelService, trackingService), tr(
"Debug"));
564 QPushButton* applyButton =
mButtonBox->button(QDialogButtonBox::Apply);
566 connect(
mButtonBox, SIGNAL(rejected()),
this, SLOT(reject()));
567 connect(
mButtonBox, SIGNAL(accepted()),
this, SLOT(accept()));
568 connect(applyButton, SIGNAL(clicked()),
this, SLOT(applySlot()));
570 QVBoxLayout *mainLayout =
new QVBoxLayout;
571 QHBoxLayout *tabLayout =
new QHBoxLayout;
572 QFrame* frame =
new QFrame;
573 frame->setLineWidth(3);
574 frame->setFrameShape(QFrame::Panel);
575 frame->setFrameShadow(QFrame::Sunken);
576 frame->setLayout(
new QVBoxLayout);
579 tabLayout->addWidget(frame);
581 mainLayout->addLayout(tabLayout);
583 setLayout(mainLayout);
587 mButtonBox->button(QDialogButtonBox::Ok)->setFocus();
593 void PreferencesDialog::selectTabSlot()
595 QAction* action =
dynamic_cast<QAction*
>(sender());
598 int val = action->data().toInt();
602 void PreferencesDialog::applySlot()
610 connect(
mButtonBox, SIGNAL(accepted()), widget, SLOT(saveParametersSlot()));
611 connect(
this, SIGNAL(
applied()), widget, SLOT(saveParametersSlot()));
615 action->setCheckable(
true);
617 action->setChecked(
true);
618 connect(action, SIGNAL(triggered()),
this, SLOT(selectTabSlot()));
619 QToolButton* button =
new QToolButton(
this);
621 button->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
623 button->setDefaultAction(action);
634 mIGSTKDebugLoggingCheckBox(NULL),
635 mManualToolPhysicalPropertiesCheckBox(NULL),
636 mRenderSpeedLoggingCheckBox(NULL),
638 mPatientModelService(patientModelService),
639 mTrackingService(trackingService)
641 this->setObjectName(
"preferences_debug_widget");
654 QPushButton* runDebugToolButton =
new QPushButton(
"Run Debug Tool",
this);
655 runDebugToolButton->setToolTip(
"Start a dummy tool that runs in a deterministic pattern inside the bounding box of the first found volume.");
656 connect(runDebugToolButton, SIGNAL(clicked()),
this, SLOT(
runDebugToolSlot()));
667 mMainLayout->addWidget(runDebugToolButton, i++, 0);
685 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)
boost::shared_ptr< class StateService > StateServicePtr
QCheckBox * mAutoShowNewDataCheckBox
TrackingServicePtr mTrackingService
boost::shared_ptr< class VisServices > VisServicesPtr
std::string toString(T const &value)
converts any type to a string
boost::shared_ptr< class TrackingService > TrackingServicePtr
DebugTab(PatientModelServicePtr patientModelService, TrackingServicePtr trackingService, QWidget *parent=0)
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
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
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())
LogicManager * logicManager()
QCheckBox * mCompressCheckBox
DoublePropertyPtr mEyeAngleAdapter
QComboBox * mStereoTypeComboBox
PatientModelServicePtr mPatientModelService
static DoublePropertyPtr initialize(const QString &uid, QString name, QString help, double value, DoubleRange range, int decimals, QDomNode root=QDomNode())
QCheckBox * mIGSTKDebugLoggingCheckBox
BoolPropertyPtr mShowLabels
StringPropertyPtr mAnnotationModel
QCheckBox * mAutoSelectActiveToolCheckBox
QGridLayout * mMainLayout
QCheckBox * mAutoReconstructCheckBox
BoolPropertyPtr mFollowTooltip
void saveParametersSlot()
QStackedWidget * mTabWidget
QVBoxLayout * mMainLayout
BoolPropertyPtr mShowMetricNamesInCorner
DoublePropertyPtr mAnyplaneViewOffset
PreferencesDialog(ViewServicePtr viewService, PatientModelServicePtr patientModelService, StateServicePtr stateService, TrackingServicePtr trackingService, QWidget *parent=0)
Namespace for all CustusX production code.