UsTK : Ultrasound ToolKit  version 2.0.1 under development (2025-02-01)
tutorial-image-display-qwidget.cpp
1 
3 #include <iostream>
4 #include <visp3/ustk_core/usConfig.h>
5 
6 #if defined(VISP_HAVE_MODULE_USTK_GUI)
7 
8 #include <visp3/ustk_core/usImageIo.h>
9 #include <visp3/ustk_gui/usImageDisplayWidget.h>
10 
11 #include <QApplication>
12 #include <QMainWindow>
13 
14 int main(int argc, char **argv)
15 {
16  if (us::getDataSetPath().empty()) {
17  std::cout << "You should fill USTK_DATASET_PATH to run this example\n";
18  return 0;
19  }
20 
21  QApplication app(argc, argv);
22  app.setApplicationName(QString("USTK elastography demo"));
23 
25  usImageIo::read(preScan, us::getDataSetPath() + "/pre-scan/2D_xml/prescan2d.xml");
26 
28  widget->updateFrame(preScan);
29 
30  QMainWindow window;
31  window.setCentralWidget(widget);
32  window.showMaximized();
33 
34  return app.exec();
35 }
36 
37 #else
38 int main()
39 {
40  std::cout << "You should build ustk_gui to run this tutorial" << std::endl;
41  return 0;
42 }
43 
44 #endif
Qt widget class for 2D ultrasound image display.
void updateFrame(const vpImage< unsigned char > img)
static void read(usImageRF2D< short int > &imageRf2D, const std::string &headerFileName)
Definition: usImageIo.cpp:153
VISP_EXPORT std::string getDataSetPath()
Definition: us.cpp:54