Skip to content

Commit 3d266fc

Browse files
committed
RF: Allow kwargs within to_filename and instance_to_filename methods
1 parent 0ba55d4 commit 3d266fc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

nibabel/filebasedimages.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ def filespec_to_file_map(klass, filespec):
315315
def filespec_to_files(klass, filespec):
316316
return klass.filespec_to_file_map(filespec)
317317

318-
def to_filename(self, filename):
318+
def to_filename(self, filename, **kwargs):
319319
""" Write image to files implied by filename string
320320
321321
Parameters
@@ -381,7 +381,7 @@ def make_file_map(klass, mapping=None):
381381
load = from_filename
382382

383383
@classmethod
384-
def instance_to_filename(klass, img, filename):
384+
def instance_to_filename(klass, img, filename, **kwargs):
385385
""" Save `img` in our own format, to name implied by `filename`
386386
387387
This is a class method
@@ -394,7 +394,7 @@ def instance_to_filename(klass, img, filename):
394394
Filename, implying name to which to save image.
395395
"""
396396
img = klass.from_image(img)
397-
img.to_filename(filename)
397+
img.to_filename(filename, **kwargs)
398398

399399
@classmethod
400400
def from_image(klass, img):

0 commit comments

Comments
 (0)