@@ -95,18 +95,21 @@ def test_mandatory_outvol(create_files_in_directory):
95
95
assert mni .cmd == "mri_nu_correct.mni"
96
96
97
97
# test raising error with mandatory args absent
98
- with pytest .raises (ValueError ): mni .run ()
98
+ with pytest .raises (ValueError ): mni .cmdline
99
99
100
- # test raising error with only partial mandatory args present
101
- mni .inputs .in_file = filelist [0 ] #mgz
102
- with pytest .raises (ValueError ): mni .run ()
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' , '' ))
103
104
104
- # rest of mandatory inputs
105
- mni .inputs .out_file = 'bias_corrected_output'
105
+ # test with custom outfile
106
+ mni .inputs .out_file = 'new_corrected_file.mgz'
107
+ assert mni .cmdline == ('mri_nu_correct.mni --i %s --o new_corrected_file.mgz'
108
+ % (filelist [0 ])
106
109
107
- assert mni .cmdline == ('mri_nu_correct.mni --i %s --n 4 --o bias_corrected_output.mgz'
108
- % filelist [0 ])
109
110
# constructor based tests
110
- mni2 = freesurfer .MNIBiasCorrection (in_file = filelist [0 ], out_file = 'bias_corrected_output' )
111
+ mni2 = freesurfer .MNIBiasCorrection (in_file = filelist [0 ],
112
+ out_file = 'bias_corrected_output' ,
113
+ iterations = 4 )
111
114
assert mni2 .cmdline == ('mri_nu_correct.mni --i %s --n 4 --o bias_corrected_output.mgz'
112
115
% filelist [0 ])
0 commit comments