diff --git a/fsl/data/bitmap.py b/fsl/data/bitmap.py index 0e5c9b4136e05ad5d06b25131fa2196d677de110..299534f548fbdb11f68838c68cd45805669bd12f 100644 --- a/fsl/data/bitmap.py +++ b/fsl/data/bitmap.py @@ -167,4 +167,6 @@ class Bitmap(object): data = np.array(data, order='F', copy=False) - return fslimage.Image(data, name=self.name) + return fslimage.Image(data, + name=self.name, + dataSource=self.dataSource) diff --git a/fsl/data/image.py b/fsl/data/image.py index 417a0445ceccd64f6bcc28d7abc1d2214c2de32d..1bf901c287d5c2ba3ea033e11f08fdb79cc55e3d 100644 --- a/fsl/data/image.py +++ b/fsl/data/image.py @@ -809,6 +809,7 @@ class Image(Nifti): """ nibImage = None + saved = False if indexed is not False: warnings.warn('The indexed argument is deprecated ' @@ -841,10 +842,10 @@ class Image(Nifti): # The image parameter may be the name of an image file if isinstance(image, six.string_types): - image = op.abspath(addExt(image)) nibImage = nib.load(image, **kwargs) dataSource = image + saved = True # Or a numpy array - we wrap it in a nibabel image, # with an identity transformation (each voxel maps @@ -906,7 +907,7 @@ class Image(Nifti): self.__dataSource = dataSource self.__threaded = threaded self.__nibImage = nibImage - self.__saveState = dataSource is not None + self.__saveState = saved self.__imageWrapper = imagewrapper.ImageWrapper(self.nibImage, self.name, loadData=loadData,