From 6be5e64151369a414e5ea69fe828b6b49ad203f2 Mon Sep 17 00:00:00 2001 From: Paul McCarthy <pauld.mccarthy@gmail.com> Date: Wed, 15 Jun 2016 17:36:27 +0100 Subject: [PATCH] Image.save method stub. --- fsl/data/image.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/fsl/data/image.py b/fsl/data/image.py index 36d02ad0e..cb672750c 100644 --- a/fsl/data/image.py +++ b/fsl/data/image.py @@ -610,8 +610,22 @@ class Image(Nifti1, notifier.Notifier): def save(self, filename=None): + """Saves this ``Image`` to the specifed file, or the :attr:`dataSource` + if ``filename`` is ``None``. + """ + + if self.__dataSource is None and filename is None: + raise ValueError('A file name must be specified') + + if filename is None: + filename = self.__dataSource + + log.debug('Saving {} to {}'.format(self.name, filename)) + raise NotImplementedError() + # TODO Update self.__dataSource if necessary + def __getitem__(self, sliceobj): """Access the image data with the specified ``sliceobj``. -- GitLab