Skip to content
Snippets Groups Projects
Commit a70efc6f authored by Paul McCarthy's avatar Paul McCarthy :mountain_bicyclist:
Browse files

RF: Change behaviour of deprecated dataRange method - returning the data range

is more keeping in line with old behaviour than returning None
parent 69c5bd17
No related branches found
No related tags found
No related merge requests found
...@@ -47,14 +47,15 @@ import numpy as np ...@@ -47,14 +47,15 @@ import numpy as np
import nibabel as nib import nibabel as nib
import nibabel.fileslice as fileslice import nibabel.fileslice as fileslice
import fsl.utils.meta as meta import fsl.utils.meta as meta
import fsl.utils.deprecated as deprecated import fsl.utils.deprecated as deprecated
import fsl.transform.affine as affine import fsl.transform.affine as affine
import fsl.utils.notifier as notifier import fsl.utils.notifier as notifier
import fsl.utils.memoize as memoize import fsl.utils.naninfrange as nir
import fsl.utils.path as fslpath import fsl.utils.memoize as memoize
import fsl.utils.bids as fslbids import fsl.utils.path as fslpath
import fsl.data.constants as constants import fsl.utils.bids as fslbids
import fsl.data.constants as constants
PathLike = Union[str, Path] PathLike = Union[str, Path]
...@@ -1329,10 +1330,15 @@ class Image(Nifti): ...@@ -1329,10 +1330,15 @@ class Image(Nifti):
@property @property
@deprecated.deprecated('3.9.0', '4.0.0', 'Use a DataManager') @deprecated.deprecated(
'3.9.0', '4.0.0', 'Access the image data directly, '
'or use a custom DataManager')
def dataRange(self): def dataRange(self):
"""Deprecated, always returns ``(None, None)``. """ """Deprecated. Returns the minimum/maxmimum image data values.
return None, None Note that calling this method may result in the image data being
loaded into memory.
"""
return nir.naninfrange(self.data)
@property @property
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment