Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
mattcieslak committed Dec 13, 2024
1 parent 55d4e34 commit 3caa742
Show file tree
Hide file tree
Showing 4 changed files with 102 additions and 1 deletion.
33 changes: 33 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,30 @@ jobs:
paths:
- /src/qsirecon/.circleci/data/hsvs_data

Recon_SS3T_FOD_AutoTrack:
<<: *dockersetup
steps:
- checkout
- restore_cache:
key: singleshell_output-01
- run: *runinstall
- run:
name: Test the SS3T AutoTrack workflow
no_output_timeout: 1h
command: |
pytest -rP -o log_cli=true -m "ss3t_fod_autotrack" --cov-config=/src/qsirecon/pyproject.toml --cov-append --cov-report term-missing --cov=qsirecon --data_dir=/src/qsirecon/.circleci/data --output_dir=/src/qsirecon/.circleci/out --working_dir=/src/qsirecon/.circleci/work qsirecon
mkdir /src/coverage
mv /src/qsirecon/.coverage /src/coverage/.coverage.ss3t_fod_autotrack
# remove nifti files before uploading artifacts
find /src/qsirecon/.circleci/out/ -name "*.nii.gz" -type f -delete
find /src/qsirecon/.circleci/out/ -name "*.fib.gz" -type f -delete
- persist_to_workspace:
root: /src/coverage/
paths:
- /src/coverage/.coverage.ss3t_fod_autotrack
- store_artifacts:
path: /src/qsirecon/.circleci/out/ss3t_fod_autotrack/

Recon_3Tissue_Singleshell_ACT:
<<: *dockersetup
steps:
Expand Down Expand Up @@ -616,6 +640,13 @@ workflows:
tags:
only: /.*/

- Recon_SS3T_FOD_AutoTrack:
requires:
- download_singleshell_output
filters:
tags:
only: /.*/

- Recon_msmt_Multishell_HSVS:
requires:
- download_hsvs_data
Expand Down Expand Up @@ -718,6 +749,7 @@ workflows:
requires:
- Recon_3Tissue_Singleshell_ACT
- Recon_3Tissue_Singleshell_NoACT
- Recon_SS3T_FOD_AutoTrack
- Recon_MRtrix3
- Recon_Interfaces
- Recon_AutoTrack
Expand All @@ -743,6 +775,7 @@ workflows:
requires:
- Recon_3Tissue_Singleshell_ACT
- Recon_3Tissue_Singleshell_NoACT
- Recon_SS3T_FOD_AutoTrack
- Recon_MRtrix3
- Recon_Interfaces
- Recon_msmt_Multishell_HSVS
Expand Down
41 changes: 41 additions & 0 deletions qsirecon/tests/data/ss3t_fod_autotrack_outputs.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
atlases
atlases/atlas-Gordon333Ext
atlases/atlas-Gordon333Ext/atlas-Gordon333Ext_dseg.tsv
atlases/atlas-Gordon333Ext/atlas-Gordon333Ext_space-MNI152NLin2009cAsym_res-01_dseg.json
atlases/atlas-Gordon333Ext/atlas-Gordon333Ext_space-MNI152NLin2009cAsym_res-01_dseg.nii.gz
atlases/dataset_description.json
dataset_description.json
derivatives
derivatives/qsirecon-MRtrix3_fork-SS3T_act-FAST
derivatives/qsirecon-MRtrix3_fork-SS3T_act-FAST/dataset_description.json
derivatives/qsirecon-MRtrix3_fork-SS3T_act-FAST/logs
derivatives/qsirecon-MRtrix3_fork-SS3T_act-FAST/logs/CITATION.bib
derivatives/qsirecon-MRtrix3_fork-SS3T_act-FAST/logs/CITATION.html
derivatives/qsirecon-MRtrix3_fork-SS3T_act-FAST/logs/CITATION.md
derivatives/qsirecon-MRtrix3_fork-SS3T_act-FAST/logs/CITATION.tex
derivatives/qsirecon-MRtrix3_fork-SS3T_act-FAST/sub-PNC
derivatives/qsirecon-MRtrix3_fork-SS3T_act-FAST/sub-PNC.html
derivatives/qsirecon-MRtrix3_fork-SS3T_act-FAST/sub-PNC/dwi
derivatives/qsirecon-MRtrix3_fork-SS3T_act-FAST/sub-PNC/dwi/sub-PNC_acq-realistic_space-T1w_connectivity.mat
derivatives/qsirecon-MRtrix3_fork-SS3T_act-FAST/sub-PNC/dwi/sub-PNC_acq-realistic_space-T1w_exemplarbundles.zip
derivatives/qsirecon-MRtrix3_fork-SS3T_act-FAST/sub-PNC/dwi/sub-PNC_acq-realistic_space-T1w_model-mtnorm_param-inliermask_dwimap.nii.gz
derivatives/qsirecon-MRtrix3_fork-SS3T_act-FAST/sub-PNC/dwi/sub-PNC_acq-realistic_space-T1w_model-mtnorm_param-norm_dwimap.nii.gz
derivatives/qsirecon-MRtrix3_fork-SS3T_act-FAST/sub-PNC/dwi/sub-PNC_acq-realistic_space-T1w_model-sdstream_streamlines.tck.gz
derivatives/qsirecon-MRtrix3_fork-SS3T_act-FAST/sub-PNC/dwi/sub-PNC_acq-realistic_space-T1w_model-sift2_mu.txt
derivatives/qsirecon-MRtrix3_fork-SS3T_act-FAST/sub-PNC/dwi/sub-PNC_acq-realistic_space-T1w_model-sift2_streamlineweights.csv
derivatives/qsirecon-MRtrix3_fork-SS3T_act-FAST/sub-PNC/dwi/sub-PNC_acq-realistic_space-T1w_model-ss3t_param-fod_label-CSF_dwimap.mif.gz
derivatives/qsirecon-MRtrix3_fork-SS3T_act-FAST/sub-PNC/dwi/sub-PNC_acq-realistic_space-T1w_model-ss3t_param-fod_label-CSF_dwimap.txt
derivatives/qsirecon-MRtrix3_fork-SS3T_act-FAST/sub-PNC/dwi/sub-PNC_acq-realistic_space-T1w_model-ss3t_param-fod_label-GM_dwimap.mif.gz
derivatives/qsirecon-MRtrix3_fork-SS3T_act-FAST/sub-PNC/dwi/sub-PNC_acq-realistic_space-T1w_model-ss3t_param-fod_label-GM_dwimap.txt
derivatives/qsirecon-MRtrix3_fork-SS3T_act-FAST/sub-PNC/dwi/sub-PNC_acq-realistic_space-T1w_model-ss3t_param-fod_label-WM_dwimap.mif.gz
derivatives/qsirecon-MRtrix3_fork-SS3T_act-FAST/sub-PNC/dwi/sub-PNC_acq-realistic_space-T1w_model-ss3t_param-fod_label-WM_dwimap.txt
logs
logs/CITATION.bib
logs/CITATION.html
logs/CITATION.md
logs/CITATION.tex
sub-PNC
sub-PNC/dwi
sub-PNC/dwi/sub-PNC_acq-realistic_space-T1w_seg-Gordon333Ext_dseg.mif.gz
sub-PNC/dwi/sub-PNC_acq-realistic_space-T1w_seg-Gordon333Ext_dseg.nii.gz
sub-PNC/dwi/sub-PNC_acq-realistic_space-T1w_seg-Gordon333Ext_dseg.txt
28 changes: 28 additions & 0 deletions qsirecon/tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,34 @@
nipype_config.enable_debug_mode()


@pytest.mark.integration
@pytest.mark.ss3t_fod_autotrack
def test_mrtrix_singleshell_ss3t_fod_autotrack(data_dir, output_dir, working_dir):
"""Test the ss3t FOD-based autotrack workflow.
Inputs
------
- qsirecon single shell results
"""
TEST_NAME = "ss3t_fod_autotrack"

dataset_dir = download_test_data("singleshell_output", data_dir)
dataset_dir = os.path.join(dataset_dir, "qsiprep")
out_dir = os.path.join(output_dir, TEST_NAME)
work_dir = os.path.join(working_dir, TEST_NAME)

parameters = [
dataset_dir,
out_dir,
"participant",
f"-w={work_dir}",
"--sloppy",
"--recon-spec=ss3t_fod_autotrack",
]

_run_and_generate(TEST_NAME, parameters, test_main=False)


@pytest.mark.integration
@pytest.mark.mrtrix_singleshell_ss3t_act
def test_mrtrix_singleshell_ss3t_act(data_dir, output_dir, working_dir):
Expand Down
1 change: 0 additions & 1 deletion qsirecon/workflows/recon/build_workflow.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import nipype.pipeline.engine as pe
from nipype.interfaces import utility as niu
from niworkflows.engine.workflows import LiterateWorkflow as Workflow
from scipy import special

from ... import config
from ...interfaces.interchange import default_input_set, recon_workflow_input_fields
Expand Down

0 comments on commit 3caa742

Please sign in to comment.