Skip to content

Commit 59733ff

Browse files
authored
Merge pull request #1396 from nightwnvol/enh/conform-mode
ENH: Add mode parameter to nibabel.processing.conform()
2 parents 9d1c0e5 + e066daf commit 59733ff

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

nibabel/processing.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,7 @@ def conform(
320320
out_shape=(256, 256, 256),
321321
voxel_size=(1.0, 1.0, 1.0),
322322
order=3,
323+
mode='constant',
323324
cval=0.0,
324325
orientation='RAS',
325326
out_class=None,
@@ -353,6 +354,10 @@ def conform(
353354
order : int, optional
354355
The order of the spline interpolation, default is 3. The order has to
355356
be in the range 0-5 (see ``scipy.ndimage.affine_transform``)
357+
mode : str, optional
358+
Points outside the boundaries of the input are filled according to the
359+
given mode ('constant', 'nearest', 'reflect' or 'wrap'). Default is
360+
'constant' (see :func:`scipy.ndimage.affine_transform`)
356361
cval : scalar, optional
357362
Value used for points outside the boundaries of the input if
358363
``mode='constant'``. Default is 0.0 (see
@@ -393,7 +398,7 @@ def conform(
393398
from_img=from_img,
394399
to_vox_map=(out_shape, out_aff),
395400
order=order,
396-
mode='constant',
401+
mode=mode,
397402
cval=cval,
398403
out_class=out_class,
399404
)

0 commit comments

Comments
 (0)