You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 shape attribute 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?
Fixes#6844.
### Description
DataStats was breaking for arbitrary types (other than tensor or array)
because of shape attribute. Changes are made in order to be consistent
with other DataStats attributes management like `data_type`.
### Types of changes
<!--- Put an `x` in all the boxes that apply, and remove the not
applicable items -->
- [x] Non-breaking change (fix or new feature that would not break
existing functionality).
- [ ] Breaking change (fix or new feature that would cause existing
functionality to change).
- [ ] New tests added to cover the changes.
- [ ] Integration tests passed locally by running `./runtests.sh -f -u
--net --coverage`.
- [ ] Quick tests passed locally by running `./runtests.sh --quick
--unittests --disttests`.
- [ ] In-line docstrings updated.
- [ ] Documentation updated, tested `make html` command in the `docs/`
folder.
---------
Signed-off-by: vgrau98 <[email protected]>
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 theshape
attribute is not available.There are four items for DataStats and in the default behavior,
shape
attribute is missingDescribe 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 forvalue_range
?MONAI/monai/transforms/utility/array.py
Line 754 in 8e99af5
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
toFalse
explicitly works for arbitrary types.The text was updated successfully, but these errors were encountered: