@@ -187,6 +187,41 @@ def test_fslroi():
187
187
# Fslroi class doesn't have a filled opt_map{}
188
188
189
189
190
+ @skipif (no_fsl )
191
+ def test_fslmerge ():
192
+ filelist , outdir , cwd = create_files_in_directory ()
193
+
194
+ merger = fsl .Merge ()
195
+
196
+ # make sure command gets called
197
+ yield assert_equal , merger .cmd , 'fslmerge'
198
+
199
+ # test raising error with mandatory args absent
200
+ yield assert_raises , ValueError , merger .run
201
+
202
+ # .inputs based parameters setting
203
+ merger .inputs .in_files = filelist
204
+ merger .inputs .merged_file = 'foo_merged.nii'
205
+ merger .inputs .dimension = 't'
206
+ yield assert_equal , merger .cmdline , 'fslmerge -t foo_merged.nii %s' % ' ' .join (filelist )
207
+
208
+ # verify that providing a tr value updates the dimension to tr
209
+ merger .inputs .tr = 2.25
210
+ yield assert_equal , merger .cmdline , 'fslmerge -tr foo_merged.nii %s %.2f' % (' ' .join (filelist ), 2.25 )
211
+
212
+ # .run based parameter setting
213
+ merger2 = fsl .Merge (in_files = filelist ,
214
+ merged_file = 'foo_merged.nii' ,
215
+ dimension = 't' ,
216
+ tr = 2.25 )
217
+
218
+ yield assert_equal , merger2 .cmdline , \
219
+ 'fslmerge -tr foo_merged.nii %s %.2f' % (' ' .join (filelist ), 2.25 )
220
+
221
+ clean_directory (outdir , cwd )
222
+ # test arguments for opt_map
223
+ # Fslmerge class doesn't have a filled opt_map{}
224
+
190
225
# test fslmath
191
226
@skipif (no_fsl )
192
227
def test_fslmaths ():
0 commit comments