Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
FSL
fslpy
Commits
94b6e749
Commit
94b6e749
authored
Feb 08, 2019
by
Paul McCarthy
🚵
Browse files
BF: Avoid mem-mapping dicom/niftis, as the tempdir will be deleted.
parent
5bab6952
Changes
1
Hide whitespace changes
Inline
Side-by-side
fsl/data/dicom.py
View file @
94b6e749
...
...
@@ -203,9 +203,13 @@ def loadSeries(series):
sp
.
call
(
cmd
.
split
(),
stdout
=
devnull
,
stderr
=
devnull
)
files
=
glob
.
glob
(
op
.
join
(
td
,
'{}*.nii'
.
format
(
snum
)))
images
=
[
nib
.
load
(
f
)
for
f
in
files
]
# Force-load images into memory
[
i
.
get_data
()
for
i
in
images
]
images
=
[
nib
.
load
(
f
,
mmap
=
False
)
for
f
in
files
]
# copy images so nibabel no longer
# refs to the files (as they will
# be deleted), and use get_data()
# to force-load the image data.
images
=
[
nib
.
Nifti1Image
(
i
.
get_data
(),
None
,
i
.
header
)
for
i
in
images
]
return
[
DicomImage
(
i
,
series
,
dcmdir
,
name
=
desc
)
for
i
in
images
]
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment