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

RF: Don't use get_data

parent a95870fe
No related branches found
No related tags found
No related merge requests found
...@@ -36,6 +36,7 @@ import shlex ...@@ -36,6 +36,7 @@ import shlex
import logging import logging
import binascii import binascii
import numpy as np
import nibabel as nib import nibabel as nib
import fsl.utils.tempdir as tempdir import fsl.utils.tempdir as tempdir
...@@ -279,9 +280,11 @@ def loadSeries(series): ...@@ -279,9 +280,11 @@ def loadSeries(series):
# copy images so nibabel no longer # copy images so nibabel no longer
# refs to the files (as they will # refs to the files (as they will
# be deleted), and use get_data() # be deleted), and force-load the
# to force-load the image data. # the image data into memory (to
images = [nib.Nifti1Image(i.get_data(), None, i.header) # avoid any disk accesses due to
# e.g. memmap)
images = [nib.Nifti1Image(np.asanyarray(i.dataobj), None, i.header)
for i in images] for i in images]
return [DicomImage(i, series, dcmdir, name=desc) for i in images] return [DicomImage(i, series, dcmdir, name=desc) for i in images]
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