|
25 | 25 | from plotpy.panels.csection import csplot, cswidget |
26 | 26 | from qtpy import QtCore as QC |
27 | 27 | from qtpy.QtWidgets import QApplication, QMainWindow |
28 | | -from qwt import QwtLinearScaleEngine |
| 28 | +from qwt import QwtLinearScaleEngine, QwtScaleDraw |
29 | 29 | from qwt import QwtLogScaleEngine as QwtLog10ScaleEngine |
30 | | -from qwt import QwtScaleDraw |
31 | 30 |
|
32 | 31 | from cdl.config import APP_NAME, _ |
33 | 32 | from cdl.core.model.signal import create_signal |
@@ -92,12 +91,29 @@ def select(self): |
92 | 91 |
|
93 | 92 | # Adding centroid parameter to the image stats tool |
94 | 93 | @monkeypatch_method(plotpy.items.BaseImageItem, "ImageItem") |
95 | | -def get_stats(self, x0, y0, x1, y1): |
| 94 | +def get_stats( |
| 95 | + self, |
| 96 | + x0: float, |
| 97 | + y0: float, |
| 98 | + x1: float, |
| 99 | + y1: float, |
| 100 | + show_surface: bool = False, |
| 101 | + show_integral: bool = False, |
| 102 | +) -> str: |
96 | 103 | """Return formatted string with stats on image rectangular area |
97 | | - (output should be compatible with AnnotatedShape.get_infos)""" |
| 104 | + (output should be compatible with AnnotatedShape.get_infos) |
| 105 | +
|
| 106 | + Args: |
| 107 | + x0: X0 |
| 108 | + y0: Y0 |
| 109 | + x1: X1 |
| 110 | + y1: Y1 |
| 111 | + show_surface: Show surface (Default value = False) |
| 112 | + show_integral: Show integral (Default value = False) |
| 113 | + """ |
98 | 114 | with warnings.catch_warnings(): |
99 | 115 | warnings.simplefilter("ignore", UserWarning) |
100 | | - txt = self._old_ImageItem_get_stats(x0, y0, x1, y1) |
| 116 | + txt = self._old_ImageItem_get_stats(x0, y0, x1, y1, show_surface, show_integral) |
101 | 117 | ix0, iy0, ix1, iy1 = self.get_closest_index_rect(x0, y0, x1, y1) |
102 | 118 | data = self.data[iy0:iy1, ix0:ix1] |
103 | 119 |
|
|
0 commit comments