Skip to content

Commit

Permalink
Add tests and test data for 5ttgen msmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Lestropie committed Oct 22, 2024
1 parent 53a5ac5 commit dddce99
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 2 deletions.
4 changes: 2 additions & 2 deletions testing/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ ExternalProject_Add(BinariesTestData
ExternalProject_Add(ScriptsTestData
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/scripts_data
GIT_REPOSITORY ${mrtrix_scripts_data_url}
GIT_TAG 76f47633cd0a37e901c42320f4540ecaffd51367
GIT_TAG ed1d3c630db9eafd6ce2808360e9e99529abfabc
GIT_PROGRESS TRUE
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
Expand All @@ -47,4 +47,4 @@ add_subdirectory(binaries)
add_subdirectory(lib)
add_subdirectory(scripts)
add_subdirectory(tools)
add_subdirectory(unit_tests)
add_subdirectory(unit_tests)
2 changes: 2 additions & 0 deletions testing/scripts/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ add_bash_script_test(5ttgen/hsvs_piping)
add_bash_script_test(5ttgen/hsvs_template)
add_bash_script_test(5ttgen/hsvs_whitespace)
add_bash_script_test(5ttgen/hsvs_whitestem)
add_bash_script_test(5ttgen/msmt_default)
add_bash_script_test(5ttgen/msmt_masked)

add_bash_script_test(dwi2mask/3dautomask_default)
add_bash_script_test(dwi2mask/3dautomask_options)
Expand Down
19 changes: 19 additions & 0 deletions testing/scripts/tests/5ttgen/msmt_default
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash
# Verify "5ttgen msmt" default operation
# Output is compared to a prior output generateed by the command

# First we need to get some multi-tissue ODFs
dwi2response dhollander BIDS/sub-01/dwi/sub-01_dwi.nii.gz tmp_wm.txt tmp_gm.txt tmp_csf.txt \
-fslgrad BIDS/sub-01/dwi/sub-01_dwi.bvec BIDS/sub-01/dwi/sub-01_dwi.bval \
-mask BIDS/sub-01/dwi/sub-01_brainmask.nii.gz \
-force
dwi2fod msmt_csd BIDS/sub-01/dwi/sub-01_dwi.nii.gz \
-fslgrad BIDS/sub-01/dwi/sub-01_dwi.bvec BIDS/sub-01/dwi/sub-01_dwi.bval \
tmp_wm.txt tmp_wm.mif \
tmp_gm.txt tmp_gm.mif \
tmp_csf.txt tmp_csf.mif \
-force

5ttgen msmt tmp_wm.mif tmp_gm.mif tmp_csf.mif tmp.mif -force

testing_diff_image tmp.mif 5ttgen/msmt/default.mif.gz -abs 1e-5
21 changes: 21 additions & 0 deletions testing/scripts/tests/5ttgen/msmt_masked
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash
# Verify "5ttgen msmt" operation where a user-specified mask is provided
# Output is compared to a prior output generateed by the command

# First we need to get some multi-tissue ODFs
dwi2response dhollander BIDS/sub-01/dwi/sub-01_dwi.nii.gz tmp_wm.txt tmp_gm.txt tmp_csf.txt \
-fslgrad BIDS/sub-01/dwi/sub-01_dwi.bvec BIDS/sub-01/dwi/sub-01_dwi.bval \
-mask BIDS/sub-01/dwi/sub-01_brainmask.nii.gz \
-force
dwi2fod msmt_csd BIDS/sub-01/dwi/sub-01_dwi.nii.gz \
-fslgrad BIDS/sub-01/dwi/sub-01_dwi.bvec BIDS/sub-01/dwi/sub-01_dwi.bval \
tmp_wm.txt tmp_wm.mif \
tmp_gm.txt tmp_gm.mif \
tmp_csf.txt tmp_csf.mif \
-force

5ttgen msmt tmp_wm.mif tmp_gm.mif tmp_csf.mif tmp.mif \
-mask BIDS/sub-01/dwi/sub-01_brainmask.nii.gz \
-force

testing_diff_image tmp.mif 5ttgen/msmt/masked.mif.gz -abs 1e-5

0 comments on commit dddce99

Please sign in to comment.