diff --git a/.circleci/config.yml b/.circleci/config.yml index 937bde1a..0a08d1dc 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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: @@ -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 @@ -718,6 +749,7 @@ workflows: requires: - Recon_3Tissue_Singleshell_ACT - Recon_3Tissue_Singleshell_NoACT + - Recon_SS3T_FOD_AutoTrack - Recon_MRtrix3 - Recon_Interfaces - Recon_AutoTrack @@ -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 diff --git a/qsirecon/tests/data/ss3t_fod_autotrack_outputs.txt b/qsirecon/tests/data/ss3t_fod_autotrack_outputs.txt new file mode 100644 index 00000000..3e5579d9 --- /dev/null +++ b/qsirecon/tests/data/ss3t_fod_autotrack_outputs.txt @@ -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 diff --git a/qsirecon/tests/test_cli.py b/qsirecon/tests/test_cli.py index 0733259c..0e9383e0 100644 --- a/qsirecon/tests/test_cli.py +++ b/qsirecon/tests/test_cli.py @@ -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): diff --git a/qsirecon/workflows/recon/build_workflow.py b/qsirecon/workflows/recon/build_workflow.py index 62151335..7ff0301b 100644 --- a/qsirecon/workflows/recon/build_workflow.py +++ b/qsirecon/workflows/recon/build_workflow.py @@ -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