diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 14cc6e7d23f0895984759b962a6047e6f662f284..7a11efa4b0ea2f997f135b14cc084511ca701da6 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -24,6 +24,9 @@ Deprecated ``canHaveGui``, ``inSSHSession``, ``inVNCSession``, ``wxPlatform``, ``wxFlavour``, ``glVersion``, ``glRenderer``, and ``glIsSoftwareRenderer``. Equivalent functions are being added to the ``fsleyes-widgets`` library. +* The :mod:`fsl.utils.filetree` package has been deprecated, and will be + removed in a future version of ``fslpy`` - it is now published as a separate + library on [PyPI](https://pypi.org/project/file-tree/). diff --git a/fsl/data/imagewrapper.py b/fsl/data/imagewrapper.py index b7d5b3577c903a9bf434d14cbc8647a243c4bfd2..771f288a24c1719e66cb4b9812f1f613edf6ed71 100644 --- a/fsl/data/imagewrapper.py +++ b/fsl/data/imagewrapper.py @@ -733,7 +733,7 @@ def isValidFancySliceObj(sliceobj, shape): # We only support boolean numpy arrays # which have the same shape as the image return (isinstance(sliceobj, np.ndarray) and - sliceobj.dtype == np.bool and + sliceobj.dtype == bool and np.prod(sliceobj.shape) == np.prod(shape)) diff --git a/fsl/data/mesh.py b/fsl/data/mesh.py index 30b4548f5c7ce9c46561e00b693ecb29f30a8f18..b03a628e2eec368f592a1d84a913b1302d9e2d00 100644 --- a/fsl/data/mesh.py +++ b/fsl/data/mesh.py @@ -701,7 +701,7 @@ def calcVertexNormals(vertices, indices, fnormals): the mesh. """ - vnormals = np.zeros((vertices.shape[0], 3), dtype=np.float) + vnormals = np.zeros((vertices.shape[0], 3), dtype=float) # TODO make fast. I can't figure # out how to use np.add.at to diff --git a/fsl/transform/affine.py b/fsl/transform/affine.py index 47bdd4b371d0d1a9a26b19177795c0b4290b74c3..119c5335fdafa698f0e1192291c9ac66225767e9 100644 --- a/fsl/transform/affine.py +++ b/fsl/transform/affine.py @@ -627,8 +627,8 @@ def rescale(oldShape, newShape, origin=None): if origin is None: origin = 'centre' - oldShape = np.array(oldShape, dtype=np.float) - newShape = np.array(newShape, dtype=np.float) + oldShape = np.array(oldShape, dtype=float) + newShape = np.array(newShape, dtype=float) ndim = len(oldShape) if len(oldShape) != len(newShape): diff --git a/fsl/utils/filetree/__init__.py b/fsl/utils/filetree/__init__.py index 05ce5dd0a420044c16cfdce27a8ed99b419f0875..f037014ea390477bff20fb289d99d596802cff3e 100644 --- a/fsl/utils/filetree/__init__.py +++ b/fsl/utils/filetree/__init__.py @@ -289,7 +289,7 @@ of the short variable names defined in the Running a pipeline on a subset of participants/sessions/runs ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Suppose you want to run your pipeline on a subset of your data while testing. +Suppose you want to run your pipeline on a subset of your data while testing. You may want to do this if your data has a a hierarchy of variables (e.g. participant, session, run) as in the example below. :: @@ -321,3 +321,12 @@ __author__ = 'Michiel Cottaar <Michiel.Cottaar@ndcn.ox.ac.uk>' from .filetree import FileTree, register_tree, MissingVariable from .parse import tree_directories, list_all_trees from .query import FileTreeQuery + +import fsl.utils.deprecated as deprecated + +deprecated.warn('fsl.utils.filetree', + vin='3.6.0', + rin='4.0.0', + msg='The filetree package is now released as a separate ' + 'Python library ("file-tree" on PyPi), and will be ' + 'removed in a future version of fslpy.') diff --git a/fsl/utils/image/resample.py b/fsl/utils/image/resample.py index f5918fad29f18ff0912968c56293ed67ac44c0ae..9f82be65975a3bd30dfb25a769a76caa4513219c 100644 --- a/fsl/utils/image/resample.py +++ b/fsl/utils/image/resample.py @@ -209,7 +209,7 @@ def resample(image, np.all(np.isclose(matrix, np.eye(len(newShape) + 1))): return data, image.voxToWorldMat - newShape = np.array(np.round(newShape), dtype=np.int) + newShape = np.array(np.round(newShape), dtype=int) # Apply smoothing if requested, # and if not using nn interp