Skip to content

Commit 3a4ef62

Browse files
committed
[FIX] incorrect lookup for single-scale input images
1 parent 277dc38 commit 3a4ef62

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/scportrait/pipeline/project.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
rechunk_image,
4343
remap_region_annotation_table,
4444
)
45-
from scportrait.spdata.write._helper import _get_shape, _make_key_lookup
45+
from scportrait.spdata.write._helper import _get_image, _get_shape, _make_key_lookup
4646

4747
if TYPE_CHECKING:
4848
from collections.abc import Callable
@@ -501,10 +501,8 @@ def get_project_status(self, print_status=False):
501501
self.extraction_status = True if os.path.isfile(extraction_file) else False
502502

503503
if self.input_image_status:
504-
if isinstance(self.sdata.images[self.DEFAULT_INPUT_IMAGE_NAME], xarray.DataTree):
505-
self.input_image = self.sdata.images[self.DEFAULT_INPUT_IMAGE_NAME]["scale0"].image
506-
elif isinstance(self.sdata.images[self.DEFAULT_INPUT_IMAGE_NAME], xarray.DataArray):
507-
self.input_image = self.sdata.images[self.DEFAULT_INPUT_IMAGE_NAME].image
504+
if self.DEFAULT_INPUT_IMAGE_NAME in self.sdata:
505+
self.input_image = _get_image(self.sdata[self.DEFAULT_INPUT_IMAGE_NAME])
508506
else:
509507
self.input_image = None
510508

0 commit comments

Comments
 (0)