We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4910814 commit dccabffCopy full SHA for dccabff
src/imagej/dims.py
@@ -284,7 +284,13 @@ def _get_scale(axis):
284
:return: The scale for this axis or None if it is a non-numeric scale.
285
"""
286
try:
287
- return axis.values[1] - axis.values[0]
+ # HACK: This axis length check is a work around for singleton dimensions.
288
+ # You can't calculate the slope of a singleton dimension.
289
+ # This section will be removed when axis-scale-logic is merged.
290
+ if len(axis) <= 1:
291
+ return 1
292
+ else:
293
+ return axis.values[1] - axis.values[0]
294
except TypeError:
295
return None
296
0 commit comments