@@ -169,6 +169,32 @@ def test_meanimage():
169
169
# Clean up our mess
170
170
clean_directory (testdir , origdir , ftype )
171
171
172
+ @skipif (no_fsl )
173
+ def test_maximage ():
174
+ files , testdir , origdir , ftype = create_files_in_directory ()
175
+
176
+ # Get the command
177
+ maxer = fsl .MaxImage (in_file = "a.nii" ,out_file = "b.nii" )
178
+
179
+ # Test the underlying command
180
+ yield assert_equal , maxer .cmd , "fslmaths"
181
+
182
+ # Test the defualt opstring
183
+ yield assert_equal , maxer .cmdline , "fslmaths a.nii -Tmax b.nii"
184
+
185
+ # Test the other dimensions
186
+ cmdline = "fslmaths a.nii -%smax b.nii"
187
+ for dim in ["X" ,"Y" ,"Z" ,"T" ]:
188
+ maxer .inputs .dimension = dim
189
+ yield assert_equal , maxer .cmdline , cmdline % dim
190
+
191
+ # Test the auto naming
192
+ maxer = fsl .MaxImage (in_file = "a.nii" )
193
+ yield assert_equal , maxer .cmdline , "fslmaths a.nii -Tmax %s" % os .path .join (testdir , "a_max.nii" )
194
+
195
+ # Clean up our mess
196
+ clean_directory (testdir , origdir , ftype )
197
+
172
198
@skipif (no_fsl )
173
199
def test_smooth ():
174
200
files , testdir , origdir , ftype = create_files_in_directory ()
0 commit comments