4 #include <visp3/ustk_core/usConfig.h>
6 #if (defined(USTK_HAVE_QT5) || defined(USTK_HAVE_VTK_QT)) && (defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI)) && \
7 defined(USTK_HAVE_FFTW)
9 #include <QApplication>
10 #include <QStringList>
11 #include <QtCore/QThread>
13 #include <visp3/ustk_core/usRFToPreScan2DConverter.h>
14 #include <visp3/ustk_grabber/usNetworkGrabberRF2D.h>
16 #include <visp3/gui/vpDisplayGDI.h>
17 #include <visp3/gui/vpDisplayX.h>
19 int main(
int argc,
char **argv)
22 QApplication app(argc, argv);
28 if (qApp->arguments().contains(QString(
"--record"))) {
30 qApp->arguments().at(qApp->arguments().indexOf(QString(
"--record")) + 1).toStdString());
35 if (qApp->arguments().contains(QString(
"--probeID"))) {
36 header.
probeId = qApp->arguments().at(qApp->arguments().indexOf(QString(
"--probeID")) + 1).toInt();
40 if (qApp->arguments().contains(QString(
"--slotID"))) {
41 header.
slotId = qApp->arguments().at(qApp->arguments().indexOf(QString(
"--slotID")) + 1).toInt();
45 if (qApp->arguments().contains(QString(
"--imagingMode"))) {
46 header.
imagingMode = qApp->arguments().at(qApp->arguments().indexOf(QString(
"--imagingMode")) + 1).toInt();
58 #if defined(VISP_HAVE_X11)
60 #elif defined(VISP_HAVE_GDI)
63 bool displayInit =
false;
64 bool captureRunning =
true;
70 std::cout <<
"waiting ultrasound initialisation..." << std::endl;
74 grabbedFrame = qtGrabber->
acquire();
76 std::cout <<
"MAIN THREAD received frame No : " << grabbedFrame->
getFrameCount() << std::endl;
79 double t0 = vpTime::measureTimeMs();
80 converter.
convert(*grabbedFrame, preScanImage);
81 double t1 = vpTime::measureTimeMs();
82 std::cout <<
"conversion time = " << t1 - t0 << std::endl;
85 if (!displayInit && preScanImage.getHeight() != 0 && preScanImage.getWidth() != 0) {
86 #if defined(VISP_HAVE_X11)
87 display =
new vpDisplayX(preScanImage);
88 #elif defined(VISP_HAVE_GDI)
89 display =
new vpDisplayGDI(preScanImage);
96 if (vpDisplay::getClick(preScanImage,
false))
97 captureRunning =
false;
98 vpDisplay::display(preScanImage);
99 vpDisplay::displayText(preScanImage, 20, 20, std::string(
"Click to exit..."), vpColor::red);
100 vpDisplay::flush(preScanImage);
102 }
while (captureRunning);
116 std::cout <<
"You should intall Qt5 (with wigdets and network modules), FFTW and GDI or X11 to run this tutorial"
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)