Skip to content

Commit 4a62f9c

Browse files
authored
Update test_maths.py
1 parent 6b16b36 commit 4a62f9c

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
@@ -168,6 +168,32 @@ def test_meanimage():
168168

169169
# Clean up our mess
170170
clean_directory(testdir, origdir, ftype)
171+
172+
@skipif(no_fsl)
173+
def test_stdimage():
174+
files, testdir, origdir, ftype = create_files_in_directory()
175+
176+
# Get the command
177+
stder = fsl.StdImage(in_file="a.nii",out_file="b.nii")
178+
179+
# Test the underlying command
180+
yield assert_equal, stder.cmd, "fslmaths"
181+
182+
# Test the defualt opstring
183+
yield assert_equal, stder.cmdline, "fslmaths a.nii -Tstd b.nii"
184+
185+
# Test the other dimensions
186+
cmdline = "fslmaths a.nii -%sstd b.nii"
187+
for dim in ["X","Y","Z","T"]:
188+
stder.inputs.dimension=dim
189+
yield assert_equal, stder.cmdline, cmdline%dim
190+
191+
# Test the auto naming
192+
stder = fsl.StdImage(in_file="a.nii")
193+
yield assert_equal, stder.cmdline, "fslmaths a.nii -Tstd %s"%os.path.join(testdir, "a_std.nii")
194+
195+
# Clean up our mess
196+
clean_directory(testdir, origdir, ftype)
171197

172198
@skipif(no_fsl)
173199
def test_maximage():

0 commit comments

Comments
 (0)