4 #include <visp3/ustk_core/usConfig.h>
6 #if (defined(USTK_HAVE_QT5) || defined(USTK_HAVE_VTK_QT)) && \
7 (defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI) || defined(VISP_HAVE_OPENCV))
9 #include <QApplication>
10 #include <QStringList>
11 #include <QtCore/QThread>
13 #include <visp3/ustk_core/usImageIo.h>
14 #include <visp3/ustk_core/usRFToPreScan2DConverter.h>
15 #include <visp3/ustk_grabber/usNetworkGrabberRF2D.h>
17 #include <visp3/gui/vpDisplayGDI.h>
18 #include <visp3/gui/vpDisplayOpenCV.h>
19 #include <visp3/gui/vpDisplayX.h>
21 int main(
int argc,
char **argv)
24 QApplication app(argc, argv);
31 if (qApp->arguments().contains(QString(
"--output"))) {
33 qApp->arguments().at(qApp->arguments().indexOf(QString(
"--output")) + 1).toStdString());
49 #if defined(VISP_HAVE_X11)
50 vpDisplayX *
display =
new vpDisplayX();
51 #elif defined(VISP_HAVE_GDI)
52 vpDisplayGDI *
display =
new vpDisplayGDI();
53 #elif defined(VISP_HAVE_OPENCV)
54 vpDisplayOpenCV *
display =
new vpDisplayOpenCV();
57 bool captureRunning =
true;
58 bool displayInit =
false;
62 std::cout <<
"init success" << std::endl;
65 std::cout <<
"waiting ultrasound initialisation..." << std::endl;
70 grabbedFrame = qtGrabber->
acquire();
72 std::cout <<
"MAIN THREAD received frame No : " << grabbedFrame->
getFrameCount() << std::endl;
74 converter.
convert(*grabbedFrame, preScanImage);
80 vpDisplay::display(preScanImage);
81 vpDisplay::flush(preScanImage);
85 }
while (captureRunning);
95 std::cout <<
"You should intall Qt5 (with wigdets and network modules), and display X 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)
bool isFirstFrameAvailable()
usFrameGrabbedInfo< usImageRF2D< short int > > * acquire()
bool initAcquisition(const usNetworkGrabber::usInitHeaderSent &header)
void setIPAddress(const std::string &s_ip)
2D conversion from RF signal to pre-scan image
void convert(const usImageRF2D< short int > &rfImage, usImagePreScan2D< unsigned char > &preScanImage)