-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add missing test + remove unused fcts
- Loading branch information
1 parent
291f86d
commit 276a64c
Showing
3 changed files
with
40 additions
and
215 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 28 additions & 1 deletion
29
scripts_python/tests/test_compute_connectivity_matrix_from_blocs.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,33 @@ | ||
#!/usr/bin/env python3 | ||
# -*- coding: utf-8 -*- | ||
|
||
import os | ||
import tempfile | ||
|
||
from dwi_ml.unit_tests.utils.data_and_models_for_tests import fetch_testing_data | ||
|
||
data_dir = fetch_testing_data() | ||
tmp_dir = tempfile.TemporaryDirectory() | ||
|
||
|
||
def test_help_option(script_runner): | ||
ret = script_runner.run('dwiml_compute_connectivity_matrix_from_blocs.py', '--help') | ||
ret = script_runner.run('dwiml_compute_connectivity_matrix_from_blocs.py', | ||
'--help') | ||
assert ret.success | ||
|
||
|
||
def test_run(script_runner): | ||
os.chdir(os.path.expanduser(tmp_dir.name)) | ||
|
||
dwi_ml_folder = os.path.join(data_dir, 'dwi_ml_ready', 'subjX') | ||
in_volume = os.path.join(dwi_ml_folder, 'anat', 't1.nii.gz') | ||
streamlines = os.path.join(dwi_ml_folder, 'example_bundle', 'Fornix.trk') | ||
|
||
out_file = 'test_matrix_connectivity.npy' | ||
biggest = 'test_biggest.trk' | ||
|
||
nb_blocs = '4' | ||
ret = script_runner.run('dwiml_compute_connectivity_matrix_from_blocs.py', | ||
in_volume, streamlines, out_file, nb_blocs, | ||
'--binary', '--save_biggest', biggest) | ||
assert ret.success |