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

pyAFQ_tractometry: Where is the streamlines.json equivalent? #663

Open
dkp opened this issue Dec 1, 2023 · 7 comments
Open

pyAFQ_tractometry: Where is the streamlines.json equivalent? #663

dkp opened this issue Dec 1, 2023 · 7 comments

Comments

@dkp
Copy link

dkp commented Dec 1, 2023

To use AFQ-Browser or AFQ-Insight, I need an output file corresponding to streamlines.json as described here: https://yeatmanlab.github.io/AFQ-Browser/dataformat.html
Unfortunately, I am not even sure what files I might be able to use to build it manually.
Can you provide any guidance?

Thank you,

Dianne

@mattcieslak
Copy link
Collaborator

@36000 do you know?

@36000
Copy link
Contributor

36000 commented Dec 11, 2023

If you ran this with export set to all, then there should be an output folder called afq_browser inside of the derivatives folder next to the afq derivatives folder. This should be a ready-to-go afq browser instance. The afqb_streamlines.json file is in the afq folder.

In the (hopefully) near future, pyAFQ will use tractoscope instead of AFQ browser: https://github.com/nrdg/tractoscopehttps://github.com/nrdg/tractoscope
and this I will integrate into the QSIprep version.

@dkp
Copy link
Author

dkp commented Dec 11, 2023

streamlines.json is not generated by the qsirecon pyafq_tractometry pipeline. We believe this is because qsirecon's pyAFQ_tractometry runs "export all" from the participant.py rather than the group.py. Currently, there is no afq_browser folder being created in the derivatives.
When we install pyAFQ separately and run group.py on the results in qsiprep, that reruns everything that qsirecon originally created (which is unfortunate), however, it does generate the streamlines.json. We have not been able to get pyAFQ to use the derivatives in the qsirecon folder.

@36000
Copy link
Contributor

36000 commented Dec 11, 2023

Oh ya - that's all correct. However, I think it should be possible to get pyAFQ to use the derivatives in the qsirecon folder? what's the current error? I am about to enter a meeting, but afterwards I can debug this better.

@36000
Copy link
Contributor

36000 commented Dec 11, 2023

You can check the name of the qsirecon derivatives folder by checking the dataset_description.json inside of it. That name might not necessarily be the same as the folder name. Then pass that to GroupAFQ using preproc_pipeline="...." . Then it should use only derivatives from that derivative folder.

@arokem
Copy link
Contributor

arokem commented Dec 15, 2023

I suspect this may be related to the error described here: yeatmanlab/pyAFQ#1075

@hickst
Copy link

hickst commented Dec 15, 2023

@arokem The issue that Dianne and I are having appears to stem from a mismatch between the output file structure of the qsirecon pyAFQ tractometry pipeline and the file structure expected by the pyAFQ library.

When we run our qsiprep preprocessed data with qsirecon we get a file structure like this:

qsirecon
├── logs
└── sub-CAM003
    ├── figures
    └── ses-01brain
        └── dwi
            └── sub-CAM003_ses-01brain_dir-AP_space-T1w_desc-preproc
                ├── bundles
                ├── clean_bundles
                ├── ROIs
                ├── viz_bundles
                └── viz_core_bundles

But when we run a pyAFQ pipeline on our data, it produces a different, shallower output file structure:

afq.pyafq/
└── sub-CAM003
    └── ses-01brain
        ├── bundles
        ├── ROIs
        ├── viz_bundles
        └── viz_core_bundles

This difference led us to try restructuring the qsirecon output to match the shallower structure:

qsirecon
├── logs
└── sub-CAM003
    ├── figures
    └── ses-01brain
        ├── bundles
        ├── clean_bundles
        ├── ROIs
        ├── viz_bundles
        └── viz_core_bundles

Which worked!: allowing us to use the existing qsirecon tractometry to generate the afq-browser information and successfully view the tractometry.

We also note that all the other qsirecon "non-AFQ" pipelines produce a file structure with the outputs directly under the dwi directory. For examples:

qsirecon_dipy_dki/
├── logs
└── sub-CAM003
    ├── figures
    └── ses-01brain
        └── dwi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants