Skip to content

Commit

Permalink
fix: ZCYX doesn't throw error but corrected to CZYX
Browse files Browse the repository at this point in the history
  • Loading branch information
qin-yu committed Dec 19, 2024
1 parent a01e65c commit cfb9c14
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion plantseg/core/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,10 @@ def _check_shape(self, data: np.ndarray, properties: ImageProperties) -> tuple[n
return data[:, 0], properties

elif self.image_layout == ImageLayout.ZCYX:
raise ValueError(f"Image layout {self.image_layout} not supported, should have been converted to CZYX")
logger.warning("Image layout is ZCYX but should have been converted to CZYX. PlantSeg is doing this now.")
properties.image_layout = ImageLayout.CZYX
data = np.moveaxis(data, 0, 1)
return self._check_shape(data, properties)

return data, properties

Expand Down

0 comments on commit cfb9c14

Please sign in to comment.