-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Labels
Description
Is your feature request related to a problem? Please describe.
Currently DataStats supports Ndarray or Tensor and breaks by default for any other data type if the shape attribute is not available.
There are four items for DataStats and in the default behavior,
- data_type: Works irrespective of the provided type.
- data_shape: Breaks when
shapeattribute is missing - value_range: Works irrespective of provided type as there is a conditional check for type
- data_value: Off by default
Describe the solution you'd like
Could we streamline 2 and 3 so that there is a conditional check for the data_shape similar to type checks for value_range?
MONAI/monai/transforms/utility/array.py
Line 754 in 8e99af5
| if self.value_range if value_range is None else value_range: |
It makes sense that they would work the same and either both break by default or handle arbitrary types by default.
Describe alternatives you've considered
Setting data_shape to False explicitly works for arbitrary types.
wyli