From 015c0dce7f93d45af004bfab0b3e325eb4ec79ce Mon Sep 17 00:00:00 2001
From: Paul McCarthy <pauldmccarthy@gmail.com>
Date: Fri, 29 Jan 2021 15:40:29 +0000
Subject: [PATCH] RF: SeriesDescription may not be present in dmc2niix json
 output

---
 fsl/data/dicom.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/fsl/data/dicom.py b/fsl/data/dicom.py
index 51c750385..1b2be16d4 100644
--- a/fsl/data/dicom.py
+++ b/fsl/data/dicom.py
@@ -194,6 +194,10 @@ def scanDir(dcmdir):
             with open(fn, 'rt') as f:
                 meta             = json.load(f)
                 meta['DicomDir'] = dcmdir
+                # SeriesDescription is not
+                # guaranteed to be present
+                if 'SeriesDescription' not in meta:
+                    meta['SeriesDescription'] = meta['SeriesNumber']
                 series.append(meta)
 
     # sort by series number
-- 
GitLab