Skip to content

Commit ee3813e

Browse files
committed
test maths.MaxImage for fslmaths -Tmax option
1 parent d6b2dfd commit ee3813e

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

nipype/interfaces/fsl/tests/test_maths.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,32 @@ def test_meanimage():
169169
# Clean up our mess
170170
clean_directory(testdir, origdir, ftype)
171171

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+
172198
@skipif(no_fsl)
173199
def test_smooth():
174200
files, testdir, origdir, ftype = create_files_in_directory()

0 commit comments

Comments
 (0)