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 #include <visp3/io/vpImageIo.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());
42 #if defined(VISP_HAVE_X11)
44 #elif defined(VISP_HAVE_GDI)
47 bool displayInit =
false;
49 bool captureRunning =
true;
67 std::cout <<
"send update" << std::endl;
69 std::cout <<
"end update" << std::endl;
72 std::cout <<
"waiting ultrasound initialisation..." << std::endl;
76 grabbedFrame = qtGrabber->
acquire();
78 std::cout <<
"MAIN THREAD received frame No : " << grabbedFrame->
getFrameCount() << std::endl;
80 std::cout << *grabbedFrame << std::endl;
83 snprintf(buffer, 400,
"frame%d.png", grabbedFrame->
getFrameCount());
86 vpImageIo::write(*grabbedFrame, buffer);
88 if (!displayInit && grabbedFrame->getHeight() != 0 && grabbedFrame->getWidth() != 0) {
89 #if defined(VISP_HAVE_X11)
90 display =
new vpDisplayX(*grabbedFrame);
91 #elif defined(VISP_HAVE_GDI)
92 display =
new vpDisplayGDI(*grabbedFrame);
99 vpDisplay::display(*grabbedFrame);
100 vpDisplay::flush(*grabbedFrame);
102 }
while (captureRunning);
116 std::cout <<
"You should intall Qt5 (with wigdets and network modules), and display X to run this tutorial"
@ US_ANGLE_PITCH_2
4 motor steps per frame = 0.7317 degrees
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 setFramesPerVolume(int framesPerVolume)
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 setStepsPerFrame(usAcquisitionParameters::usMotorStep stepsPerFrame)
void setMotorActivation(bool activateMotor)