Skip to content

Commit af192b1

Browse files
committed
📚 Document lack of support for CIFTI atlases
1 parent ed0e11c commit af192b1

File tree

11 files changed

+162
-6
lines changed

11 files changed

+162
-6
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:

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+
}

docs/_sources/references/style.py

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
from pybtex.style.formatting import toplevel
2+
from pybtex.style.formatting.plain import Style
3+
from pybtex.style.names.lastfirst import NameStyle as LastFirst
4+
from pybtex.style.sorting.none import SortingStyle as NoSort
5+
from pybtex.style.template import field, href, join, optional, \
6+
optional_field, sentence, tag, words
7+
8+
date = words[field('year'), optional_field('month')]
9+
10+
11+
class CPAC_DocsStyle(Style):
12+
def __init__(self, *args, **kwargs):
13+
super().__init__(
14+
abbreviate_names=True,
15+
name_style=LastFirst,
16+
sorting_style=NoSort
17+
)
18+
19+
def get_book_template(self, entry):
20+
template = toplevel[optional[
21+
sentence[self.format_names('author')]],
22+
optional[sentence[date]],
23+
optional[sentence[href[
24+
field('url'),
25+
optional[tag('em')[self.format_title(entry, 'title')]]
26+
]]] if entry.fields.get('url') else optional[sentence[
27+
tag('em')[self.format_title(entry, 'title')]
28+
]],
29+
optional[sentence[
30+
join(sep=': ')[
31+
optional_field('address'),
32+
optional_field('publisher')
33+
],
34+
]],
35+
sentence[optional_field('note')],
36+
]
37+
return template
38+
39+
def get_misc_template(self, entry):
40+
template = toplevel[
41+
optional[sentence[self.format_names('author')]],
42+
optional[sentence[
43+
optional[field('howpublished')],
44+
optional[date],
45+
]],
46+
optional[sentence[join(sep=', ')[href[
47+
optional_field('url'),
48+
optional[self.format_title(entry, 'title', as_sentence=False)]]
49+
if entry.fields.get('url') else optional[
50+
self.format_title(entry, 'title')
51+
],
52+
optional[tag('em')[self.format_title(entry, 'journal')]],
53+
]]],
54+
sentence[optional_field('note')],
55+
]
56+
return template

0 commit comments

Comments
 (0)