Skip to content

Commit

Permalink
Merge pull request #16 from TheJacksonLaboratory/dev
Browse files Browse the repository at this point in the history
Added ROIs to labels for matching pairs of inputs and labels
  • Loading branch information
fercer authored Oct 11, 2024
2 parents 31145db + 158a7bb commit 2321b01
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/napari_activelearning/_acquisition.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ def _prepare_datasets_metadata(
dataset_metadata[layer_type] = layers_group.metadata
dataset_metadata[layer_type]["roi"] = None

if "images" in layer_type:
if layer_type in ["images", "labels"]:
dataset_metadata[layer_type]["roi"] = [tuple(
slice(0, ax_s - ax_s % self._patch_sizes.get(ax, 1))
if (ax != "C"
Expand All @@ -363,6 +363,8 @@ def _prepare_datasets_metadata(
else slice(None)
for ax, ax_s in zip(displayed_source_axes,
displayed_shape)
if (layer_type == "images"
or (layer_type == "labels" and ax != "C"))
)]

if isinstance(dataset_metadata[layer_type]["filenames"],
Expand Down

0 comments on commit 2321b01

Please sign in to comment.