37 #include <QVBoxLayout>
38 #include "boost/bind.hpp"
65 BaseWidget(parent,
"org_custusx_acquisition_widgets_acquisition",
"US Acquisition"),
66 mUsReconstructionService(usReconstructionService),
67 mAcquisitionService(acquisitionService),
68 mLayout(new QVBoxLayout(this))
70 this->setToolTip(
"Record and reconstruct US data");
72 QString desc =
settings()->
value(
"Ultrasound/acquisitionName").toString();
75 mLayout->addWidget(mRecordSessionWidget);
90 QHBoxLayout* timerLayout =
new QHBoxLayout;
91 mLayout->addLayout(timerLayout);
94 timerLayout->addStretch();
95 timerLayout->addWidget(mDisplayTimerWidget);
96 timerLayout->addStretch();
98 QGridLayout* editsLayout =
new QGridLayout;
99 editsLayout->setColumnStretch(0,0);
100 editsLayout->setColumnStretch(1,1);
101 mLayout->addLayout(editsLayout);
107 QIcon(
":/icons/open_icon_library/system-run-5.png"),
108 "Details",
"Toggle Details",
109 SLOT(toggleDetailsSlot()),
112 QToolButton* optionsButton =
new QToolButton();
113 optionsButton->setDefaultAction(optionsAction);
114 editsLayout->addWidget(optionsButton, 0, 2);
116 mOptionsWidget = this->createOptionsWidget();
117 mOptionsWidget->setVisible(
settings()->value(
"acquisition/UsAcqShowDetails").toBool());
120 mLayout->addWidget(mOptionsWidget);
122 mLayout->addStretch();
123 mLayout->addWidget(mTimedAlgorithmProgressBar);
130 void USAcqusitionWidget::toggleDetailsSlot()
132 mOptionsWidget->setVisible(!mOptionsWidget->isVisible());
133 settings()->
setValue(
"acquisition/UsAcqShowDetails", mOptionsWidget->isVisible());
136 QWidget* USAcqusitionWidget::createOptionsWidget()
138 QWidget* retval =
new QWidget(
this);
139 QGridLayout* layout =
new QGridLayout(retval);
140 layout->setMargin(0);
142 SoundSpeedConverterWidget* soundSpeedWidget =
new SoundSpeedConverterWidget(mServices->tracking(),
this);
144 ProbeConfigWidget* probeWidget =
new ProbeConfigWidget(mServices,
this);
145 probeWidget->getActiveProbeConfigWidget()->setVisible(
false);
151 layout->addWidget(this->wrapGroupBox(probeWidget,
"Probe",
"Probe Definition"), line++, 0);
152 layout->addWidget(this->wrapGroupBox(soundSpeedWidget,
"Sound Speed",
"Sound Speed"), line++, 0);
153 layout->addWidget(temporalCalibrationWidget, line++, 0);
158 QWidget* USAcqusitionWidget::wrapGroupBox(QWidget* input, QString name, QString tip)
160 QGroupBox* retval =
new QGroupBox(name);
161 retval->setToolTip(tip);
162 QVBoxLayout* layout =
new QVBoxLayout(retval);
163 layout->addWidget(input);
164 layout->addStretch();
165 layout->setMargin(layout->margin()/2);
169 QWidget* USAcqusitionWidget::wrapVerticalStretch(QWidget* input)
171 QWidget* retval =
new QWidget(
this);
172 QVBoxLayout* layout =
new QVBoxLayout(retval);
173 layout->addWidget(input);
174 layout->addStretch();
175 layout->setMargin(0);
176 layout->setSpacing(0);
180 void USAcqusitionWidget::acquisitionDataReadySlot()
182 if (
settings()->value(
"Automation/autoReconstruct").toBool())
184 mUsReconstructionService->startReconstruction();
188 void USAcqusitionWidget::acquisitionStateChangedSlot()
203 void USAcqusitionWidget::recordStarted()
205 mDisplayTimerWidget->
start();
207 void USAcqusitionWidget::recordStopped()
209 mDisplayTimerWidget->
stop();
211 void USAcqusitionWidget::recordCancelled()
213 mDisplayTimerWidget->
stop();
216 void USAcqusitionWidget::reconstructAboutToStartSlot()
218 std::set<cx::TimedAlgorithmPtr> threads = mUsReconstructionService->getThreadedReconstruction();
219 mTimedAlgorithmProgressBar->
attach(threads);
222 void USAcqusitionWidget::reconstructStartedSlot()
224 mAcquisitionService->startPostProcessing();
227 void USAcqusitionWidget::reconstructFinishedSlot()
229 std::set<cx::TimedAlgorithmPtr> threads = mUsReconstructionService->getThreadedReconstruction();
230 mTimedAlgorithmProgressBar->
detach(threads);
231 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)
cxLogicManager_EXPORT AcquisitionServicePtr acquisitionService()
void reconstructAboutToStart()
virtual void newDataOnDisk(QString mhdFilename)=0
void acquisitionDataReady()
emitted when data is acquired and sent to the reconstruction module