diff --git a/fsl/data/dicom.py b/fsl/data/dicom.py index f09383dcc8f4e0bb203fb748b9ebf15811ce4021..756e1ccb1c826ddb96dcf806a6169b9d17b0b9c1 100644 --- a/fsl/data/dicom.py +++ b/fsl/data/dicom.py @@ -67,7 +67,7 @@ class DicomImage(fslimage.Image): if metadata is not None: for k, v in metadata.items(): - self.addMeta(k, v) + self.setMeta(k, v) @property diff --git a/fsl/data/image.py b/fsl/data/image.py index 32da2f14b06eca040593381bd1660d73c52746a5..9a9869d345ce5a8990937f917a2811f6ae9b2ea5 100644 --- a/fsl/data/image.py +++ b/fsl/data/image.py @@ -174,6 +174,7 @@ class Nifti(notifier.Notifier): metaValues metaItems getMeta + setMeta **Notification** @@ -713,6 +714,12 @@ class Nifti(notifier.Notifier): return self.__meta.get(*args, **kwargs) + def setMeta(self, *args, **kwargs): + """Add some metadata with the specified key (``dict.__setitem__``). + """ + self.__meta.__setitem__(*args, **kwargs) + + class Image(Nifti): """Class which represents a NIFTI image. Internally, the image is loaded/stored using a :mod:`nibabel.nifti1.Nifti1Image` or