#include <iostream>
#include <visp3/ustk_core/usConfig.h>
#if (defined(USTK_HAVE_QT5) || defined(USTK_HAVE_VTK_QT)) && (defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI)) && \
defined(USTK_HAVE_FFTW)
#include <QApplication>
#include <QStringList>
#include <QtCore/QThread>
#include <visp3/ustk_core/usRFToPreScan2DConverter.h>
#include <visp3/ustk_grabber/usNetworkGrabberRF2D.h>
#include <visp3/gui/vpDisplayGDI.h>
#include <visp3/gui/vpDisplayX.h>
int main(int argc, char **argv)
{
QApplication app(argc, argv);
if (qApp->arguments().contains(QString("--record"))) {
qApp->arguments().at(qApp->arguments().indexOf(QString("--record")) + 1).toStdString());
}
if (qApp->arguments().contains(QString("--probeID"))) {
header.
probeId = qApp->arguments().at(qApp->arguments().indexOf(QString(
"--probeID")) + 1).toInt();
} else
if (qApp->arguments().contains(QString("--slotID"))) {
header.
slotId = qApp->arguments().at(qApp->arguments().indexOf(QString(
"--slotID")) + 1).toInt();
} else
if (qApp->arguments().contains(QString("--imagingMode"))) {
header.
imagingMode = qApp->arguments().at(qApp->arguments().indexOf(QString(
"--imagingMode")) + 1).toInt();
} else
#if defined(VISP_HAVE_X11)
#elif defined(VISP_HAVE_GDI)
#endif
bool displayInit = false;
bool captureRunning = true;
std::cout << "waiting ultrasound initialisation..." << std::endl;
do {
grabbedFrame = qtGrabber->
acquire();
std::cout <<
"MAIN THREAD received frame No : " << grabbedFrame->
getFrameCount() << std::endl;
double t0 = vpTime::measureTimeMs();
converter.
convert(*grabbedFrame, preScanImage);
double t1 = vpTime::measureTimeMs();
std::cout << "conversion time = " << t1 - t0 << std::endl;
if (!displayInit && preScanImage.getHeight() != 0 && preScanImage.getWidth() != 0) {
#if defined(VISP_HAVE_X11)
display =
new vpDisplayX(preScanImage);
#elif defined(VISP_HAVE_GDI)
display =
new vpDisplayGDI(preScanImage);
#endif
displayInit = true;
}
if (displayInit) {
if (vpDisplay::getClick(preScanImage, false))
captureRunning = false;
vpDisplay::display(preScanImage);
vpDisplay::displayText(preScanImage, 20, 20, std::string("Click to exit..."), vpColor::red);
vpDisplay::flush(preScanImage);
}
} while (captureRunning);
if (displayInit) {
}
return 0;
}
#else
int main()
{
std::cout << "You should intall Qt5 (with wigdets and network modules), FFTW and GDI or X11 to run this tutorial"
<< std::endl;
return 0;
}
#endif
Class to store additionnal informations arriving on the network with ultrasound images grabbed,...
quint32 getFrameCount() const
Specific class to grab RF frames from the ultrasound station on the network.
void activateRecording(std::string path)
usFrameGrabbedInfo< usImageRF2D< short int > > * acquire()
bool initAcquisition(const usNetworkGrabber::usInitHeaderSent &header)
2D conversion from RF signal to pre-scan image
void convert(const usImageRF2D< short int > &rfImage, usImagePreScan2D< unsigned char > &preScanImage)