[ENH] First take at a citation system#146
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request implements a citation export system for pyAFQ that automatically tracks and exports BibTeX citations for methods used in tractography analyses. The system collects citations as the analysis pipeline executes and exports them to a .bib file.
Changes:
- Added a citation collection and export mechanism that writes BibTeX files
- Integrated citations into task functions across data processing, tractography, tissue analysis, structural segmentation, and mapping modules
- Added citations to bundle dictionaries for tract-specific references
- Updated example tutorials to demonstrate the citation export feature
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| AFQ/tasks/viz.py | Added citations export function with BibTeX file writing and deduplication |
| AFQ/tasks/tractography.py | Added citations for tractography methods (PFT, ACT) |
| AFQ/tasks/tissue.py | Added citations for MSMT-CSD and unified filtering |
| AFQ/tasks/structural.py | Added citations for neural network segmentation models (SynthSeg, Multi-axial, Brainchop, MindGrab) |
| AFQ/tasks/mapping.py | Added citation for SLR registration |
| AFQ/tasks/data.py | Added citations for various reconstruction models (DTI, fwDTI, DKI, MSDKI, CSD, GQI, RUMBA, OPDT, CSA) |
| AFQ/api/bundle_dict.py | Extended BundleDict class to support citations; added citations to default, SLF, baby, RecoBundles, cerebellar, and OR bundle definitions |
| AFQ/api/participant.py | Initialized citations set with core pyAFQ and DIPY references |
| AFQ/api/utils.py | Added citation export to export_all_helper function |
| examples/tutorial_examples/plot_002_participant_afq_api.py | Added section demonstrating citation export |
| examples/tutorial_examples/plot_001_group_afq_api.py | Added section demonstrating citation export |
| docs/source/references.bib | Updated author names from LaTeX encoding to Unicode characters |
| .codespellrc | Added citation-related terms to ignore list |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@arokem this is ready for review |
|
Overall, I like the idea. I wonder if it would be possible to have all the bibtex of the citations in one place, instead of spread all over the code-base like this. Maybe a module that defines one big dictionary with citations in it? I also wonder if this could somehow be automated a bit more to turn a raw .bib file into this dict. Maybe the keys could automatically be generated as "AuthorYearJournal" or something like that? |
|
Or I guess the bibtex keys could be used. I wonder if there is some machinery from https://sphinxcontrib-bibtex.readthedocs.io/en/latest/usage.html that could be reused here. |
|
Or something like this? https://pypi.org/project/bibtexparser/ |
|
I am inclined to not add an additional dependency for this. Maybe we could have one python file which is a large dict of references, then in each function we append keys to citations, and when we export we reference the dict. that would keep the code a little cleaner. |
|
Don't forget to add the new scilpy paper (https://apertureneuro.org/article/154022-tractography-analysis-with-the-scilpy-toolbox) as a reference for the aODFs. |
a326e4d to
8b24539
Compare
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
8b24539 to
fb07f77
Compare
|
@arokem I implemented the recommended changes. I also now copy over the references.bib file from docs to AFQ during the build so it will pip install well. I think this is ready to merge, does it look good? |
|
Yes, looks good! In the long run we could produce more detailed "boiler-plate" text for users to include in their papers, which would incorporate these citations. Along the lines of what qsiprep/qsirecon does. |
Closes #98