GUI: Add spot ice ratio to the drop down panel and grid scan result visualisation. Fixed bug where spot count (ice) wasn't being correctly parsed to the GUI.
This commit is contained in:
@@ -83,6 +83,7 @@ class RasterDataCollectionPanel(ScanSettingsPanel):
|
||||
self.metric_combo.addItem("Spot count (low res.)", RasterGridMetric.SPOTS_LOW_RES)
|
||||
self.metric_combo.addItem("Spot count (indexed)", RasterGridMetric.SPOTS_INDEXED)
|
||||
self.metric_combo.addItem("Spot count (ice)", RasterGridMetric.SPOTS_ICE)
|
||||
self.metric_combo.addItem("Spot ratio (ice/low res.)", RasterGridMetric.SPOTS_ICE_LOW_RES)
|
||||
self.metric_combo.addItem("Background estimate", RasterGridMetric.BKG)
|
||||
self.metric_combo.addItem("Indexing result", RasterGridMetric.INDEXING)
|
||||
self.metric_combo.addItem("Mosaicity", RasterGridMetric.MOS)
|
||||
|
||||
@@ -23,6 +23,7 @@ class RasterGridMetric(Enum):
|
||||
RES = 6
|
||||
SPOTS_ICE = 7
|
||||
SPOTS_INDEXED = 8
|
||||
SPOTS_ICE_LOW_RES = 9
|
||||
|
||||
def float_to_viridis_brush(value: float, alpha: int = 127) -> QBrush:
|
||||
"""
|
||||
@@ -265,6 +266,12 @@ class RasterGridManager(QObject):
|
||||
if grid.result.images[cell].spots is not None and grid.result.images[cell].spots >= 0:
|
||||
txt += f"Spot count {grid.result.images[cell].spots}<br/>"
|
||||
|
||||
if grid.result.images[cell].spots_ice is not None and grid.result.images[cell].spots_ice >= 0:
|
||||
txt += f"Spot count (ice) {grid.result.images[cell].spots_ice}<br/>"
|
||||
|
||||
if self.spot_ice_ratio(grid.result.images[cell]) is not None and self.spot_ice_ratio(grid.result.images[cell]) >= 0:
|
||||
txt += f"Spot ratio (ice/low res.) {self.spot_ice_ratio(grid.result.images[cell])}<br/>"
|
||||
|
||||
if grid.result.images[cell].spots_low_res is not None and grid.result.images[cell].spots_low_res >= 0:
|
||||
txt += f"Spot count (low res.) {grid.result.images[cell].spots_low_res}<br/>"
|
||||
|
||||
@@ -301,6 +308,13 @@ class RasterGridManager(QObject):
|
||||
grid = copy.deepcopy(self.__active_grid)
|
||||
self.grid_scan.emit(grid)
|
||||
|
||||
|
||||
def spot_ice_ratio(self, obj):
|
||||
if obj.spots_ice is None or obj.spots_low_res is None or obj.spots_low_res <= 0:
|
||||
return None
|
||||
else:
|
||||
return obj.spots_ice / obj.spots_low_res
|
||||
|
||||
def draw_grid(self, painter: QPainter, alpha: int = 127):
|
||||
self._draw_grid(painter, self.__active_grid)
|
||||
for i in self.__completed_grids:
|
||||
@@ -322,6 +336,8 @@ class RasterGridManager(QObject):
|
||||
v = [obj.res for obj in i.result.images]
|
||||
case RasterGridMetric.SPOTS_ICE:
|
||||
v = [obj.spots_ice for obj in i.result.images]
|
||||
case RasterGridMetric.SPOTS_ICE_LOW_RES:
|
||||
v = [self.spot_ice_ratio(obj) for obj in i.result.images]
|
||||
case RasterGridMetric.SPOTS_INDEXED:
|
||||
v = [obj.spots_indexed for obj in i.result.images]
|
||||
self._draw_grid(painter, i.request, v, alpha)
|
||||
|
||||
Reference in New Issue
Block a user