UsTK : Ultrasound ToolKit  version 2.0.1 under development (2023-12-07)
usImageDisplayWidgetQmlOverlayServoing.h
1 /****************************************************************************
2  *
3  * This file is part of the ustk software.
4  * Copyright (C) 2016 - 2017 by Inria. All rights reserved.
5  *
6  * This software is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * ("GPL") version 2 as published by the Free Software Foundation.
9  * See the file LICENSE.txt at the root directory of this source
10  * distribution for additional information about the GNU GPL.
11  *
12  * For using ustk with software that can not be combined with the GNU
13  * GPL, please contact Inria about acquiring a ViSP Professional
14  * Edition License.
15  *
16  * This software was developed at:
17  * Inria Rennes - Bretagne Atlantique
18  * Campus Universitaire de Beaulieu
19  * 35042 Rennes Cedex
20  * France
21  *
22  * If you have questions regarding the use of this file, please contact
23  * Inria at ustk@inria.fr
24  *
25  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27  *
28  * Authors:
29  * Marc Pouliquen
30  *
31  *****************************************************************************/
32 
39 #ifndef __usImageDisplayWidgetQmlOverlayServoing_h_
40 #define __usImageDisplayWidgetQmlOverlayServoing_h_
41 
42 // VISP includes
43 #include <visp3/ustk_core/usConfig.h>
44 
45 #if (defined(USTK_HAVE_VTK_QT5) || defined(USTK_HAVE_QT5))
46 
47 #include <QPushButton>
48 #include <QQuickWidget>
49 #include <visp3/core/vpImagePoint.h>
50 #include <visp3/core/vpRectOriented.h>
51 #include <visp3/ustk_gui/usImageDisplayWidget.h>
52 
53 #include <visp3/core/vpTime.h>
54 #include <visp3/gui/vpDisplayGDI.h>
55 #include <visp3/gui/vpDisplayOpenCV.h>
56 #include <visp3/gui/vpPlot.h>
57 
66 {
67  Q_OBJECT
68 public:
71 
72  void resizeEvent(QResizeEvent *event);
73 
74 public slots:
75  void enableFeaturesDisplay();
76  void disableFeaturesDisplay();
77  void updateRectPosition(vpRectOriented newRectangle);
78  void updateConfidenceAngle(double scanline);
79  void updateConfidenceMap(usImagePreScan2D<unsigned char> confidence);
81  void updateXError(double error);
82  void startTrackingSlot();
83 
84 signals:
85  void startTrackingRect(vpRectOriented);
89 
90 private:
91  vpImagePoint displayImageToRealImageDimentions(const vpImagePoint displayPoint);
92  vpImagePoint realImageToDisplayImageDimentions(const vpImagePoint realImagePoint);
93 
94  vpRectOriented displayImageToRealImageDimentions(const vpRectOriented displayRectangle);
95  vpRectOriented realImageToDisplayImageDimentions(const vpRectOriented realRectangle);
96 
97  QQuickWidget *m_qQuickOverlay;
98  bool m_isTrackingRect;
99  bool m_isServoingRect;
100  bool m_isServoingConfidence;
101 
102  // optionnal features displays
103  bool m_useFeatureDisplay;
104  usImagePreScan2D<unsigned char> m_confidence;
105  vpPlot m_plot;
106  double m_startTime;
107 #if defined(VISP_HAVE_GDI)
108  vpDisplayGDI *m_display;
109 #elif defined(VISP_HAVE_OPENCV)
110  vpDisplayOpenCV *m_display;
111 #endif
112 };
113 #endif // QT && ELASTOGRAPHY
114 #endif // __usImageDisplayWidgetQmlOverlayServoing_h_
Qt widget class for 2D ultrasound image display, containing robot control tools for visual servoing o...
void startTrackingRect(vpRectOriented)
Qt widget class for 2D ultrasound image display.
void updateFrame(const vpImage< unsigned char > img)
void resizeEvent(QResizeEvent *event)