From 4f67822c2db2c08e4c96f98f80d587c3ca081750 Mon Sep 17 00:00:00 2001 From: nightwnvol Date: Fri, 29 Nov 2024 15:27:23 +0100 Subject: [PATCH 1/2] enh: add 'mode' parameter to conform function --- nibabel/processing.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/nibabel/processing.py b/nibabel/processing.py index 6027575d4..77b36b225 100644 --- a/nibabel/processing.py +++ b/nibabel/processing.py @@ -320,6 +320,7 @@ def conform( out_shape=(256, 256, 256), voxel_size=(1.0, 1.0, 1.0), order=3, + mode='constant', cval=0.0, orientation='RAS', out_class=None, @@ -353,6 +354,10 @@ def conform( order : int, optional The order of the spline interpolation, default is 3. The order has to be in the range 0-5 (see ``scipy.ndimage.affine_transform``) + mode : str, optional + Points outside the boundaries of the input are filled according to the + given mode ('constant', 'nearest', 'reflect' or 'wrap'). Default is + 'constant' (see scipy.ndimage.affine_transform) cval : scalar, optional Value used for points outside the boundaries of the input if ``mode='constant'``. Default is 0.0 (see @@ -393,7 +398,7 @@ def conform( from_img=from_img, to_vox_map=(out_shape, out_aff), order=order, - mode='constant', + mode=mode, cval=cval, out_class=out_class, ) From 7832deb2da437da2bccc5a4ca580c814af8ef151 Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Fri, 6 Dec 2024 16:22:33 -0500 Subject: [PATCH 2/2] Update nibabel/processing.py --- nibabel/processing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nibabel/processing.py b/nibabel/processing.py index 77b36b225..673ceada6 100644 --- a/nibabel/processing.py +++ b/nibabel/processing.py @@ -357,7 +357,7 @@ def conform( mode : str, optional Points outside the boundaries of the input are filled according to the given mode ('constant', 'nearest', 'reflect' or 'wrap'). Default is - 'constant' (see scipy.ndimage.affine_transform) + 'constant' (see :func:`scipy.ndimage.affine_transform`) cval : scalar, optional Value used for points outside the boundaries of the input if ``mode='constant'``. Default is 0.0 (see