1
0
Fork 0

use max size of all images in stack

This commit is contained in:
Sean Sube 2024-01-05 21:19:48 -06:00
parent b5ed1101b4
commit 058a0f1c0a
Signed by: ssube
GPG Key ID: 3EED7B957D362AF1
2 changed files with 7 additions and 5 deletions

View File

@ -231,9 +231,7 @@ class ChainPipeline:
) )
metadata = stage_sources.metadata metadata = stage_sources.metadata
stage_sources = StageResult( stage_sources = StageResult(images=stage_results, metadata=metadata)
images=stage_results, metadata=metadata
)
else: else:
logger.debug( logger.debug(
"image does not contain sources and is within tile size of %s, running stage", "image does not contain sources and is within tile size of %s, running stage",

View File

@ -327,10 +327,14 @@ class StageResult:
def size(self) -> Size: def size(self) -> Size:
if self.images is not None: if self.images is not None:
return Size(self.images[0].width, self.images[0].height) return Size(
max([image.width for image in self.images]),
max([image.height for image in self.images]),
)
elif self.arrays is not None: elif self.arrays is not None:
return Size( return Size(
self.arrays[0].shape[0], self.arrays[0].shape[1] max([array.shape[0] for array in self.arrays]),
max([array.shape[1] for array in self.arrays]),
) # TODO: which fields within the shape are width/height? ) # TODO: which fields within the shape are width/height?
else: else:
return Size(0, 0) return Size(0, 0)