PennLINC / qsirecon

Reconstruction of preprocessed q-space images (dMRI)
https://qsirecon.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
3 stars 3 forks source link

Problem getting the specified bundles using autotrack #120

Open ameliecr opened 1 month ago

ameliecr commented 1 month ago

Summary

There is a problem getting the exact bundles specified in the recon spec under track_id when using autotrack. Specifically it is not possible to get results for 'parent bundles', i.e. the overarching bundle for bundles made up of sub bundles. Example below for the CorpusCallosum.

Additional details

What were you trying to do?

Get autotrack results for the bundle Commissure_CorpusCallosum.

What did you expect to happen?

The expected outcome would have been a .tck.gz file for the Commissure_CorpusCallosum bundle and a row in the bundle stats .csv file for this bundle in the qsirecon output directory.

What actually happened?

There is no .tck.gz file in the output directory. In the bundle stats file there is no information on the Commissure_CorpusCallosum. Instead, there are four empty rows, one for each of the Corpus Callosum sub bundles.

Reproducing the bug

This is the recon spec I used:

atlases: []
name: dsistudio_pipeline
nodes:
-   action: reconstruction
    input: qsirecon
    name: dsistudio_gqi
    parameters:
        method: gqi
    qsirecon_suffix: GQIautotrack
    software: DSI Studio
-   action: autotrack
    input: dsistudio_gqi
    name: autotrackgqi
    parameters:
        tolerance: 22,26,30
        track_id: Corpus
        track_voxel_ratio: 2.0
        yield_rate: 1.0e-06
    qsirecon_suffix: GQIautotrack
    software: DSI Studio
space: T1w

I get the same issue when setting track_id: Commissure_CorpusCallosum

And this is the qsirecon call

singularity run --containall \
-B "${PWD}","${FREESURFER_HOME}"/license.txt:/opt/freesurfer/license.txt \
"${HOME}"/images/qsirecon-0.23.1.sif \
"${PWD}"/qsiprep_outputs \
"${PWD}"/qsirecon \
participant \
--fs-license-file /opt/freesurfer/license.txt \
--recon-spec "${PWD}"/gqi_autotrack.yaml \
--participant-label 1000393599 \
-w "${PWD}"/work \
-v -v --nthreads 2 --omp-nthreads 2 \
--stop-on-first-crash
ameliecr commented 1 month ago

In DSI Studio, by default the parent bundle will be reconstructed when only specifying a part of the bundle name. To track sub bundles these need to be named explicitly, i.e., Commissure_CorpusCallosum_ForcepsMinor. The problem seems to be that qsirecon iterates through this list of bundles: https://github.com/frankyeh/data-atlas/blob/main/ICBM152_adult/ICBM152_adult.tt.gz.txt to extract the bundles to track from the given track_ids. This list, however, doesn't contain the parent bundles. For the CC it only contains the four sub bundles. So qsiprep will get the four sub bundles from the list but DSI Studio will only track the parent bundle. qsirecon will then look for the sub bundles to copy to the output directory and the stats file but there are only results for the parent bundle.