From c71c1f4d5d9f78aba5ee3d2a115c0a43444d69e3 Mon Sep 17 00:00:00 2001 From: Paul McCarthy <pauldmccarthy@gmail.com> Date: Thu, 22 Aug 2019 13:26:24 +0100 Subject: [PATCH] ENH: Simple Image.iscomplex method --- fsl/data/image.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/fsl/data/image.py b/fsl/data/image.py index dd423d4b5..2e7573389 100644 --- a/fsl/data/image.py +++ b/fsl/data/image.py @@ -1195,6 +1195,14 @@ class Image(Nifti): else: return nvals + @property + def iscomplex(self): + """Returns ``True`` if this image has a complex data type, ``False`` + otherwise. + """ + return np.issubdtype(self.dtype, np.complexfloating) + + @Nifti.voxToWorldMat.setter def voxToWorldMat(self, xform): """Overrides the :meth:`Nifti.voxToWorldMat` property setter. -- GitLab