diff --git a/nibabel/brikhead.py b/nibabel/brikhead.py index da8692efd..d187a6b34 100644 --- a/nibabel/brikhead.py +++ b/nibabel/brikhead.py @@ -198,7 +198,7 @@ def parse_AFNI_header(fobj): return parse_AFNI_header(src) # unpack variables in HEAD file head = fobj.read().split('\n\n') - return {key: value for key, value in map(_unpack_var, head)} + return dict(map(_unpack_var, head)) class AFNIArrayProxy(ArrayProxy): diff --git a/nibabel/nicom/dicomwrappers.py b/nibabel/nicom/dicomwrappers.py index 3842248fd..009880e49 100755 --- a/nibabel/nicom/dicomwrappers.py +++ b/nibabel/nicom/dicomwrappers.py @@ -685,9 +685,7 @@ def __init__(self, dcm_data, frame_filters=None): frame_slc_pos = [np.inner(ipp, self.slice_normal) for ipp in frame_ipps] rnd_slc_pos = np.round(frame_slc_pos, 4) uniq_slc_pos = np.unique(rnd_slc_pos) - pos_ord_map = { - val: order for val, order in zip(uniq_slc_pos, np.argsort(uniq_slc_pos)) - } + pos_ord_map = dict(zip(uniq_slc_pos, np.argsort(uniq_slc_pos))) self._frame_slc_ord = [pos_ord_map[pos] for pos in rnd_slc_pos] if len(self._frame_slc_ord) > 1: self._slice_spacing = (