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/ustk_confidence_map/usScanlineConfidence2D.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);
29 if (qApp->arguments().contains(QString(
"--probeID"))) {
30 header.
probeId = qApp->arguments().at(qApp->arguments().indexOf(QString(
"--probeID")) + 1).toInt();
34 if (qApp->arguments().contains(QString(
"--slotID"))) {
35 header.
slotId = qApp->arguments().at(qApp->arguments().indexOf(QString(
"--slotID")) + 1).toInt();
39 if (qApp->arguments().contains(QString(
"--imagingMode"))) {
40 header.
imagingMode = qApp->arguments().at(qApp->arguments().indexOf(QString(
"--imagingMode")) + 1).toInt();
49 #if defined(VISP_HAVE_X11)
51 vpDisplayX *displayConf = NULL;
52 #elif defined(VISP_HAVE_GDI)
54 vpDisplayGDI *displayConf = NULL;
57 bool displayInit =
false;
62 bool captureRunning =
true;
71 grabbedFrame = qtGrabber->
acquire();
72 confidenceProcessor.
run(confidence, *grabbedFrame);
76 std::cout <<
"MAIN THREAD received frame No : " << grabbedFrame->
getFrameCount() << std::endl;
78 std::cout << *grabbedFrame << std::endl;
81 if (!displayInit && grabbedFrame->getHeight() != 0 && grabbedFrame->getWidth() != 0) {
82 #if defined(VISP_HAVE_X11)
83 display =
new vpDisplayX(*grabbedFrame);
84 displayConf =
new vpDisplayX(confidence);
85 #elif defined(VISP_HAVE_GDI)
86 display =
new vpDisplayGDI(*grabbedFrame);
87 displayConf =
new vpDisplayGDI(confidence);
95 if (vpDisplay::getClick(*grabbedFrame,
false))
96 captureRunning =
false;
97 vpDisplay::display(*grabbedFrame);
98 vpDisplay::displayText(*grabbedFrame, 20, 20, std::string(
"Click to exit..."), vpColor::red);
99 vpDisplay::flush(*grabbedFrame);
100 vpDisplay::display(confidence);
101 vpDisplay::displayText(confidence, 20, 20, std::string(
"Click to exit..."), vpColor::red);
102 vpDisplay::flush(confidence);
105 }
while (captureRunning);
120 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.
usFrameGrabbedInfo< usImagePreScan2D< unsigned char > > * acquire()
void useVpDisplay(vpDisplay *display)
bool initAcquisition(const usNetworkGrabber::usInitHeaderSent &header)
Process a pre-scan image to determine the confidence map.
void run(usImagePreScan2D< unsigned char > &preScanConfidence, const usImagePreScan2D< unsigned char > &preScanImage)