Skip to content

Commit

Permalink
FIX address Stefan's comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jasmainak authored and sappelhoff committed Jul 23, 2019
1 parent e402650 commit d797103
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mne_bids/write.py
Original file line number Diff line number Diff line change
Expand Up @@ -1019,7 +1019,9 @@ def write_anat(bids_root, subject, t1w, session=None, acquisition=None,
t1w = nib.Nifti1Image(t1w.dataobj, t1w.affine)
# XYZT_UNITS = NIFT_UNITS_MM (10 in binary or 2 in decimal)
# seems to be the default for Nifti files
t1w.header['xyzt_units'] = np.array(10, dtype='uint8')
# https://nifti.nimh.nih.gov/nifti-1/documentation/nifti1fields/nifti1fields_pages/xyzt_units.html
if t1w.header['xyzt_units'] == 0:
t1w.header['xyzt_units'] = np.array(10, dtype='uint8')
# Now give the NIfTI file a BIDS name and write it to the BIDS location
t1w_basename = make_bids_basename(subject=subject, session=session,
acquisition=acquisition, prefix=anat_dir,
Expand Down

0 comments on commit d797103

Please sign in to comment.