Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reconstruction dwi outputs not included in derivatives when using a custom atlas #721

Open
pcamach2 opened this issue Apr 2, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@pcamach2
Copy link
Contributor

pcamach2 commented Apr 2, 2024

Summary

A custom reconstruction workflow using a custom atlas seems to complete according to the working directory outputs, but the output is not written to the derivatives folder.

Additional details

  • QSIPrep version: v0.19.1
  • Docker version: N/A
  • Singularity version: singularity-ce version 3.10.5-1.el7

This was originally discussed on NeuroStars Qsiprep custom atlas does not output connectivity matrices. @mattcieslak suggested that there could be an issue with the derivatives datasink.

This could also perhaps be something to update in adding subcortical regions in https://github.com/PennLINC/qsiprep-atlas/blob/7f70b79c531052d0e68e2e5528537e37033f5e12/QSIRecon%20atlases.ipynb

What were you trying to do?

Using a custom atlas parcellation - specifically the AtlasPack 4S156 and 4S256 atlases - as described here for the

What did you expect to happen?

The custom atlas connectivity matrix .mat files and other associated outputs of the mrtrix_multishell_msmt_ACT-hsvs workflow should be written to the bids/derivatives/qsirecon/<participant_id>/<session_id>/dwi/ folder.

What actually happened?

Only the anatomical outputs, figures, and HTML report are generated in bids/derivatives/qsirecon/. The working directory qsirecon_wf folders contain the <atlas>_<edge_weight>_connectivity.mat files, the exemplar .tck files, and the other pieces that I would expect from this reconstruction pipeline. However, the corresponding outputs are missing from bids/derivatives/qsirecon/<participant_id>/<session_id>/dwi/.

$ ls bids/derivatives/qsirecon/sub-PROJECT176/*
bids/derivatives/qsirecon/sub-PROJECT176/anat:
sub-PROJECT176_desc-preproc_desc-hsvs_5tt.nii.gz  sub-PROJECT176_desc-preproc_space-fsnative_desc-hsvs_5tt.mif

bids/derivatives/qsirecon/sub-PROJECT176/figures:
sub-PROJECT176_ses-A_run-1_space-T1w_desc-preproc_desc-MRtrix3Connectivity_matrices.svg  sub-PROJECT176_ses-A_run-1_space-T1w_desc-preproc_desc-wmFOD_peaks.png
sub-PROJECT176_ses-A_run-1_space-T1w_desc-preproc_desc-wmFOD_odfs.png

Reproducing the bug

Retrieving the atlases from AtlasPack and resampling to the LPS template from QSIPrep:

datalad clone https://github.com/PennLINC/AtlasPack.git​
datalad get tpl*MNI*4S156* && datalad get tpl*MNI*4S256*​

Download QSIPrep's MNI152NLin2009cAsym standard (mni_1mm_t1w_lps.nii.gz)​

3dresample -input tpl-MNI152NLin2009cAsym_atlas-4S156Parcels_res-01_dseg.nii.gz -master ~/Downloads/mni_1mm_t1w_lps.nii.gz -prefix tpl-MNI152NLin2009cAsym_atlas-4S156Parcels_res-01_dseg_lps.nii.gz​

3dresample -input tpl-MNI152NLin2009cAsym_atlas-4S256Parcels_res-01_dseg.nii.gz -master ~/Downloads/mni_1mm_t1w_lps.nii.gz -prefix tpl-MNI152NLin2009cAsym_atlas-4S256Parcels_res-01_dseg_lps.nii.gz​

Adapt atlas_config.json (using parcel labels from XCP-D conmat.tsv to generate labels for each atlas​) and reconstruction pipeline JSON (add to atlas_config.json under new entries​). See attached files atlas_config.json and mrtrix_multishell_msmt_ACT-hsvs_4S.json

Singularity run command from slurm script:

SINGULARITY_CACHEDIR=${scachedir} SINGULARITY_TMPDIR=${stmpdir} singularity run --cleanenv \
--bind ${IMAGEDIR}:/imgdir,${IMAGEDIR}/4S/mrtrix_multishell_msmt_ACT-hsvs_4S.json:/atlas/qsirecon_atlases/mrtrix_multishell_msmt_ACT-hsvs_4S.json \
--bind ${IMAGEDIR}/4S/atlas_config.json:/atlas/qsirecon_atlases/atlas_config.json \
--bind ${IMAGEDIR}/4S/tpl-MNI152NLin2009cAsym_atlas-4S156Parcels_res-01_dseg_lps.nii.gz:/atlas/qsirecon_atlases/tpl-MNI152NLin2009cAsym_atlas-4S156Parcels_res-01_dseg.nii.gz \
--bind ${IMAGEDIR}/4S/tpl-MNI152NLin2009cAsym_atlas-4S156Parcels_res-01_dseg_lps.nii.gz:/atlas/qsirecon_atlases/tpl-MNI152NLin2009cAsym_atlas-4S256Parcels_res-01_dseg.nii.gz \
--bind ${stmpdir}:/paulscratch,${projDir}:/data ${IMAGEDIR}/qsiprep-v0.19.1.sif --fs-license-file /imgdir/license.txt \
/data/bids/sourcedata /data/bids/derivatives --recon_input /data/bids/derivatives/qsiprep \
--freesurfer-input /data/bids/derivatives/fmriprep/freesurfer \
--recon_spec /atlas/qsirecon_atlases/mrtrix_multishell_msmt_ACT-hsvs_4S.json \
--output-resolution 2.5 -w /paulscratch participant --participant-label ${subject}

Slurm Terminal Output is attached here

@pcamach2 pcamach2 added the bug Something isn't working label Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant