Skip to content
Snippets Groups Projects
Commit a5d02f56 authored by Paul McCarthy's avatar Paul McCarthy :mountain_bicyclist:
Browse files

RF: Bump minimum dcm2niix version, and use the load-one-series flag to

reduce the number of series that need to be loaded.
parent 5cd1112a
No related branches found
No related tags found
No related merge requests found
......@@ -44,6 +44,10 @@ import fsl.data.image as fslimage
log = logging.getLogger(__name__)
MIN_DCM2NIIX_VERSION = (1, 0, 2017, 12, 15)
"""Minimum version of dcm2niix that is required for this module to work. """
class DicomImage(fslimage.Image):
"""The ``DicomImage`` is a volumetric :class:`.Image` with some associated
DICOM metadata.
......@@ -115,7 +119,6 @@ def enabled():
"""
cmd = 'dcm2niix -h'
minimumVersion = (1, 0, 2016, 9, 30)
versionPattern = re.compile('v'
'(?P<major>[0-9]+)\.'
'(?P<minor>[0-9]+)\.'
......@@ -145,7 +148,7 @@ def enabled():
# make sure installed version
# is equal to or newer than
# minimum required version
for iv, mv in zip(installedVersion, minimumVersion):
for iv, mv in zip(installedVersion, MIN_DCM2NIIX_VERSION):
if iv > mv: return True
elif iv < mv: return False
......@@ -225,7 +228,7 @@ def loadSeries(series):
dcmdir = series['DicomDir']
snum = series['SeriesNumber']
desc = series['SeriesDescription']
cmd = 'dcm2niix -b n -f %s -z n -o . {}'.format(dcmdir)
cmd = 'dcm2niix -b n -f %s -z n -o . -n {} {}'.format(snum, dcmdir)
with tempdir.tempdir() as td:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment