Skip to content

Commit 03afe3f

Browse files
authored
Merge pull request #250 from FCP-INDI/update/1.8
📝 More 1.8 Updates
2 parents 0f1a92e + f9a604d commit 03afe3f

File tree

13 files changed

+165
-27
lines changed

13 files changed

+165
-27
lines changed

.circleci/config.yml

Lines changed: 3 additions & 9 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

CONTRIBUTING.md

Lines changed: 66 additions & 9 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,6 +41,7 @@ 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.
@@ -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.com
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.com/`.
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,6 +119,7 @@ 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

69125
[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,
@@ -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

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/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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
C-PAC brainlife.io app
2+
----------------------
3+
4+
Please visit |DOI:10.25663/brainlife.app.399| to see documentation for C-PAC on brainlife.io and brainlife.io generally.
5+
6+
.. |DOI:10.25663/brainlife.app.399| image:: https://img.shields.io/badge/DOI-10.25663%2Fbrainlife.app.399-blue
7+
:target: https://doi.org/10.25663/brainlife.app.399

docs/_sources/user/help.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,15 @@ If you have a question that is not answered in the User Guide or encounter an is
99

1010
View Crash Files
1111
^^^^^^^^^^^^^^^^
12+
13+
C-PAC ≥1.8.0
14+
************
15+
16+
As of C-PAC v1.8.0, crash files are plain text files and can be read with any text editor.
17+
18+
CPAC ≤1.7.2
19+
***********
20+
1221
If you have the :ref:`cpac Python package <cpac-python-package>`, you can simply run
1322

1423
.. code-block:: console

docs/_sources/user/output_dir.rst

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,33 @@
11
Check Your Outputs
2-
=============================
2+
==================
3+
4+
.. _1.8-outputs:
5+
6+
C-PAC ≥ 1.8.0
7+
^^^^^^^^^^^^^
8+
9+
The output structure of C-PAC ≥ 1.8.0 is based on `the Brain Imaging Data Structure v1.6.0-dev BIDS Derivatives specification <https://bids-specification.readthedocs.io/en/latest/05-derivatives/01-introduction.html>`_. The output directory structure is a simple tree like
10+
11+
.. code-block:: text
12+
13+
└── pipeline-name
14+
├── log
15+
│   └── pipeline_pipeline-name
16+
│   └── subject_session
17+
└── output
18+
└── cpac_pipeline-name
19+
└── subject_session
20+
├── anat
21+
└── func
22+
23+
.. note::
24+
25+
If any nodes use more memory at runtime than C-PAC estimates, C-PAC will report those instances near the end of the log in the terminal and in a log file called ``callback.log.resource_overusage.txt`` (beginning in v1.8.0). Please `report excessive memory usage <https://github.com/FCP-INDI/C-PAC/issues/new>`_ to the C-PAC team.
26+
27+
.. _1.7-outputs:
28+
29+
C-PAC ≤ 1.7.2
30+
^^^^^^^^^^^^^
331

432
A standard C-PAC run output directory for one participant-session is shown below. A directory like this will exist for each participant-session in the run.
533

@@ -12,7 +40,7 @@ This is with all derivatives enabled, and the output, smoothing, and z-scoring o
1240
.. figure:: /_images/output_dir_default.png
1341

1442
Descriptions
15-
^^^^^^^^^^^^^^^^^^^
43+
------------
1644

1745
The output directory folders below are produced during a default run. If you enabled the additional outputs and have the full directory, proceed to the "Full Directory" section further below for descriptions of these extra outputs.
1846

@@ -73,7 +101,7 @@ The output directory folders below are produced during a default run. If you ena
73101
* **QC-interface_{scan}_{nuisance/preprocessing strategy}.html**: :doc:`QC Interface HTML page </user/qc_interface>` for each scan and nuisance/preprocessing strategy combination.
74102

75103
Sub-Directories
76-
^^^^^^^^^^^^^^^^^^^^^^^^^^
104+
---------------
77105

78106
Each folder in the output directory may have a different amount of sub-directories, depending on how many functional scans specified in the data configuration, or how many pipeline customizations and forked strategies you specified in the pipeline configuration. For example, if there are multiple functional scans, you'll see a folder for each one if you enter any of the functional-derived outputs' folders, as seen below:
79107

@@ -88,7 +116,8 @@ And sub-directories for each ROI provided for a derivative that may take in mult
88116
.. figure:: /_images/output_dir_masks.png
89117

90118
Full Directory
91-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
119+
--------------
120+
92121
The C-PAC output directory is considerably larger when "Extra Functional Outputs", "Debugging Outputs", and both Smoothed/Non-smoothed and both z-score standardized/raw outputs are all enabled.
93122

94123
In addition to the output directories described above under "Descriptions", the following outputs are also written to the output directory when all of the output options mentioned above are enabled:
@@ -142,7 +171,7 @@ In addition to the output directories described above under "Descriptions", the
142171
* **reho**: The direct output of ReHo, before warping to standard space.
143172

144173
Visual Quality Control
145-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
174+
----------------------
146175

147176
C-PAC's data quality control (QC) interface allows you to take a quick glance at the overall quality of your results (registration quality, signal-to-noise ratio, movement plots, computed derivative histograms, etc.). In its current form, the QC interface is a collection of HTML pages - one for each participant-scan-nuisance regression strategy combination, and they can be found in the Output Directory under each participant's directory level.
148177

@@ -151,7 +180,7 @@ C-PAC's data quality control (QC) interface allows you to take a quick glance at
151180
In future releases, more visualizations will be introduced, and the QC pages will be integrated into an easy-to-use dashboard that is updated throughout the process of your C-PAC run, and also provides information on the status of the pipeline. As always, we greatly appreciate any ideas, suggestions, or items on your wishlist and `take them into consideration <https://groups.google.com/forum/#!forum/cpax_forum>`_.
152181

153182
Quick Look
154-
^^^^^^^^^^
183+
----------
155184

156185
**Skull-stripping and Segmentation Quality**
157186

docs/_sources/user/quick.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ C-PAC Quickstart
77

88
.. include:: cpac.rst
99

10-
For instructions to run in Docker or Singularity without installing cpac (Python package), see :doc:`All Run Options </user/running>`
10+
For instructions to run C-PAC in Docker or Singularity without installing cpac (Python package), see :doc:`All Run Options </user/running>`
11+
12+
.. include:: brainlife.io_app.rst
1113

1214
Default Pipeline
1315
----------------

0 commit comments

Comments
 (0)