From 93c0e9cdc34f4f622e6a3978b7265c59e6a562e5 Mon Sep 17 00:00:00 2001 From: Matt Cieslak Date: Fri, 13 Dec 2024 16:31:50 -0500 Subject: [PATCH] even better naming --- .circleci/config.yml | 2 +- .../data/pipelines/ss3t_fod_autotrack.yaml | 42 ++++---- .../tests/data/ss3t_fod_autotrack_outputs.txt | 98 ++++++++++++------- qsirecon/workflows/recon/converters.py | 2 + qsirecon/workflows/recon/dsi_studio.py | 1 + qsirecon/workflows/recon/utils.py | 22 ++++- 6 files changed, 108 insertions(+), 59 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0a08d1dc..c10b3a8a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -145,7 +145,7 @@ jobs: - persist_to_workspace: root: /src/coverage/ paths: - - /src/coverage/.coverage.ss3t_fod_autotrack + - .coverage.ss3t_fod_autotrack - store_artifacts: path: /src/qsirecon/.circleci/out/ss3t_fod_autotrack/ diff --git a/qsirecon/data/pipelines/ss3t_fod_autotrack.yaml b/qsirecon/data/pipelines/ss3t_fod_autotrack.yaml index 653fb4d8..b14fe35d 100644 --- a/qsirecon/data/pipelines/ss3t_fod_autotrack.yaml +++ b/qsirecon/data/pipelines/ss3t_fod_autotrack.yaml @@ -7,17 +7,9 @@ nodes: name: dsistudio_gqi parameters: method: gqi - qsirecon_suffix: GQIAutoTrack + qsirecon_suffix: SS3TAutoTrack software: DSI Studio - # Performs the registration of QA+ISO to template - # also passes through the GQI fib/etc -# - action: autotrack_registration -# software: DSI Studio -# name: autotrack_register -# input: dsistudio_gqi -# qsirecon_suffix: DSIStudio - # Select just one shell + b=0 for autotrack - action: select_gradients input: qsirecon @@ -41,6 +33,24 @@ nodes: algorithm: dhollander qsirecon_suffix: SS3TAutoTrack + # Get 3D images of DSI Studio's scalar maps +- action: export + input: dsistudio_gqi + name: gqi_scalars + qsirecon_suffix: SS3TAutoTrack + software: DSI Studio + +# Uncomment to map scalar maps to template space +# - action: template_map +# input: qsirecon +# name: template_map +# parameters: +# interpolation: NearestNeighbor +# scalars_from: +# - gqi_scalars +# - dipy_dki +# software: qsirecon + - action: fod_fib_merge name: create_fod_fib # to include the fib file and the map file @@ -49,18 +59,6 @@ nodes: # outputs include the FOD fib file and the map file is passed through qsirecon_suffix: SS3TAutoTrack -- action: autotrack - input: dsistudio_gqi - name: autotrack_gqi - parameters: - tolerance: 22,26,30 - track_id: Association,Projection,Commissure,Cerebellum,CranialNerve - track_voxel_ratio: 2.0 - yield_rate: 1.0e-06 - qsirecon_suffix: GQIAutoTrack - software: DSI Studio - - - action: autotrack input: create_fod_fib name: autotrack_fod @@ -70,4 +68,4 @@ nodes: track_voxel_ratio: 2.0 yield_rate: 1.0e-06 qsirecon_suffix: SS3TAutoTrack - software: DSI Studio \ No newline at end of file + software: DSI Studio diff --git a/qsirecon/tests/data/ss3t_fod_autotrack_outputs.txt b/qsirecon/tests/data/ss3t_fod_autotrack_outputs.txt index 3e5579d9..3aa18e26 100644 --- a/qsirecon/tests/data/ss3t_fod_autotrack_outputs.txt +++ b/qsirecon/tests/data/ss3t_fod_autotrack_outputs.txt @@ -1,41 +1,71 @@ -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 +derivatives/qsirecon-SS3TAutoTrack +derivatives/qsirecon-SS3TAutoTrack/dataset_description.json +derivatives/qsirecon-SS3TAutoTrack/logs +derivatives/qsirecon-SS3TAutoTrack/logs/CITATION.bib +derivatives/qsirecon-SS3TAutoTrack/logs/CITATION.html +derivatives/qsirecon-SS3TAutoTrack/logs/CITATION.md +derivatives/qsirecon-SS3TAutoTrack/logs/CITATION.tex +derivatives/qsirecon-SS3TAutoTrack/sub-ABCD +derivatives/qsirecon-SS3TAutoTrack/sub-ABCD/dwi +derivatives/qsirecon-SS3TAutoTrack/sub-ABCD/dwi/sub-ABCD_acq-10per000_space-T1w_bundle-AssociationArcuateFasciculusL_streamlines.tck.gz +derivatives/qsirecon-SS3TAutoTrack/sub-ABCD/dwi/sub-ABCD_acq-10per000_space-T1w_bundle-AssociationArcuateFasciculusR_streamlines.tck.gz +derivatives/qsirecon-SS3TAutoTrack/sub-ABCD/dwi/sub-ABCD_acq-10per000_space-T1w_bundlestats.csv +derivatives/qsirecon-SS3TAutoTrack/sub-ABCD/dwi/sub-ABCD_acq-10per000_space-T1w_mapping.map.gz +derivatives/qsirecon-SS3TAutoTrack/sub-ABCD/dwi/sub-ABCD_acq-10per000_space-T1w_model-gqi_dwimap.fib.gz +derivatives/qsirecon-SS3TAutoTrack/sub-ABCD/dwi/sub-ABCD_acq-10per000_space-T1w_model-gqi_param-gfa_dwimap.json +derivatives/qsirecon-SS3TAutoTrack/sub-ABCD/dwi/sub-ABCD_acq-10per000_space-T1w_model-gqi_param-gfa_dwimap.nii.gz +derivatives/qsirecon-SS3TAutoTrack/sub-ABCD/dwi/sub-ABCD_acq-10per000_space-T1w_model-gqi_param-iso_dwimap.json +derivatives/qsirecon-SS3TAutoTrack/sub-ABCD/dwi/sub-ABCD_acq-10per000_space-T1w_model-gqi_param-iso_dwimap.nii.gz +derivatives/qsirecon-SS3TAutoTrack/sub-ABCD/dwi/sub-ABCD_acq-10per000_space-T1w_model-gqi_param-qa_dwimap.json +derivatives/qsirecon-SS3TAutoTrack/sub-ABCD/dwi/sub-ABCD_acq-10per000_space-T1w_model-gqi_param-qa_dwimap.nii.gz +derivatives/qsirecon-SS3TAutoTrack/sub-ABCD/dwi/sub-ABCD_acq-10per000_space-T1w_model-mtnorm_param-inliermask_dwimap.nii.gz +derivatives/qsirecon-SS3TAutoTrack/sub-ABCD/dwi/sub-ABCD_acq-10per000_space-T1w_model-mtnorm_param-norm_dwimap.nii.gz +derivatives/qsirecon-SS3TAutoTrack/sub-ABCD/dwi/sub-ABCD_acq-10per000_space-T1w_model-rdi_param-rd1_dwimap.json +derivatives/qsirecon-SS3TAutoTrack/sub-ABCD/dwi/sub-ABCD_acq-10per000_space-T1w_model-rdi_param-rd1_dwimap.nii.gz +derivatives/qsirecon-SS3TAutoTrack/sub-ABCD/dwi/sub-ABCD_acq-10per000_space-T1w_model-rdi_param-rd2_dwimap.json +derivatives/qsirecon-SS3TAutoTrack/sub-ABCD/dwi/sub-ABCD_acq-10per000_space-T1w_model-rdi_param-rd2_dwimap.nii.gz +derivatives/qsirecon-SS3TAutoTrack/sub-ABCD/dwi/sub-ABCD_acq-10per000_space-T1w_model-ss3t_dwimap.fib.gz +derivatives/qsirecon-SS3TAutoTrack/sub-ABCD/dwi/sub-ABCD_acq-10per000_space-T1w_model-ss3t_param-fod_label-CSF_dwimap.mif.gz +derivatives/qsirecon-SS3TAutoTrack/sub-ABCD/dwi/sub-ABCD_acq-10per000_space-T1w_model-ss3t_param-fod_label-CSF_dwimap.txt +derivatives/qsirecon-SS3TAutoTrack/sub-ABCD/dwi/sub-ABCD_acq-10per000_space-T1w_model-ss3t_param-fod_label-GM_dwimap.mif.gz +derivatives/qsirecon-SS3TAutoTrack/sub-ABCD/dwi/sub-ABCD_acq-10per000_space-T1w_model-ss3t_param-fod_label-GM_dwimap.txt +derivatives/qsirecon-SS3TAutoTrack/sub-ABCD/dwi/sub-ABCD_acq-10per000_space-T1w_model-ss3t_param-fod_label-WM_dwimap.mif.gz +derivatives/qsirecon-SS3TAutoTrack/sub-ABCD/dwi/sub-ABCD_acq-10per000_space-T1w_model-ss3t_param-fod_label-WM_dwimap.txt +derivatives/qsirecon-SS3TAutoTrack/sub-ABCD/dwi/sub-ABCD_acq-10per000_space-T1w_model-tensor_param-ad_dwimap.json +derivatives/qsirecon-SS3TAutoTrack/sub-ABCD/dwi/sub-ABCD_acq-10per000_space-T1w_model-tensor_param-ad_dwimap.nii.gz +derivatives/qsirecon-SS3TAutoTrack/sub-ABCD/dwi/sub-ABCD_acq-10per000_space-T1w_model-tensor_param-fa_dwimap.json +derivatives/qsirecon-SS3TAutoTrack/sub-ABCD/dwi/sub-ABCD_acq-10per000_space-T1w_model-tensor_param-fa_dwimap.nii.gz +derivatives/qsirecon-SS3TAutoTrack/sub-ABCD/dwi/sub-ABCD_acq-10per000_space-T1w_model-tensor_param-ha_dwimap.json +derivatives/qsirecon-SS3TAutoTrack/sub-ABCD/dwi/sub-ABCD_acq-10per000_space-T1w_model-tensor_param-ha_dwimap.nii.gz +derivatives/qsirecon-SS3TAutoTrack/sub-ABCD/dwi/sub-ABCD_acq-10per000_space-T1w_model-tensor_param-md_dwimap.json +derivatives/qsirecon-SS3TAutoTrack/sub-ABCD/dwi/sub-ABCD_acq-10per000_space-T1w_model-tensor_param-md_dwimap.nii.gz +derivatives/qsirecon-SS3TAutoTrack/sub-ABCD/dwi/sub-ABCD_acq-10per000_space-T1w_model-tensor_param-rd_dwimap.json +derivatives/qsirecon-SS3TAutoTrack/sub-ABCD/dwi/sub-ABCD_acq-10per000_space-T1w_model-tensor_param-rd_dwimap.nii.gz +derivatives/qsirecon-SS3TAutoTrack/sub-ABCD/dwi/sub-ABCD_acq-10per000_space-T1w_model-tensor_param-txx_dwimap.json +derivatives/qsirecon-SS3TAutoTrack/sub-ABCD/dwi/sub-ABCD_acq-10per000_space-T1w_model-tensor_param-txx_dwimap.nii.gz +derivatives/qsirecon-SS3TAutoTrack/sub-ABCD/dwi/sub-ABCD_acq-10per000_space-T1w_model-tensor_param-txy_dwimap.json +derivatives/qsirecon-SS3TAutoTrack/sub-ABCD/dwi/sub-ABCD_acq-10per000_space-T1w_model-tensor_param-txy_dwimap.nii.gz +derivatives/qsirecon-SS3TAutoTrack/sub-ABCD/dwi/sub-ABCD_acq-10per000_space-T1w_model-tensor_param-txz_dwimap.json +derivatives/qsirecon-SS3TAutoTrack/sub-ABCD/dwi/sub-ABCD_acq-10per000_space-T1w_model-tensor_param-txz_dwimap.nii.gz +derivatives/qsirecon-SS3TAutoTrack/sub-ABCD/dwi/sub-ABCD_acq-10per000_space-T1w_model-tensor_param-tyy_dwimap.json +derivatives/qsirecon-SS3TAutoTrack/sub-ABCD/dwi/sub-ABCD_acq-10per000_space-T1w_model-tensor_param-tyy_dwimap.nii.gz +derivatives/qsirecon-SS3TAutoTrack/sub-ABCD/dwi/sub-ABCD_acq-10per000_space-T1w_model-tensor_param-tyz_dwimap.json +derivatives/qsirecon-SS3TAutoTrack/sub-ABCD/dwi/sub-ABCD_acq-10per000_space-T1w_model-tensor_param-tyz_dwimap.nii.gz +derivatives/qsirecon-SS3TAutoTrack/sub-ABCD/dwi/sub-ABCD_acq-10per000_space-T1w_model-tensor_param-tzz_dwimap.json +derivatives/qsirecon-SS3TAutoTrack/sub-ABCD/dwi/sub-ABCD_acq-10per000_space-T1w_model-tensor_param-tzz_dwimap.nii.gz +derivatives/qsirecon-SS3TAutoTrack/sub-ABCD/figures +derivatives/qsirecon-SS3TAutoTrack/sub-ABCD/figures/sub-ABCD_acq-10per000_space-T1w_desc-GQIODF_odfs.png +derivatives/qsirecon-SS3TAutoTrack/sub-ABCD/figures/sub-ABCD_acq-10per000_space-T1w_desc-GQIODF_peaks.png +derivatives/qsirecon-SS3TAutoTrack/sub-ABCD/figures/sub-ABCD_acq-10per000_space-T1w_desc-wmFOD_odfs.png +derivatives/qsirecon-SS3TAutoTrack/sub-ABCD/figures/sub-ABCD_acq-10per000_space-T1w_desc-wmFOD_peaks.png +derivatives/qsirecon-SS3TAutoTrack/sub-ABCD/figures/sub-ABCD_desc-about_T1w.html +derivatives/qsirecon-SS3TAutoTrack/sub-ABCD/figures/sub-ABCD_desc-summary_T1w.html +derivatives/qsirecon-SS3TAutoTrack/sub-ABCD/sub-ABCD.html 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 +sub-ABCD \ No newline at end of file diff --git a/qsirecon/workflows/recon/converters.py b/qsirecon/workflows/recon/converters.py index 3e3e29f5..a07e958a 100644 --- a/qsirecon/workflows/recon/converters.py +++ b/qsirecon/workflows/recon/converters.py @@ -150,7 +150,9 @@ def init_fod_fib_wf(inputs_dict, name="fod_fib", qsirecon_suffix="", params={}): ds_fibgz = pe.Node( DerivativesDataSink( dismiss_entities=("desc",), + suffix="dwimap", extension=".fib.gz", + model="ss3t", compress=True, ), name="ds_fibgz", diff --git a/qsirecon/workflows/recon/dsi_studio.py b/qsirecon/workflows/recon/dsi_studio.py index 9ca4e967..41385d9f 100644 --- a/qsirecon/workflows/recon/dsi_studio.py +++ b/qsirecon/workflows/recon/dsi_studio.py @@ -147,6 +147,7 @@ def init_dsi_studio_recon_wf(inputs_dict, name="dsi_studio_recon", qsirecon_suff dismiss_entities=("desc",), suffix="dwimap", extension=".fib.gz", + model="gqi", compress=True, ), name="ds_gqi_fibgz", diff --git a/qsirecon/workflows/recon/utils.py b/qsirecon/workflows/recon/utils.py index 1196f762..054cf997 100644 --- a/qsirecon/workflows/recon/utils.py +++ b/qsirecon/workflows/recon/utils.py @@ -62,7 +62,16 @@ def init_discard_repeated_samples_wf( niu.IdentityInterface(fields=recon_workflow_input_fields), name="inputnode" ) outputnode = pe.Node( - niu.IdentityInterface(fields=["dwi_file", "bval_file", "bvec_file", "local_bvec_file"]), + niu.IdentityInterface( + fields=[ + "dwi_file", + "bval_file", + "bvec_file", + "local_bvec_file", + "b_file", + "btable_file", + ] + ), name="outputnode", ) workflow = Workflow(name=name) @@ -97,7 +106,16 @@ def init_gradient_select_wf( niu.IdentityInterface(fields=recon_workflow_input_fields), name="inputnode" ) outputnode = pe.Node( - niu.IdentityInterface(fields=["dwi_file", "bval_file", "bvec_file", "local_bvec_file"]), + niu.IdentityInterface( + fields=[ + "dwi_file", + "bval_file", + "bvec_file", + "local_bvec_file", + "b_file", + "btable_file", + ] + ), name="outputnode", ) workflow = Workflow(name=name)