Skip to content

Commit

Permalink
added loading layer machinery
Browse files Browse the repository at this point in the history
  • Loading branch information
melonora committed Apr 3, 2024
1 parent 4d306df commit 7c049f3
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/cell_gater/widgets/scatter_widget.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

from copy import copy

from dask_image.imread import imread
Expand Down Expand Up @@ -71,12 +73,13 @@ def viewer(self) -> Viewer:
def viewer(self, viewer: Viewer) -> None:
self._viewer = viewer

def _read_data(self, sample) -> None:
image_path = self.model.sample_image_mapping[sample]
mask_path = self.model.sample_mask_mapping[sample]
def _read_data(self, sample: str | None) -> None:
if sample is not None:
image_path = self.model.sample_image_mapping[sample]
mask_path = self.model.sample_mask_mapping[sample]

self._image = imread(image_path)
self._mask = imread(mask_path)
self._image = imread(image_path)
self._mask = imread(mask_path)

def _load_layers(self, marker_index):
if self.model.active_sample != self._current_sample:
Expand Down

0 comments on commit 7c049f3

Please sign in to comment.