Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
FSL
fsl_mrs
Commits
660b47eb
Commit
660b47eb
authored
Nov 29, 2021
by
William Clarke
Browse files
Add test and test data.
parent
9096895f
Changes
4
Hide whitespace changes
Inline
Side-by-side
fsl_mrs/tests/test_scripts_preproc_edit.py
0 → 100644
View file @
660b47eb
'''FSL-MRS test script
Test the edited svs preprocessing script
Copyright Will Clarke, University of Oxford, 2021'''
import
subprocess
from
pathlib
import
Path
testsPath
=
Path
(
__file__
).
parent
data
=
testsPath
/
'testdata/fsl_mrs_preproc_edit'
t1
=
str
(
testsPath
/
'testdata/svs_segment/T1.anat/T1_biascorr.nii.gz'
)
def
test_preproc
(
tmp_path
):
metab
=
str
(
data
/
'metab_raw.nii.gz'
)
wrefc
=
str
(
data
/
'wref_internal.nii.gz'
)
wrefq
=
str
(
data
/
'wref_quant.nii.gz'
)
ecc
=
str
(
data
/
'wref_internal.nii.gz'
)
retcode
=
subprocess
.
check_call
(
[
'fsl_mrs_preproc_edit'
,
'--output'
,
str
(
tmp_path
),
'--data'
,
metab
,
'--reference'
,
wrefc
,
'--quant'
,
wrefq
,
'--ecc'
,
ecc
,
'--t1'
,
t1
,
'--dynamic_align_ppm'
,
'1.8'
,
'4.2'
,
'--edit_align_ppm'
,
'2.5'
,
'4.2'
,
'--hlsvd'
,
'--leftshift'
,
'2'
,
'--overwrite'
,
'--report'
,
'--verbose'
])
assert
retcode
==
0
assert
(
tmp_path
/
'diff.nii.gz'
).
exists
()
assert
(
tmp_path
/
'edit_0.nii.gz'
).
exists
()
assert
(
tmp_path
/
'edit_1.nii.gz'
).
exists
()
assert
(
tmp_path
/
'wref.nii.gz'
).
exists
()
assert
(
tmp_path
/
'options.txt'
).
exists
()
assert
(
tmp_path
/
'mergedReports.html'
).
exists
()
assert
(
tmp_path
/
'voxel_location.png'
).
exists
()
fsl_mrs/tests/testdata/fsl_mrs_preproc_edit/metab_raw.nii.gz
0 → 100644
LFS
View file @
660b47eb
File added
fsl_mrs/tests/testdata/fsl_mrs_preproc_edit/wref_internal.nii.gz
0 → 100644
LFS
View file @
660b47eb
File added
fsl_mrs/tests/testdata/fsl_mrs_preproc_edit/wref_quant.nii.gz
0 → 100644
LFS
View file @
660b47eb
File added
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment