Skip to content

Commit 75ed05a

Browse files
committed
DOC: FileBasedImage.serialize.__doc__
1 parent bb64f19 commit 75ed05a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

nibabel/filebasedimages.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,18 @@ def path_maybe_image(klass, filename, sniff=None, sniff_max=1024):
513513
return klass.header_class.may_contain_header(sniff[0]), sniff
514514

515515
def serialize(self):
516+
""" Return a ``bytes`` object with the contents of the file that would
517+
be written if the image were saved.
518+
519+
Parameters
520+
----------
521+
None
522+
523+
Returns
524+
-------
525+
bytes
526+
Serialized image
527+
"""
516528
bio = io.BytesIO()
517529
file_map = self.make_file_map({'image': bio, 'header': bio})
518530
self.to_file_map(file_map)

0 commit comments

Comments
 (0)