Commit 548ec054 authored by Paul McCarthy's avatar Paul McCarthy 🚵
Browse files

Merge branch 'rel/3.5.2' into 'v3.5'

Rel/3.5.2

See merge request fsl/fslpy!280
parents 462bff2f aa826640
Pipeline #7214 passed with stages
in 1 minute and 21 seconds
...@@ -2,6 +2,20 @@ This document contains the ``fslpy`` release history in reverse chronological ...@@ -2,6 +2,20 @@ This document contains the ``fslpy`` release history in reverse chronological
order. order.
3.5.2 (Friday 29th January 2021)
---------------------------------
Fixed
^^^^^
* Adjusted the :func:`.dicom.scanDir` function so that it will set a
default value for ``SeriesDescription`` if it is not present in the
``dcm2niix`` ``json`` output.
* Fixed some issues with API documentation generation.
3.5.1 (Thursday 21st January 2021) 3.5.1 (Thursday 21st January 2021)
---------------------------------- ----------------------------------
......
...@@ -9,3 +9,4 @@ numpy.linalg ...@@ -9,3 +9,4 @@ numpy.linalg
scipy scipy
scipy.ndimage scipy.ndimage
scipy.ndimage.interpolation scipy.ndimage.interpolation
six
...@@ -343,7 +343,7 @@ class BrainStructure(object): ...@@ -343,7 +343,7 @@ class BrainStructure(object):
:param primary: Name of the brain structure (e.g. cortex, thalamus) :param primary: Name of the brain structure (e.g. cortex, thalamus)
:param secondary: Further specification of which part of the brain structure is described (e.g. 'white' or :param secondary: Further specification of which part of the brain structure is described (e.g. 'white' or
'pial' for the cortex) 'pial' for the cortex)
:param hemisphere: which hemisphere is the brain structure in ('left', 'right', or 'both') :param hemisphere: which hemisphere is the brain structure in ('left', 'right', or 'both')
:param geometry: does the parent object describe the 'volume' or the 'surface' :param geometry: does the parent object describe the 'volume' or the 'surface'
""" """
...@@ -490,4 +490,3 @@ def load(filename, mask_values=(0, np.nan), writable=False) -> Union[DenseCifti, ...@@ -490,4 +490,3 @@ def load(filename, mask_values=(0, np.nan), writable=False) -> Union[DenseCifti,
if writable: if writable:
raise ValueError("Can not open NIFTI file in writable mode") raise ValueError("Can not open NIFTI file in writable mode")
return Cifti.from_image(vol_img, mask_values) return Cifti.from_image(vol_img, mask_values)
...@@ -194,6 +194,10 @@ def scanDir(dcmdir): ...@@ -194,6 +194,10 @@ def scanDir(dcmdir):
with open(fn, 'rt') as f: with open(fn, 'rt') as f:
meta = json.load(f) meta = json.load(f)
meta['DicomDir'] = dcmdir meta['DicomDir'] = dcmdir
# SeriesDescription is not
# guaranteed to be present
if 'SeriesDescription' not in meta:
meta['SeriesDescription'] = meta['SeriesNumber']
series.append(meta) series.append(meta)
# sort by series number # sort by series number
......
...@@ -47,7 +47,7 @@ import re ...@@ -47,7 +47,7 @@ import re
import string import string
__version__ = '3.5.1' __version__ = '3.5.2'
"""Current version number, as a string. """ """Current version number, as a string. """
......
...@@ -168,6 +168,7 @@ def genxwrapper(func, runner): ...@@ -168,6 +168,7 @@ def genxwrapper(func, runner):
The following keyword arguments will be intercepted by the wrapper The following keyword arguments will be intercepted by the wrapper
function, and will *not* be passed to ``func``: function, and will *not* be passed to ``func``:
- ``stdout``: Passed to ``runner``. Defaults to ``True``. - ``stdout``: Passed to ``runner``. Defaults to ``True``.
- ``stderr``: Passed to ``runner``. Defaults to ``True``. - ``stderr``: Passed to ``runner``. Defaults to ``True``.
- ``exitcode``: Passed to ``runner``. Defaults to ``False``. - ``exitcode``: Passed to ``runner``. Defaults to ``False``.
......
...@@ -189,7 +189,8 @@ def test_loadSeries(): ...@@ -189,7 +189,8 @@ def test_loadSeries():
assert 'PatientName' in img.metaKeys() assert 'PatientName' in img.metaKeys()
assert 'MCCARTHY_PAUL' in img.metaValues() or \ assert 'MCCARTHY_PAUL' in img.metaValues() or \
'MCCARTHY^PAUL' in img.metaValues() or \ 'MCCARTHY^PAUL' in img.metaValues() or \
'MCCARTHY_PAUL_2' in img.metaValues() 'MCCARTHY_PAUL_2' in img.metaValues() or \
'MCCARTHY^PAUL^2' in img.metaValues()
assert ('PatientName', 'MCCARTHY_PAUL') in img.metaItems() or \ assert ('PatientName', 'MCCARTHY_PAUL') in img.metaItems() or \
('PatientName', 'MCCARTHY^PAUL') in img.metaItems() or \ ('PatientName', 'MCCARTHY^PAUL') in img.metaItems() or \
('PatientName', 'MCCARTHY_PAUL_2') in img.metaItems() or \ ('PatientName', 'MCCARTHY_PAUL_2') in img.metaItems() or \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment