Skip to content

Commit f645075

Browse files
authored
MAINT: Deal with nibabel deprecation (#10719)
1 parent 83c7162 commit f645075

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

mne/surface.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2025,7 +2025,7 @@ def warp_montage_volume(montage, base_image, reg_affine, sdr_morph,
20252025
image_from[voxel] = i + 1
20262026

20272027
# apply the mapping
2028-
image_from = nib.Nifti1Image(image_from, fs_from_img.affine)
2028+
image_from = nib.spatialimages.SpatialImage(image_from, fs_from_img.affine)
20292029
_warn_missing_chs(montage, image_from, after_warp=False)
20302030

20312031
template_brain = nib.load(

mne/tests/test_surface.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,8 @@ def test_warp_montage_volume():
381381
montage, CT, reg_affine, sdr_morph, 'sample', thresh=11.)
382382
with pytest.raises(ValueError, match='subject folder is incorrect'):
383383
warp_montage_volume(
384-
montage, CT, reg_affine, sdr_morph, subject_from='foo')
384+
montage, CT, reg_affine, sdr_morph, subject_from='foo',
385+
subjects_dir_from=subjects_dir)
385386
CT_unaligned = nib.Nifti1Image(CT_data, template_brain.affine)
386387
with pytest.raises(RuntimeError, match='not aligned to Freesurfer'):
387388
warp_montage_volume(montage, CT_unaligned, reg_affine,

0 commit comments

Comments
 (0)