Skip to content

Commit d66cbc0

Browse files
committed
fix: tests and added new data files
1 parent cd69eee commit d66cbc0

File tree

6 files changed

+8
-4
lines changed

6 files changed

+8
-4
lines changed

nipype/interfaces/freesurfer/preprocess.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -931,7 +931,7 @@ class Smooth(FSCommand):
931931
>>> from nipype.interfaces.freesurfer import Smooth
932932
>>> smoothvol = Smooth(in_file='functional.nii', smoothed_file = 'foo_out.nii', reg_file='register.dat', surface_fwhm=10, vol_fwhm=6)
933933
>>> smoothvol.cmdline
934-
'mris_volsmooth --i functional.nii --reg register.dat --o foo_out.nii --fwhm 10 --vol-fwhm 6'
934+
'mris_volsmooth --i functional.nii --reg register.dat --o foo_out.nii --fwhm 10.000000 --vol-fwhm 6.000000'
935935
936936
"""
937937

nipype/interfaces/freesurfer/tests/test_preprocess.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,8 @@ def test_smooth():
228228
reg_file = dict(argstr='--reg %s',mandatory=True,),
229229
smoothed_file = dict(argstr='--o %s',),
230230
subjects_dir = dict(),
231-
surface_fwhm = dict(xor=['num_iters'],mandatory=True,argstr='--fwhm %d',requires=['reg_file'],),
232-
vol_fwhm = dict(argstr='--vol-fwhm %d',),
231+
surface_fwhm = dict(xor=['num_iters'],mandatory=True,argstr='--fwhm %f',requires=['reg_file'],),
232+
vol_fwhm = dict(argstr='--vol-fwhm %f',),
233233
)
234234
instance = freesurfer.Smooth()
235235
for key, metadata in input_map.items():

nipype/interfaces/freesurfer/tests/test_utils.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ def create_files_in_directory():
3232
img = np.random.random(shape)
3333
nif.save(nif.Nifti1Image(img,np.eye(4),hdr),
3434
os.path.join(outdir,f))
35+
with open(os.path.join(outdir, 'reg.dat'), 'wt') as fp:
36+
fp.write('dummy file')
37+
filelist.append('reg.dat')
3538
return filelist, outdir, cwd
3639

3740
def create_surf_file():
@@ -69,13 +72,14 @@ def test_sample2surf():
6972
s2s.inputs.source_file = files[0]
7073
s2s.inputs.reference_file = files[1]
7174
s2s.inputs.hemi = "lh"
75+
s2s.inputs.reg_file = files[2]
7276
s2s.inputs.sampling_range = .5
7377
s2s.inputs.sampling_units = "frac"
7478
s2s.inputs.sampling_method = "point"
7579

7680
# Test a basic command line
7781
yield assert_equal, s2s.cmdline, ("mri_vol2surf "
78-
"--hemi lh --o %s --ref %s --projfrac 0.500 --mov %s"
82+
"--hemi lh --o %s --ref %s --reg reg.dat --projfrac 0.500 --mov %s"
7983
%(os.path.join(cwd, "lh.a.mgz"),files[1],files[0]))
8084

8185
# Test identity

nipype/testing/data/anat_coreg.mif

Whitespace-only changes.

nipype/testing/data/subj1.cff

Whitespace-only changes.

nipype/testing/data/subj2.cff

Whitespace-only changes.

0 commit comments

Comments
 (0)