File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed
nipype/interfaces/freesurfer/tests Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -98,18 +98,23 @@ def test_mandatory_outvol(create_files_in_directory):
98
98
with pytest .raises (ValueError ): mni .cmdline
99
99
100
100
# test with minimal args
101
- mni .inputs .in_file = filelist [0 ]
102
- assert mni .cmdline == ('mri_nu_correct.mni --i %s --o %s_output.mgz'
103
- % (filelist [0 ], filelist [0 ].replace ('.mgz' , '' )))
101
+ mni .inputs .in_file = filelist [0 ]
102
+ base , ext = os .path .splitext (os .path .basename (filelist [0 ]))
103
+ if ext == '.gz' :
104
+ base , ext2 = os .path .splitext (base )
105
+ ext = ext2 + ext
106
+
107
+ assert mni .cmdline == (
108
+ 'mri_nu_correct.mni --i %s --o %s_output.%s' % (filelist [0 ], base , ext ))
104
109
105
110
# test with custom outfile
106
111
mni .inputs .out_file = 'new_corrected_file.mgz'
107
112
assert mni .cmdline == ('mri_nu_correct.mni --i %s --o new_corrected_file.mgz'
108
113
% (filelist [0 ]))
109
114
110
115
# constructor based tests
111
- mni2 = freesurfer .MNIBiasCorrection (in_file = filelist [0 ],
116
+ mni2 = freesurfer .MNIBiasCorrection (in_file = filelist [0 ],
112
117
out_file = 'bias_corrected_output' ,
113
118
iterations = 4 )
114
- assert mni2 .cmdline == ('mri_nu_correct.mni --i %s --n 4 --o bias_corrected_output.mgz '
115
- % filelist [0 ])
119
+ assert mni2 .cmdline == ('mri_nu_correct.mni --i %s --n 4 --o bias_corrected_output.%s '
120
+ % ( filelist [0 ], ext ) )
You can’t perform that action at this time.
0 commit comments