From 0e2f5e88000f281760d50b7338d5f7b608f03fa8 Mon Sep 17 00:00:00 2001 From: Paul McCarthy <pauldmccarthy@gmail.com> Date: Sun, 27 Aug 2017 13:09:06 -0700 Subject: [PATCH] Put is4DImage back, but deprecate it --- fsl/data/image.py | 9 +++++++++ requirements.txt | 1 + 2 files changed, 10 insertions(+) diff --git a/fsl/data/image.py b/fsl/data/image.py index c80158cb6..383f02b63 100644 --- a/fsl/data/image.py +++ b/fsl/data/image.py @@ -38,6 +38,7 @@ import string import logging import six +import deprecation import numpy as np import nibabel as nib @@ -458,6 +459,14 @@ class Nifti(notifier.Notifier): return len(self.__shape) + @deprecation.deprecated(deprecated_in='1.1.0', + removed_in='1.2.0', + details='Use ndims instead') + def is4DImage(self): + """Returns ``True`` if this image is 4D, ``False`` otherwise. """ + return len(self.__shape) > 3 and self.__shape[3] > 1 + + def getXFormCode(self, code=None): """This method returns the code contained in the NIFTI header, indicating the space to which the (transformed) image is oriented. diff --git a/requirements.txt b/requirements.txt index 55d5ba946..cc0e8d8a0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,5 @@ six==1.* +deprecation=1.* numpy==1.* nibabel==2.* indexed_gzip==0.3.* -- GitLab