From 9f3310d42aa4ddf3b723e98d78b4bd152be84a9e Mon Sep 17 00:00:00 2001 From: Martin Craig <martin.craig@eng.ox.ac.uk> Date: Tue, 17 Jul 2018 09:58:25 +0100 Subject: [PATCH] Special case to handle 'centre' argument for BET since this needs to be passed as a sequence of CL arguments, not a single value --- fsl/wrappers/bet.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/fsl/wrappers/bet.py b/fsl/wrappers/bet.py index 09282f117..e20ee3fb1 100644 --- a/fsl/wrappers/bet.py +++ b/fsl/wrappers/bet.py @@ -35,6 +35,7 @@ def bet(input, output, **kwargs): 'robust' : 'R', 'fracintensity' : 'f', 'seg' : 'n', + 'centre' : 'c', } valmap = { @@ -55,6 +56,14 @@ def bet(input, output, **kwargs): } cmd = ['bet', input, output] + + # The 'centre' argument requires three co-ordinates and can't be passed + # as a single value, so needs to be handled separately. Assume it is + # passed as a Python sequence + centre = kwargs.pop("c", None) + if centre is not None: + cmd += ['c', ] + list(centre) + cmd += wutils.applyArgStyle('-', argmap=argmap, valmap=valmap, **kwargs) return cmd -- GitLab