From 54507efa9e83cececcf244225ff10f87e4d48c7e Mon Sep 17 00:00:00 2001
From: Paul McCarthy <pauldmccarthy@gmail.com>
Date: Mon, 20 Jul 2020 10:41:39 +0100
Subject: [PATCH] RF: fixExt can pass arguments through to addExt

---
 fsl/data/image.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/fsl/data/image.py b/fsl/data/image.py
index ce01645b4..7c2bdbcba 100644
--- a/fsl/data/image.py
+++ b/fsl/data/image.py
@@ -1625,18 +1625,20 @@ def removeExt(filename):
     return fslpath.removeExt(filename, ALLOWED_EXTENSIONS)
 
 
-def fixExt(filename):
+def fixExt(filename, **kwargs):
     """Fix the extension of ``filename``.
 
     For example, if a file name is passed in as ``file.nii.gz``, but the
     file is actually ``file.nii``, this function will fix the file name.
 
     If ``filename`` already exists, it is returned unchanged.
+
+    All other arguments are passed through to :func:`addExt`.
     """
     if op.exists(filename):
         return filename
     else:
-        return addExt(removeExt(filename))
+        return addExt(removeExt(filename), **kwargs)
 
 
 def defaultExt():
-- 
GitLab