Skip to content

Commit 62e3401

Browse files
committed
🔀 Merge remote-tracking branch 'origin/source' into excerpts/1.8.1
2 parents 8425e72 + 7f45229 commit 62e3401

23 files changed

+182
-44
lines changed

.circleci/config.yml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ commands:
1414
name: ↑ Installing build dependencies
1515
command: |
1616
sudo apt-get update && sudo apt-get -y install git python3-dev graphviz graphviz-dev libgraphviz-dev pkg-config python3-sphinx
17+
pip install --user -r requirements.txt
1718
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-bibtex<2.0" sphinxcontrib-fulltoc sphinxcontrib-programoutput semver torch
19+
pip install --user git+https://github.com/${CIRCLE_PROJECT_USERNAME}/C-PAC.git@<< parameters.version >>
1920
git clone https://github.com/${CIRCLE_PROJECT_USERNAME}/C-PAC.git /home/circleci/build/C-PAC
2021
cd /home/circleci/build/C-PAC
2122
git checkout << parameters.version >>
@@ -24,13 +25,6 @@ commands:
2425
source ~/simple/bin/activate
2526
pip install cpac
2627
deactivate
27-
- run:
28-
name: 🖇️ Linking references
29-
command: |
30-
CPAC_DIRECTORY=$(python -c "import os, CPAC; print(os.path.abspath(os.path.dirname(CPAC.__file__)))")
31-
ln ${CPAC_DIRECTORY}/resources/configs/1.7-1.8-nesting-mappings.yml docs/_sources/references/1.7-1.8-nesting-mappings.yml || true
32-
ln ${CPAC_DIRECTORY}/resources/configs/1.7-1.8-deprecations.yml docs/_sources/references/1.7-1.8-deprecations.yml || true
33-
curl -o docs/_sources/references/default_pipeline.yml -L https://raw.githubusercontent.com/${CIRCLE_PROJECT_USERNAME}/C-PAC/<< parameters.version >>/dev/docker_data/default_pipeline.yml || true
3428
3529
run-cpac-commands:
3630
steps:
@@ -39,7 +33,7 @@ commands:
3933
name: 👊 Running cpac commands
4034
command: |
4135
source ~/simple/bin/activate
42-
cpac run --help
36+
cpac pull
4337
mkdir -p docs/_sources/user/cpac
4438
printf ".. code-block:: console\n\n $ cpac --help\n\n" > docs/_sources/user/cpac/help.rst
4539
cpac --help | sed -e "s/.*/ &/" >> docs/_sources/user/cpac/help.rst
@@ -58,7 +52,7 @@ commands:
5852
- run:
5953
name: 🔧 Configuring git user
6054
command: |
61-
git config --global user.email "[email protected].com"
55+
git config --global user.email "[email protected].io"
6256
git config --global user.name "ci-build"
6357
- run:
6458
name: 🔀 Combining new docs with existing docs

CONTRIBUTING.md

Lines changed: 71 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,33 @@
1+
<!-- TOC -->
2+
3+
- [Branches](#branches)
4+
- [Versions](#versions)
5+
- [`nightly`](#nightly)
6+
- [C-PAC release tags](#c-pac-release-tags)
7+
- [Guidelines](#guidelines)
8+
- [Building](#building)
9+
- [Let CircleCI build your drafts / works-in-progress](#let-circleci-build-your-drafts--works-in-progress)
10+
- [Build locally (C-PAC ≥ v1.8.0)](#build-locally-c-pac-≥-v180)
11+
- [Flowcharts](#flowcharts)
12+
- [References and citations](#references-and-citations)
13+
- [Environment notes](#environment-notes)
14+
15+
<!-- /TOC -->
16+
17+
<a id="markdown-branches" name="branches"></a>
118
## Branches
219

320
Please, always base changes on the `source` branch. `master` branch will be overwritten by the CI deployment.
421

22+
<a id="markdown-versions" name="versions"></a>
523
### Versions
624

25+
<a id="markdown-nightly" name="nightly"></a>
726
#### `nightly`
827

928
Pushes to `source` will rebuild docs at https://fcp-indi.github.io/docs/nightly
1029

30+
<a id="markdown-c-pac-release-tags" name="c-pac-release-tags"></a>
1131
#### C-PAC release tags
1232
Tags in the format `v.*-source` will build docs for the given version.
1333

@@ -21,12 +41,13 @@ Steps to build a release:
2141
5. (Force) push to the remote tag (`git push origin v`version`-source`).
2242
6. CircleCI should deploy the versioned documentation. If the version tag is the newest, it should also overwrite `latest` with these documents.
2343

44+
<a id="markdown-guidelines" name="guidelines"></a>
2445
## Guidelines
2546

2647
- Only write a document once, and liberally use the [reStructured Text `.. include::` directive](https://docutils.sourceforge.io/docs/ref/rst/directives.html#include) to include that document where appropriate.
2748
- Use absolute paths for `.. include::`s. That way the path will resolve correctly regardless of differences in nesting levels.
2849
- Include any source documents that you want built in at least one [`toctree`](https://www.sphinx-doc.org/en/1.8/usage/restructuredtext/directives.html#directive-toctree). Use the `:hidden:` option if you don't want it linked in an actual table of contents in the document with the `toctree`.
29-
- Use consistent section title indicators throughout a sourcetree. [fcp-indi.github.com/docs/user](https://fcp-indi.github.com/docs/user) currently has the following hierarchy (top to bottom):
50+
- Use consistent section title indicators throughout a sourcetree. [fcp-indi.github.io/docs/user](https://fcp-indi.github.io/docs/user) currently has the following hierarchy (top to bottom):
3051
```
3152
=
3253
^
@@ -37,16 +58,50 @@ Steps to build a release:
3758
'
3859
"
3960
```
40-
- Let CircleCI build your drafts / works-in-progress
41-
* Build environment will match actual docs build environment
42-
* CircleCI takes ~2 minutes to build
43-
1. Fork https://github.com/FCP-INDI/fcp-indi.github.com
44-
1. In your fork's settings, set the GitHub Pages `source` to `master` branch
45-
![GitHub Pages settings example screenshot](./images/github-pages-settings-example.png)
46-
1. Add your project on CircleCI
47-
1. Merge your draft / work-in-progress into your fork's `source` branch. Make sure you push to your fork and not the main repository's `source` branch.
48-
1. Your fork will publish at `https://[your_GitHub_username].github.io/fcp-indi.github.com/`.
4961

62+
<a id="markdown-building" name="building"></a>
63+
### Building
64+
65+
<a id="markdown-let-circleci-build-your-drafts--works-in-progress" name="let-circleci-build-your-drafts--works-in-progress"></a>
66+
#### Let CircleCI build your drafts / works-in-progress
67+
* Build environment will match actual docs build environment
68+
* CircleCI takes ~2 minutes to build
69+
1. Fork https://github.com/FCP-INDI/fcp-indi.github.io
70+
1. In your fork's settings, set the GitHub Pages `source` to `master` branch
71+
![GitHub Pages settings example screenshot](./images/github-pages-settings-example.png)
72+
1. Add your project on CircleCI
73+
1. Merge your draft / work-in-progress into your fork's `source` branch. Make sure you push to your fork and not the main repository's `source` branch.
74+
1. Your fork will publish at `https://[your_GitHub_username].github.io/fcp-indi.github.io/`.
75+
76+
<a id="markdown-build-locally-c-pac-≥-v180" name="build-locally-c-pac-≥-v180"></a>
77+
#### Build locally (C-PAC ≥ v1.8.0)
78+
This documentation aspires to rely on a [single source of truth](https://en.wikipedia.org/wiki/Single_source_of_truth) where possible. To this end, building this documentation requires an installation of the version of [C-PAC](https://github.com/FCP-INDI/C-PAC) that is being documented.
79+
80+
Steps to build this documentation locally:
81+
1. Clone this repository.
82+
1. _(optional)_ <details><summary>Locally replicate the step "👊 Running cpac commands" from [.circleci/config](./.circleci/config) to generate [cpac](https://pypi.org/project/cpac/) usage strings.</summary>
83+
Either perform this "👊 Running cpac commands" step in a separate Python environment or uninstall cpac after generating the usage string(s).
84+
1. _(optional)_ Create an environment for cpac and activate this environment.
85+
1. `pip install cpac`
86+
1. If you don't have a local container for the version of C-PAC you're documenting, `cpac pull` to download the latest or `cpac pull --tag $TAG` to pull a specific version.
87+
1. Generate ReStructuredText documents with cpac usage strings:
88+
```BASH
89+
mkdir -p docs/_sources/user/cpac
90+
printf ".. code-block:: console\n\n $ cpac --help\n\n" > docs/_sources/user/cpac/help.rst
91+
cpac --help | sed -e "s/.*/ &/" >> docs/_sources/user/cpac/help.rst
92+
mkdir -p docs/_sources/user/run
93+
printf "Usage: cpac run\n\`\`\`\`\`\`\`\`\`\`\`\`\`\`\`\n.. code-block:: console\n\n $ cpac run --help\n\n" > docs/_sources/user/run/help.rst
94+
cpac run --help | sed -e "s/.*/ &/" >> docs/_sources/user/run/help.rst
95+
mkdir -p docs/_sources/user/utils
96+
printf "Usage: cpac utils\n\`\`\`\`\`\`\`\`\`\`\`\`\`\`\`\`\`\n.. code-block:: console\n\n $ cpac utils --help\n\n" > docs/_sources/user/utils/help.rst
97+
cpac utils --help | sed -e "s/.*/ &/" >> docs/_sources/user/utils/help.rst
98+
```
99+
1. `deactivate` your cpac environment if you used a separate environment or `pip uninstall cpac`.
100+
</details>
101+
1. Locally install [C-PAC](https://github.com/FCP-INDI/C-PAC) from source.
102+
1. Run `./bin/build $VERSION` where `$VERSION` is the version to build (`nightly`, `latest`, or [<span title='Semantic Versioning'>semver</span>](https://semver.org/) for production, but this string can be anything you want locally). ![example version](./images/example_version.png)
103+
104+
<a id="markdown-flowcharts" name="flowcharts"></a>
50105
## Flowcharts
51106

52107
- SVGs exported from Lucidchart have scaling coded in in `width` and `height` XML attributes. Add the XML attributes `preserveAspectRatio="xMinYMin meet"` and `viewBox` to the SVG element in the actual SVG files:
@@ -64,16 +119,17 @@ where `{width}` and `{height}` are the values already present in the existing `w
64119
<object data="../_static/path/to/chart.svg" type="image/svg+xml"></object>
65120
```
66121

122+
<a id="markdown-references-and-citations" name="references-and-citations"></a>
67123
## References and citations
68124

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,
125+
[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.io/blob/source/docs/_sources/references/style.py). To use this Sphinx extension,
70126

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).
127+
1. Include your citations in a BibTeX file (see the `*.bib` files in [docs/_sources/references](https://github.com/FCP-INDI/fcp-indi.github.io/blob/source/docs/_sources/references) for examples).
72128
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.
73129
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.
74130
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-`).
75131
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`.
132+
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.io/blob/source/docs/_sources/references/style.py), add a `get_{entry_type}_template` [Pybtex](https://pybtex.org) method to `CPAC_DocsStyle`.
77133

78134
For example, if you have a BibTeX file called `cpac_citation.bib` that contains
79135

@@ -114,6 +170,7 @@ The rendered file should look something like
114170
>
115171
> <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)
116172

173+
<a id="markdown-environment-notes" name="environment-notes"></a>
117174
## Environment notes
118175
* 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
119176
```RST
@@ -125,5 +182,5 @@ The rendered file should look something like
125182
:shell:
126183
:ellipsis: 0,9
127184
```
128-
* :heavy_plus_sign: Check [`.circleci/config.yml`](https://github.com/FCP-INDI/fcp-indi.github.com/blob/source/.circleci/config.yml) of the branch you're working from for build dependencies.
185+
* :heavy_plus_sign: Check [`.circleci/config.yml`](https://github.com/FCP-INDI/fcp-indi.github.io/blob/source/.circleci/config.yml) of the branch you're working from for build dependencies.
129186
* :octocat: Set an environment variable `GITHUBTOKEN` to a [personal access token](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line) to increase [your API rate limit](https://developer.github.com/v3/#rate-limiting) from 60 to 5000 requests per hour (for getting [release notes from GitHub](https://github.com/FCP-INDI/C-PAC/releases)).

GUI/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!DOCTYPE html>
22
<meta charset="utf-8">
33
<script>
4-
window.location.href = "https://fcp-indi.github.com/C-PAC_GUI" + window.location.href.split('/GUI')[1]
4+
window.location.href = "https://fcp-indi.github.io/C-PAC_GUI" + window.location.href.split('/GUI')[1]
55
</script>

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# fcp-indi.github.com
1+
# fcp-indi.github.io
22

33
GitHub Pages repo for FCP-INDI
44

bin/build

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
11
#!/bin/bash
22

3+
# link references
4+
CPAC_DIRECTORY=$(python -c "import os, CPAC; print(os.path.abspath(os.path.dirname(CPAC.__file__)))")
5+
ln ${CPAC_DIRECTORY}/resources/configs/1.7-1.8-nesting-mappings.yml docs/_sources/references/1.7-1.8-nesting-mappings.yml || true
6+
ln ${CPAC_DIRECTORY}/resources/configs/1.7-1.8-deprecations.yml docs/_sources/references/1.7-1.8-deprecations.yml || true
7+
ln ${CPAC_DIRECTORY}/resources/configs/default_pipeline.yml docs/_sources/references/default_pipeline.yml || true
8+
9+
# build docs
310
sphinx-build -b html docs/_sources docs/$1
240 KB
Loading

docs/_sources/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
sys.path.append(os.path.dirname(__file__))
2929

30-
from references import CPAC_DocsStyle
30+
from references import CPAC_DocsStyle # noqa: E402
3131

3232
register_plugin('pybtex.style.formatting', 'cpac_docs_style', CPAC_DocsStyle)
3333

docs/_sources/user/alff.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ALFF is defined as the total power within the frequency range between 0.01 and 0
99

1010
Computation and Analysis Considerations
1111
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
12-
All computations are performed in a subject's native space. After transforming voxel time series frequency information into the power domain, calculation of these measures is relatively simple. ALFF is calculated as the sum of amplitudes within a specific low frequency range. f/ALFF is calculated as a fraction of the sum of amplitudes across the entire frequency range detectable in a given signal. For both measures, amplitudes in subject-level maps are transformed into Z-scores to create standardized subject-level maps. Anatomical images and Z-score maps are then transformed into MNI152 standard space. For more detail on how CPAC computes these steps, please see the `ALFF and f/ALFF Page of the developer documentation <http://fcp-indi.github.com/docs/developer/workflows/alff.html>`_.
12+
All computations are performed in a subject's native space. After transforming voxel time series frequency information into the power domain, calculation of these measures is relatively simple. ALFF is calculated as the sum of amplitudes within a specific low frequency range. f/ALFF is calculated as a fraction of the sum of amplitudes across the entire frequency range detectable in a given signal. For both measures, amplitudes in subject-level maps are transformed into Z-scores to create standardized subject-level maps. Anatomical images and Z-score maps are then transformed into MNI152 standard space. For more detail on how CPAC computes these steps, please see the `ALFF and f/ALFF Page of the developer documentation <http://fcp-indi.github.io/docs/developer/workflows/alff.html>`_.
1313

1414
Though both ALFF and f/ALFF are sensitive mostly to signal from gray matter, ALFF is more prone to noise from physiological sources, particularly near the ventricles and large blood vessels (Zuo et al., 2008;2010). The figure below (from Zuo et al., 2010) shows areas in which ALFF shows higher amplitude than f/ALFF, as well as the relative sensitivity of these measures to gray matter.
1515

docs/_sources/user/anat.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,27 @@
55

66
<div class="flowchart-container"><object data="../_static/flowcharts/anatomical.svg" type="image/svg+xml"></object></div>
77

8+
Surface Analysis
9+
^^^^^^^^^^^^^^^^
10+
11+
Surface analysis runs FreeSurfer recon-all and generates CSF, WM, GM masks, pial surface mesh, smoothed surface mesh, spherical surface mesh, white matter surface mesh, sulcal depth surface maps, cortical thickness surface maps and cortical volume surface maps.
12+
13+
Configuring CPAC to run surface analysis:
14+
"""""""""""""""""""""""""""""""""""""""""
15+
16+
.. figure:: /_images/anat_surface.png
17+
18+
#. **FreeSurfer - [On,Off]:** FreeSurfer recon-all. Default is Off.
19+
20+
Configuration Without the GUI
21+
""""""""""""""""""""""""""""""
22+
23+
The following nested key/value pairs that will be set to these defaults if not defined in your :doc:`pipeline configuration YAML </user/pipelines/pipeline_config>`:
24+
25+
.. literalinclude:: /references/default_pipeline.yml
26+
:language: YAML
27+
:lines: 152-159
28+
829
Initial Preprocessing
930
^^^^^^^^^^^^^^^^^^^^^
1031

0 commit comments

Comments
 (0)