16 #include <QVBoxLayout> 17 #include "boost/bind.hpp" 44 BaseWidget(parent,
"org_custusx_acquisition_widgets_acquisition",
"US Acquisition"),
45 mUsReconstructionService(usReconstructionService),
46 mAcquisitionService(acquisitionService),
47 mLayout(new QVBoxLayout(this))
49 this->setToolTip(
"Record and reconstruct US data");
51 QString desc =
settings()->
value(
"Ultrasound/acquisitionName").toString();
54 mLayout->addWidget(mRecordSessionWidget);
69 QHBoxLayout* timerLayout =
new QHBoxLayout;
70 mLayout->addLayout(timerLayout);
73 timerLayout->addStretch();
74 timerLayout->addWidget(mDisplayTimerWidget);
75 timerLayout->addStretch();
77 QGridLayout* editsLayout =
new QGridLayout;
78 editsLayout->setColumnStretch(0,0);
79 editsLayout->setColumnStretch(1,1);
80 mLayout->addLayout(editsLayout);
86 QIcon(
":/icons/open_icon_library/system-run-5.png"),
87 "Details",
"Toggle Details",
88 SLOT(toggleDetailsSlot()),
91 QToolButton* optionsButton =
new QToolButton();
92 optionsButton->setDefaultAction(optionsAction);
93 editsLayout->addWidget(optionsButton, 0, 2);
95 mOptionsWidget = this->createOptionsWidget();
96 mOptionsWidget->setVisible(
settings()->value(
"acquisition/UsAcqShowDetails").toBool());
99 mLayout->addWidget(mOptionsWidget);
101 mLayout->addStretch();
102 mLayout->addWidget(mTimedAlgorithmProgressBar);
109 void USAcqusitionWidget::toggleDetailsSlot()
111 mOptionsWidget->setVisible(!mOptionsWidget->isVisible());
112 settings()->
setValue(
"acquisition/UsAcqShowDetails", mOptionsWidget->isVisible());
115 QWidget* USAcqusitionWidget::createOptionsWidget()
117 QWidget* retval =
new QWidget(
this);
118 QGridLayout* layout =
new QGridLayout(retval);
119 layout->setMargin(0);
124 probeWidget->getActiveProbeConfigWidget()->setVisible(
false);
130 layout->addWidget(this->wrapGroupBox(probeWidget,
"Probe",
"Probe Definition"), line++, 0);
131 layout->addWidget(this->wrapGroupBox(soundSpeedWidget,
"Sound Speed",
"Sound Speed"), line++, 0);
132 layout->addWidget(temporalCalibrationWidget, line++, 0);
137 QWidget* USAcqusitionWidget::wrapGroupBox(QWidget* input, QString name, QString tip)
139 QGroupBox* retval =
new QGroupBox(name);
140 retval->setToolTip(tip);
141 QVBoxLayout* layout =
new QVBoxLayout(retval);
142 layout->addWidget(input);
143 layout->addStretch();
144 layout->setMargin(layout->margin()/2);
148 QWidget* USAcqusitionWidget::wrapVerticalStretch(QWidget* input)
150 QWidget* retval =
new QWidget(
this);
151 QVBoxLayout* layout =
new QVBoxLayout(retval);
152 layout->addWidget(input);
153 layout->addStretch();
154 layout->setMargin(0);
155 layout->setSpacing(0);
159 void USAcqusitionWidget::acquisitionDataReadySlot()
161 if (
settings()->value(
"Automation/autoReconstruct").toBool())
163 mUsReconstructionService->startReconstruction();
167 void USAcqusitionWidget::acquisitionStateChangedSlot()
182 void USAcqusitionWidget::recordStarted()
184 mDisplayTimerWidget->
start();
186 void USAcqusitionWidget::recordStopped()
188 mDisplayTimerWidget->
stop();
190 void USAcqusitionWidget::recordCancelled()
192 mDisplayTimerWidget->
stop();
195 void USAcqusitionWidget::reconstructAboutToStartSlot()
197 std::set<cx::TimedAlgorithmPtr> threads = mUsReconstructionService->getThreadedReconstruction();
198 mTimedAlgorithmProgressBar->
attach(threads);
201 void USAcqusitionWidget::reconstructStartedSlot()
203 mAcquisitionService->startPostProcessing();
206 void USAcqusitionWidget::reconstructFinishedSlot()
208 std::set<cx::TimedAlgorithmPtr> threads = mUsReconstructionService->getThreadedReconstruction();
209 mTimedAlgorithmProgressBar->
detach(threads);
210 mAcquisitionService->stopPostProcessing();
boost::shared_ptr< class UsReconstructionService > UsReconstructionServicePtr
void acquisitionStopped()
boost::shared_ptr< class AcquisitionService > AcquisitionServicePtr
boost::shared_ptr< class VisServices > VisServicesPtr
void reconstructFinished()
void saveDataCompleted(QString mhdFilename)
emitted when data has been saved to file
static DoublePropertyBasePtr New(TrackingServicePtr trackingService)
QVariant value(const QString &key, const QVariant &defaultValue=QVariant()) const
static StringPropertyActiveProbeConfigurationPtr New(TrackingServicePtr trackingService)
Show progress for a TimedBaseAlgorithm.
void detach(TimedAlgorithmPtr algorithm)
void setValue(const QString &key, const QVariant &value)
void reconstructStarted()
Settings * settings()
Shortcut for accessing the settings instance.
void attach(TimedAlgorithmPtr algorithm)
void reconstructAboutToStart()
virtual void newDataOnDisk(QString mhdFilename)=0
void acquisitionDataReady()
emitted when data is acquired and sent to the reconstruction module
Namespace for all CustusX production code.