Skip to content

Commit

Permalink
Merge pull request #654 from effigies/patch-1
Browse files Browse the repository at this point in the history
RF: Use GiftiImage.to_xml over BytesIO
  • Loading branch information
rwblair committed Apr 28, 2023
2 parents e12590f + 4ef3074 commit e3dc3c7
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions neurovault/apps/statmaps/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,14 +263,7 @@ def generate_surface_image(image_pk):
),
)

f = BytesIO()
fmap = {
"image": nib.FileHolder(fileobj=f),
"header": nib.FileHolder(fileobj=f),
}
img_surf.to_file_map(fmap)
f.seek(0)
content_file = ContentFile(f.read())
content_file = ContentFile(img_surf.to_xml())
if hemi == "lh":
img.surface_left_file.save(
"%s.%s.func.gii" % (img.pk, {"lh": "L", "rh": "R"}[hemi]),
Expand Down

0 comments on commit e3dc3c7

Please sign in to comment.