From 81cb7c6039d3a7dcb7d36d5866e8a29cc91f765d Mon Sep 17 00:00:00 2001 From: Paul McCarthy <pauldmccarthy@gmail.com> Date: Fri, 29 Nov 2019 18:09:12 +0000 Subject: [PATCH] DOC: clarify --- fsl/data/image.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fsl/data/image.py b/fsl/data/image.py index f000abd59..7eaf53f4f 100644 --- a/fsl/data/image.py +++ b/fsl/data/image.py @@ -847,6 +847,10 @@ class Nifti(notifier.Notifier, meta.Meta): See :func:`.affine.rescale` for the meaning of the ``origin`` argument. + Only the spatial dimensions may be adjusted - use the functions in + the :mod:`.image.resample` module if you need to adjust non-spatial + dimensions. + :arg pixdim: New voxel dimensions :arg shape: New image shape :arg origin: Voxel grid alignment - either ``'centre'`` (the default) @@ -872,7 +876,8 @@ class Nifti(notifier.Notifier, meta.Meta): oldPixdim = np.array(self.pixdim[:npixdim]) newShape = oldShape * (oldPixdim / newPixdim) - # pad shape to full dimensions + # We only allow adjustment of + # the spatial dimensions if len(newShape) != 3: raise ValueError('Three dimensions must be specified') -- GitLab