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/usNetworkGrabberPostScan2D.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();
51 #if defined(VISP_HAVE_X11)
53 #elif defined(VISP_HAVE_GDI)
56 bool displayInit =
false;
58 bool captureRunning =
true;
74 std::cout <<
"send update" << std::endl;
76 std::cout <<
"end update" << std::endl;
79 std::cout <<
"waiting ultrasound initialisation..." << std::endl;
83 grabbedFrame = qtGrabber->
acquire();
85 std::cout <<
"MAIN THREAD received frame No : " << grabbedFrame->
getFrameCount() << std::endl;
87 std::cout << *grabbedFrame << std::endl;
90 if (!displayInit && grabbedFrame->getHeight() != 0 && grabbedFrame->getWidth() != 0) {
91 #if defined(VISP_HAVE_X11)
92 display =
new vpDisplayX(*grabbedFrame);
93 #elif defined(VISP_HAVE_GDI)
94 display =
new vpDisplayGDI(*grabbedFrame);
102 if (vpDisplay::getClick(*grabbedFrame,
false))
103 captureRunning =
false;
104 vpDisplay::display(*grabbedFrame);
105 vpDisplay::displayText(*grabbedFrame, 20, 20, std::string(
"Click to exit..."), vpColor::red);
106 vpDisplay::flush(*grabbedFrame);
108 }
while (captureRunning);
122 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 post-scan frames from the ultrasound station on the network.
usFrameGrabbedInfo< usImagePostScan2D< unsigned char > > * acquire()
void activateRecording(std::string path)
void useVpDisplay(vpDisplay *display)
bool initAcquisition(const usNetworkGrabber::usInitHeaderSent &header)
bool sendAcquisitionParameters()
void setPostScanWidth(int postScanWidth)
void setPostScanHeigh(int postScanHeigh)
void setPostScanMode(bool postScanMode)
void setImageDepth(int imageDepth)
void setMotorPosition(int motorPosition)