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))
8 #include <QApplication>
10 #include <QtCore/QThread>
12 #include <visp3/ustk_grabber/usNetworkGrabberPreScan2D.h>
14 #include <visp3/gui/vpDisplayGDI.h>
15 #include <visp3/gui/vpDisplayX.h>
17 int main(
int argc,
char **argv)
20 QApplication app(argc, argv);
26 if (qApp->arguments().contains(QString(
"--record"))) {
28 qApp->arguments().at(qApp->arguments().indexOf(QString(
"--record")) + 1).toStdString());
33 if (qApp->arguments().contains(QString(
"--probeID"))) {
34 header.
probeId = qApp->arguments().at(qApp->arguments().indexOf(QString(
"--probeID")) + 1).toInt();
38 if (qApp->arguments().contains(QString(
"--slotID"))) {
39 header.
slotId = qApp->arguments().at(qApp->arguments().indexOf(QString(
"--slotID")) + 1).toInt();
43 if (qApp->arguments().contains(QString(
"--imagingMode"))) {
44 header.
imagingMode = qApp->arguments().at(qApp->arguments().indexOf(QString(
"--imagingMode")) + 1).toInt();
52 #if defined(VISP_HAVE_X11)
54 #elif defined(VISP_HAVE_GDI)
57 bool displayInit =
false;
59 bool captureRunning =
true;
72 grabbedFrame = qtGrabber->
acquire();
74 std::cout <<
"MAIN THREAD received frame No : " << grabbedFrame->
getFrameCount() << std::endl;
77 if (!displayInit && grabbedFrame->getHeight() != 0 && grabbedFrame->getWidth() != 0) {
78 #if defined(VISP_HAVE_X11)
79 display =
new vpDisplayX(*grabbedFrame);
80 #elif defined(VISP_HAVE_GDI)
81 display =
new vpDisplayGDI(*grabbedFrame);
89 if (vpDisplay::getClick(*grabbedFrame,
false))
90 captureRunning =
false;
91 vpDisplay::display(*grabbedFrame);
92 vpDisplay::displayText(*grabbedFrame, 20, 20, std::string(
"Click to exit..."), vpColor::red);
93 vpDisplay::flush(*grabbedFrame);
95 }
while (captureRunning);
109 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 pre-scan frames from the ultrasound station on the network.
void activateRecording(std::string path)
usFrameGrabbedInfo< usImagePreScan2D< unsigned char > > * acquire()
void useVpDisplay(vpDisplay *display)
bool initAcquisition(const usNetworkGrabber::usInitHeaderSent &header)
bool sendAcquisitionParameters()
void setMotorPosition(int motorPosition)