From 6886e0d619c34fc1b4429b9660aec20130003c82 Mon Sep 17 00:00:00 2001
From: Paul McCarthy <pauldmccarthy@gmail.com>
Date: Wed, 17 Jan 2018 18:22:56 +0000
Subject: [PATCH] Oops forgot to add a setter method for image metadata.
 Related fix in DicomImage

---
 fsl/data/dicom.py | 2 +-
 fsl/data/image.py | 7 +++++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/fsl/data/dicom.py b/fsl/data/dicom.py
index f09383dcc..756e1ccb1 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 32da2f14b..9a9869d34 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
-- 
GitLab