Skip to content

Commit

Permalink
ENH: Allow kwargs in generic save method
Browse files Browse the repository at this point in the history
  • Loading branch information
mgxd committed Oct 5, 2020
1 parent 17a1eca commit 743ebd3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions nibabel/loadsave.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def guessed_image_type(filename):
raise ImageFileError(f'Cannot work out file type of "{filename}"')


def save(img, filename):
def save(img, filename, **kwargs):
""" Save an image to file adapting format to `filename`
Parameters
Expand All @@ -96,7 +96,7 @@ def save(img, filename):

# Save the type as expected
try:
img.to_filename(filename)
img.to_filename(filename, **kwargs)
except ImageFileError:
pass
else:
Expand Down Expand Up @@ -144,7 +144,7 @@ def save(img, filename):
# Here, we either have a klass or a converted image.
if converted is None:
converted = klass.from_image(img)
converted.to_filename(filename)
converted.to_filename(filename, **kwargs)


@deprecate_with_version('read_img_data deprecated. '
Expand Down

0 comments on commit 743ebd3

Please sign in to comment.