Skip to content

Commit 47a3905

Browse files
authored
Merge pull request #238 from FCP-INDI/docs/CIFTI-atlases
📚 Document lack of support for CIFTI atlases
2 parents ed0e11c + 6a8d3f6 commit 47a3905

File tree

13 files changed

+250
-7
lines changed

13 files changed

+250
-7
lines changed

.circleci/config.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ commands:
1515
command: |
1616
sudo apt-get update && sudo apt-get -y install git python3-dev graphviz graphviz-dev libgraphviz-dev pkg-config python3-sphinx
1717
pip install --user -r https://raw.githubusercontent.com/FCP-INDI/C-PAC/<< parameters.version >>/requirements.txt
18-
pip install --user git+https://github.com/${CIRCLE_PROJECT_USERNAME}/C-PAC.git@<< parameters.version >> sphinx m2r numpydoc PyGithub sphinxcontrib-fulltoc sphinxcontrib-programoutput semver torch
18+
pip install --user git+https://github.com/${CIRCLE_PROJECT_USERNAME}/C-PAC.git@<< parameters.version >> sphinx m2r numpydoc PyGithub sphinxcontrib-bibtex sphinxcontrib-fulltoc sphinxcontrib-programoutput semver torch
1919
git clone https://github.com/${CIRCLE_PROJECT_USERNAME}/C-PAC.git /home/circleci/build/C-PAC
2020
cd /home/circleci/build/C-PAC
2121
git checkout << parameters.version >>
@@ -114,7 +114,6 @@ jobs:
114114
command: ./bin/build nightly
115115
- store-commit-message
116116
- persist-new-build
117-
118117
build-version:
119118
working_directory: /home/circleci/build
120119
docker:
@@ -131,7 +130,6 @@ jobs:
131130
command: ./bin/build ${BUILD_VERSION}
132131
- store-commit-message
133132
- persist-new-build
134-
135133
deploy-nightly:
136134
working_directory: /home/circleci/
137135
docker:
@@ -141,7 +139,6 @@ jobs:
141139
at: /home/circleci/
142140
- prep-deploy
143141
- deploy
144-
145142
deploy-version:
146143
working_directory: /home/circleci/
147144
docker:

CONTRIBUTING.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,56 @@ where `{width}` and `{height}` are the values already present in the existing `w
6464
<object data="../_static/path/to/chart.svg" type="image/svg+xml"></object>
6565
```
6666

67+
## References and citations
68+
69+
[sphinxcontrib-bibtex](https://sphinxcontrib-bibtex.readthedocs.io/) is installed and configured. This extension creates links between the citations and the reference in the reference list and formats citations in referenced BibTeX files using built-in or [custom styles](https://github.com/FCP-INDI/fcp-indi.github.com/blob/source/docs/_sources/references/style.py). To use this Sphinx extension,
70+
71+
1. Include your citations in a BibTeX file (see the `*.bib` files in [docs/_sources/references](https://github.com/FCP-INDI/fcp-indi.github.com/blob/source/docs/_sources/references) for examples).
72+
2. Using the key (the text between the opening `{` and the first `,` in a BibTeX entry) use the ReStructuredText syntax `` :cite:`key` `` to cite your reference in a ReStructuredText file.
73+
3. Include a `.. bibliography::` directive somewhere on any page that you want to use this extension to format references and create two-way links between the references and citations. Specify the (one) BibTeX file for this reference list any formatting for the reference list in this directive. Both `:cite:` and `.. bibliography::` need to be rendered on the same page for the links to generate.
74+
4. If you will (or might) use more than one `.. bibliography::` directive on a single rendered page (including `.. include::` directives), choose a prefix for the keys and include that prefix in both the `:cite:` role (like `` :cite:`prefix-key` ``) and the bibliography directive (like `:keyprefix: prefix-`).
75+
5. If you want to include a header over a reference list, use the `.. rubric::` directive above its `.. bibliography` directive.
76+
6. If the entry type (e.g., `book`, `article`, `misc`) of any of the entries in your BibTeX file(s) is not included in [docs/_sources/references/style.py](https://github.com/FCP-INDI/fcp-indi.github.com/blob/source/docs/_sources/references/style.py), add a `get_{entry_type}_template` [Pybtex](https://pybtex.org) method to `CPAC_DocsStyle`.
77+
78+
For example, if you have a BibTeX file called `cpac_citation.bib` that contains
79+
80+
```BibTeX
81+
@ARTICLE{cpac2013,
82+
AUTHOR={Craddock, Cameron and Sikka, Sharad and Cheung, Brian and Khanuja, Ranjeet and Ghosh, Satrajit S
83+
and Yan, Chaogan and Li, Qingyang and Lurie, Daniel and Vogelstein, Joshua and Burns, Randal and
84+
Colcombe, Stanley and Mennes, Maarten and Kelly, Clare and Di Martino, Adriana and Castellanos,
85+
Francisco Xavier and Milham, Michael},
86+
TITLE={Towards Automated Analysis of Connectomes: The {Configurable Pipeline for the Analysis of Connectomes (C-PAC)}},
87+
JOURNAL={Frontiers in Neuroinformatics},
88+
YEAR={2013},
89+
NUMBER={42},
90+
URL={http://www.frontiersin.org/neuroinformatics/10.3389/conf.fninf.2013.09.00042/full},
91+
DOI={10.3389/conf.fninf.2013.09.00042},
92+
ISSN={1662-5196}
93+
}
94+
```
95+
96+
If you include
97+
98+
```rst
99+
To cite C-PAC, use :cite:`cite-cpac2013`.
100+
101+
.. rubric Cite C-PAC
102+
103+
.. bibliography:: cpac_citation.bib
104+
:style: cpac_docs_style
105+
:cited:
106+
:keyprefix: cite-
107+
```
108+
109+
The rendered file should look something like
110+
111+
> To cite C-PAC, use <a name="backref1" href="#ref1">[1]</a>.
112+
>
113+
> __Cite C-PAC__
114+
>
115+
> <a name="ref1" href="#backref1">[1]</a> Craddock, C., Sikka, S., Cheung, B., Khanuja, R., Ghosh, S. S., Yan, C., Li, Q., Lurie, D., Vogelstein, J., Burns, R., Colcombe, S., Mennes, M., Kelly, C., Di Martino, A., Castellanos, F. X., and Milham, M. 2013. [Towards automated analysis of connectomes: the Configurable Pipeline for the Analysis of Connectomes (C-PAC).](http://www.frontiersin.org/neuroinformatics/10.3389/conf.fninf.2013.09.00042/full) *Frontiers in neuroinformatics* 42. doi:[10.3389/conf.fninf.2013.09.00042](https://dx.doi.org/10.3389/conf.fninf.2013.09.00042)
116+
67117
## Environment notes
68118
* Because [C-PAC](https://github.com/FCP-INDI/C-PAC.git) and [cpac](https://github.com/FCP-INDI/cpac.git) have conflicting commandline commands, we first run any `cpac` commands in a virtual environment and spoof the `command-output` directive with `code-block` like
69119
```RST

docs/_sources/_static/custom.css

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,16 @@ div.flowchart-container {
88

99
object {
1010
max-width: 100%;
11-
}
11+
}
12+
13+
14+
.bibtex .brackets::before {
15+
content: "[";
16+
}
17+
.bibtex .brackets::after {
18+
content: "]"
19+
}
20+
21+
.bibtex.label {
22+
display: grid;
23+
}

docs/_sources/conf.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@
2323
from github import Github
2424
from github.GithubException import RateLimitExceededException, \
2525
UnknownObjectException
26+
from pybtex.plugin import register_plugin
27+
28+
sys.path.append(os.path.dirname(__file__))
29+
30+
from references import CPAC_DocsStyle
31+
32+
register_plugin('pybtex.style.formatting', 'cpac_docs_style', CPAC_DocsStyle)
2633

2734
# "Dealing with Invalid Versions" from
2835
# https://python-semver.readthedocs.io/en/latest/usage.html
@@ -110,6 +117,7 @@ def compare_versions(new, old):
110117
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
111118
extensions = [
112119
'sphinx.ext.autodoc',
120+
'sphinxcontrib.bibtex',
113121
'sphinxcontrib.fulltoc',
114122
'sphinx.ext.ifconfig',
115123
'sphinx.ext.intersphinx',
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Currently C-PAC only supports atlases in NifTI format.
2+
3+
CIFTI is a popular atlas format not yet supported by C-PAC. As always, if anyone wants to share any tips or hacks with us, we are an open-source platform after all. Below are some resources that might help enable CIFTI atlas support in a future version of C-PAC.
4+
5+
.. rubric:: CIFTI Resources
6+
7+
.. bibliography:: /references/cifti.bib
8+
:all:
9+
:list: bullet
10+
:style: cpac_docs_style

docs/_sources/glossary/atlas.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Atlas
2+
`````
3+
4+
An *atlas* provides a guide to the location of anatomical features in a coordinate space.
5+
6+
-- :cite:`glossary-PoMN11` p. 55
7+
8+
An atlas provides a defined coordinate space, a :doc:`template </glossary/template>` for aligning images, and labels for regions of interest.
9+
10+
.. include:: /developer/atlas_support.rst
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Template
2+
````````
3+
4+
A *template* is an image that is representative of the :doc:`atlas </glossary/atlas>` and provides a target to which individual images can be aligned.
5+
6+
-- :cite:`glossary-PoMN11` p. 55
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from .style import CPAC_DocsStyle
2+
3+
__all__ = ['CPAC_DocsStyle']

docs/_sources/references/cifti.bib

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
@misc{Meji15,
2+
title = {A layman’s guide to working with {CIFTI} files},
3+
url = {https://mandymejia.com/2015/08/10/a-laymans-guide-to-working-with-cifti-files/},
4+
language = {en},
5+
urldate = {2020-08-26},
6+
journal = {{Mandy Mejia}},
7+
author = {Mejia, Mandy},
8+
month = aug,
9+
year = {2015}
10+
}
11+
12+
@misc{Habe18,
13+
title = {Convert from {CIFTI2} ({HCP}) to {3D} array},
14+
url = {https://neurostars.org/t/convert-from-cifti2-hcp-to-3d-array/3054},
15+
language = {en-US},
16+
urldate = {2020-08-26},
17+
journal = {Neurostars},
18+
author = {Habeeb, Haroun},
19+
collaborator = {Etzel, Jo and Rokem, Ariel},
20+
month = dec,
21+
year = {2018}
22+
}
23+
24+
@misc{Etze14,
25+
title = {{NIfTI}, {CIFTI}, {GIFTI} in the {HCP} and {Workbench}: a primer},
26+
shorttitle = {{MVPA} {Meanderings}},
27+
url = {http://mvpa.blogspot.com/2014/03/nifti-cifti-gifti-in-hcp-and-workbench.html},
28+
journal = {{MVPA} Meanderings},
29+
author = {Etzel, Jo},
30+
month = mar,
31+
year = {2014}
32+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
@book{PoMN11,
2+
address = {New York},
3+
title = {Handbook of {Functional} {MRI} {Data} {Analysis}},
4+
isbn = {978-0-521-51766-9},
5+
abstract = {Functional magnetic resonance imaging (fMRI) has become the most popular method for imaging brain function. Handbook for Functional MRI Data Analysis provides a comprehensive and practical introduction to the methods used for fMRI data analysis. Using minimal jargon, this book explains the concepts behind processing fMRI data, focusing on the techniques that are most commonly used in the field. This book provides background about the methods employed by common data analysis packages including FSL, SPM, and AFNI. Some of the newest cutting-edge techniques, including pattern classification analysis, connectivity modeling, and resting state network analysis, are also discussed. Readers of this book, whether newcomers to the field or experienced researchers, will obtain a deep and effective knowledge of how to employ fMRI analysis to ask scientific questions and become more sophisticated users of fMRI analysis software.},
6+
language = {English},
7+
publisher = {Cambridge University Press},
8+
author = {Poldrack, Russell A. and Mumford, Jeanette A. and Nichols, Thomas E.},
9+
month = aug,
10+
year = {2011}
11+
}

0 commit comments

Comments
 (0)