File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -279,6 +279,16 @@ def __add__(self, b):
279
279
280
280
return TransformChain (transforms = [self , b ])
281
281
282
+ def __len__ (self ):
283
+ """
284
+ Enable ``len()``.
285
+
286
+ By default, all transforms are of length one.
287
+ This must be overriden by transforms arrays and chains.
288
+
289
+ """
290
+ return 1
291
+
282
292
@property
283
293
def reference (self ):
284
294
"""Access a reference space where data will be resampled onto."""
Original file line number Diff line number Diff line change @@ -94,10 +94,6 @@ def __repr__(self):
94
94
"""Beautify the python representation."""
95
95
return f"<{ self .__class__ .__name__ } [{ self ._field .shape [- 1 ]} D] { self ._field .shape [:3 ]} >"
96
96
97
- def __len__ (self ):
98
- """Enable len() -- for compatibility, only len == 1 is supported."""
99
- return 1
100
-
101
97
@property
102
98
def ndim (self ):
103
99
"""Get the dimensions of the transform."""
You can’t perform that action at this time.
0 commit comments