Skip to content

Commit 509e21c

Browse files
committed
FIX: Copy image data array to avoid mmap-truncation
1 parent 09f3fe9 commit 509e21c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

niworkflows/interfaces/bids.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from pathlib import Path
1313
from shutil import copytree, rmtree
1414

15+
import numpy as np
1516
import nibabel as nb
1617

1718
from nipype import logging
@@ -490,7 +491,7 @@ def _run_interface(self, runtime):
490491
hdr.set_xyzt_units(*units)
491492

492493
# Rewrite file with new header
493-
nii.__class__(nii.get_data(), nii.affine, hdr).to_filename(
494+
nii.__class__(np.array(nii.dataobj), nii.affine, hdr).to_filename(
494495
out_file)
495496

496497
if len(self._results['out_file']) == 1:

0 commit comments

Comments
 (0)