Skip to content

Commit

Permalink
use get_effective_scale to simplify the scale property
Browse files Browse the repository at this point in the history
  • Loading branch information
pattonw committed Dec 11, 2024
1 parent 67848bc commit 6fc5ad6
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions iohub/ngff/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -969,19 +969,7 @@ def scale(self) -> list[float]:
Helper function for scale transform metadata of
highest resolution scale.
"""
scale = [1] * self.data.ndim
transforms = (
self.metadata.multiscales[0].datasets[0].coordinate_transformations
)
for trans in transforms:
if trans.type == "scale":
if len(trans.scale) != len(scale):
raise RuntimeError(
f"Length of scale transformation {len(trans.scale)} "
f"does not match data dimension {len(scale)}."
)
scale = [s1 * s2 for s1, s2 in zip(scale, trans.scale)]
return scale
return self.get_effective_scale("*").scale

@property
def axis_names(self) -> list[str]:
Expand Down

0 comments on commit 6fc5ad6

Please sign in to comment.