Skip to content

Commit cd753a8

Browse files
committed
Revert "Bump jupyter-book from 1 to 2 (#74)"
This reverts commit 014d6eb.
1 parent 014d6eb commit cd753a8

425 files changed

Lines changed: 278789 additions & 8221 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ data/
33
_build/
44

55
# Generated figures (copied to docs/_images/ by Sphinx during build)
6-
content/figures/*
7-
!content/figures/
8-
!content/figures/*animation.gif
6+
content/figures/
97

108
.DS_Store
119

Makefile

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,13 @@
22
# `uv` honors UV_PROJECT_ENVIRONMENT to place the venv somewhere other than .venv.
33
export UV_PROJECT_ENVIRONMENT := meda
44

5-
# GitHub Pages serves this repository as a project site under this path.
6-
# MyST/Jupyter Book 2 uses BASE_URL to prefix CSS, JS, images, JSON, and route links.
7-
PAGES_BASE_URL ?= /multi-echo-data-analysis
8-
95
# Reproducible image outputs: matplotlib honors SOURCE_DATE_EPOCH and will stamp
106
# PNGs with a fixed timestamp instead of "now", so identical plots produce
117
# identical bytes (and identical content-hashed filenames in _images/).
128
# 1577836800 == 2020-01-01T00:00:00Z
139
export SOURCE_DATE_EPOCH := 1577836800
1410

15-
.PHONY: help check-env book clean serve sync-docs site-publish install runall build preview-docs
11+
.PHONY: help check-env book clean serve sync-docs site-publish install runall build site
1612

1713
help:
1814
@echo "Please use 'make <target>' where <target> is one of:"
@@ -21,9 +17,9 @@ help:
2117
@echo " book to activate 'meda' and build the Jupyter Book into _build/"
2218
@echo " clean to clean out site build files"
2319
@echo " runall to run all notebooks in-place, capturing outputs with the notebook"
24-
@echo " serve to build and serve the site locally at http://localhost:3000"
25-
@echo " build to build the site HTML into _build/html/"
26-
@echo " preview-docs to serve committed docs/ files at the GitHub Pages base path"
20+
@echo " serve to serve the repository locally with Jekyll"
21+
@echo " build to build the site HTML and store in _site/"
22+
@echo " site to build the site HTML, store in _site/, and serve with Jekyll"
2723
@echo " sync-docs to copy _build/html into docs/ for GitHub Pages"
2824
@echo " site-publish to build the book and sync docs/ (book + sync-docs)"
2925

@@ -39,24 +35,25 @@ check-env:
3935

4036
# Activate the 'meda' environment (via `uv run`) and build the book.
4137
book: check-env
42-
BASE_URL=$(PAGES_BASE_URL) uv run --locked jupyter-book build --html --execute
38+
uv run --locked jupyter-book build ./
4339

4440
sync-docs:
45-
uv run --locked python scripts/sync_docs.py
41+
python scripts/sync_docs.py
4642

4743
site-publish: book sync-docs
4844

4945
runall:
5046
jupyter-book run ./content
5147

5248
clean:
53-
uv run --locked python scripts/clean.py
49+
python scripts/clean.py
5450

55-
serve: check-env
56-
uv run --locked jupyter-book start
51+
serve:
52+
bundle exec guard
5753

5854
build: check-env
59-
BASE_URL=$(PAGES_BASE_URL) uv run --locked jupyter-book build --html --execute
55+
uv run --locked jupyter-book build ./
6056

61-
preview-docs:
62-
uv run --locked python scripts/serve_docs.py
57+
site: build
58+
bundle exec jekyll build
59+
touch _site/.nojekyll

_config.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
#######################################################################################
2+
# A default configuration that will be loaded for all jupyter books
3+
# Users are expected to override these values in their own `_config.yml` file.
4+
# This is also the "master list" of all allowed keys and values.
5+
6+
#######################################################################################
7+
# Book settings
8+
title : "Multi-Echo fMRI Data Analysis" # The title of the book. Will be placed in the left navbar.
9+
author : "The tedana community" # The author of the book
10+
copyright : "2021" # Copyright year to be placed in the footer
11+
logo : "logo.png" # A path to the book logo
12+
exclude_patterns : ["README.md", "content/*.py", "docs/**", "meda/**", ".venv/**", "data/ds*/logs/*.md", "data/ds*/*.md", "content/ds*/logs/*.md", "notebooks/README_notebooks.md", "notebooks/*.ipynb"]
13+
14+
#######################################################################################
15+
# Execution settings
16+
execute:
17+
execute_notebooks : "auto" # Whether to execute notebooks at build time. Must be one of ("auto", "force", "cache", "off")
18+
cache : "" # A path to the jupyter cache that will be used to store execution artifacs. Defaults to `_build/.jupyter_cache/`
19+
exclude_patterns : [] # A list of patterns to *skip* in execution (e.g. a notebook that takes a really long time)
20+
timeout : -1 # remove restriction on execution time
21+
22+
#######################################################################################
23+
# HTML-specific settings
24+
html:
25+
favicon : "" # A path to a favicon image
26+
use_edit_page_button : false # Whether to add an "edit this page" button to pages. If `true`, repository information in repository: must be filled in
27+
use_repository_button : true # Whether to add a link to your repository button
28+
use_issues_button : true # Whether to add an "open an issue" button
29+
extra_navbar : Powered by <a href="https://jupyterbook.org">Jupyter Book</a> # Will be displayed underneath the left navbar.
30+
extra_footer : "" # Will be displayed underneath the footer.
31+
analytics:
32+
google_analytics_id : "" # A GA id that can be used to track book views.
33+
home_page_in_navbar : true # Whether to include your home page in the left Navigation Bar
34+
baseurl : "" # The base URL where your book will be hosted. Used for creating image previews and social links. e.g.: https://mypage.com/mybook/
35+
comments:
36+
hypothesis : true
37+
38+
#######################################################################################
39+
# LaTeX-specific settings
40+
latex:
41+
latex_engine : pdflatex # one of 'pdflatex', 'xelatex' (recommended for unicode), 'luatex', 'platex', 'uplatex'
42+
use_jupyterbook_latex : true # use sphinx-jupyterbook-latex for pdf builds as default
43+
44+
#######################################################################################
45+
# Launch button settings
46+
launch_buttons:
47+
notebook_interface : classic # The interface interactive links will activate ["classic", "jupyterlab"]
48+
binderhub_url : https://mybinder.org # The URL of the BinderHub (e.g., https://mybinder.org)
49+
thebe : false # Add a thebe button to pages (requires the repository to run on Binder)
50+
51+
repository:
52+
url : https://github.com/ME-ICA/multi-echo-data-analysis # The URL to your book's repository
53+
path_to_book : "content" # A path to your book's folder, relative to the repository root.
54+
branch : "main" # Which branch of the repository should be used when creating links
55+
56+
#######################################################################################
57+
# Additional configuration info
58+
bibtex_bibfiles:
59+
- content/references.bib
60+
sphinx:
61+
extra_extensions:
62+
- sphinx_inline_tabs
63+
- sphinx_jupyterbook_latex
64+
- sphinx_proof
65+
- sphinxcontrib.bibtex
66+
config:
67+
bibtex_reference_style: author_year
68+
bibtex_default_style: unsrt
69+
html_js_files:
70+
- https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js
71+
intersphinx_mapping:
72+
tedana:
73+
- "https://tedana.readthedocs.io/en/0.0.11/"
74+
- null
75+
language: en

_toc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ parts:
2020
- file: content/fMRI_Sequences
2121
- file: content/Signal_Decay
2222
- file: content/TE_Dependence
23+
- file: content/plot_approach_figures.md
2324
- caption: Practical Resources
2425
chapters:
2526
- file: content/Multi_Echo_Datasets
@@ -35,7 +36,6 @@ parts:
3536
- file: content/06_Cerebrovascular_Reactivity_Mapping.md
3637
- file: content/07_Manual_Classification_with_rica.md
3738
- file: content/08_ICA_Based_Denoising.md
38-
- file: content/09_Advanced_Applications.md
3939
- caption: Final Thoughts
4040
chapters:
4141
- file: content/bibliography.md

content/01_Optimal_Combination_with_t2smap.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ glue_figure("figure_t2starmap", fig, display=False)
7676
:name: "figure_t2starmap"
7777
:align: center
7878
79-
T2* map estimated from multi-echo data using tedana's {external+tedana:py:func}`~tedana.workflows.t2smap_workflow`.
79+
T2* map estimated from multi-echo data using tedana's {py:func}`~tedana.workflows.t2smap_workflow`.
8080
```
8181

8282
```{code-cell} ipython3
@@ -102,7 +102,7 @@ glue_figure("figure_s0map", fig, display=False)
102102
:name: "figure_s0map"
103103
:align: center
104104
105-
S0 map estimated from multi-echo data using tedana's {external+tedana:py:func}`~tedana.workflows.t2smap_workflow`.
105+
S0 map estimated from multi-echo data using tedana's {py:func}`~tedana.workflows.t2smap_workflow`.
106106
```
107107

108108
```{code-cell} ipython3

content/02_Volume-wise_T2star_estimation_with_t2smap.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ kernelspec:
1212

1313
# Volume-wise T2*/S0 estimation with `t2smap`
1414

15-
Use {external+tedana:py:func}`tedana.workflows.t2smap_workflow` {cite:p}`DuPre2021` to calculate volume-wise T2*/S0,
15+
Use {py:func}`tedana.workflows.t2smap_workflow` {cite:p}`DuPre2021` to calculate volume-wise T2*/S0,
1616
as in {cite:t}`power2018ridding` and {cite:t}`heunis2021effects`.
1717

1818
```{code-cell} ipython3

content/03_Denoising_with_tedana.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ kernelspec:
1414

1515
In this analysis tutorial, we will use `tedana` {cite:p}`DuPre2021` to perform multi-echo denoising.
1616

17-
Specifically, we will use {external+tedana:py:func}`tedana.workflows.tedana_workflow`.
17+
Specifically, we will use {py:func}`tedana.workflows.tedana_workflow`.
1818

1919
```{code-cell} ipython3
2020
import json

content/08_ICA_Based_Denoising.md

Lines changed: 30 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ To remove noise from your data, you can regress the "bad" components out of it,
1818

1919
Let's start by loading the necessary data.
2020

21-
:::::{tab-set}
22-
::::{tab-item} Python
21+
````{tab} Python
2322
```python
2423
import numpy as np
2524
import pandas as pd
@@ -45,32 +44,30 @@ arr = arr.T
4544
# The first dimension should be time
4645
assert arr.shape[1] == mixing.shape[0]
4746
```
48-
::::
49-
::::{tab-item} FSL
47+
````
48+
````{tab} FSL
5049
```bash
5150
data_file=preprocessed_data.nii.gz
5251
mixing_file=mixing.tsv
5352
mask_file=mask.nii.gz
5453
den_idx=(0, 1, 2, 3, 4, 5)
5554
```
56-
::::
57-
::::{tab-item} AFNI
55+
````
56+
````{tab} AFNI
5857
```bash
5958
data_file=preprocessed_data.nii.gz
6059
mixing_file=mixing.tsv
6160
mask_file=mask.nii.gz
6261
den_idx=(0, 1, 2, 3, 4, 5)
6362
```
64-
::::
65-
:::::
63+
````
6664

6765
## Aggressive Denoising
6866

6967
If you regress just nuisance regressors (i.e., rejected components) out of your data,
7068
then retain the residuals for further analysis, you are doing aggressive denoising.
7169

72-
:::::{tab-set}
73-
::::{tab-item} Python
70+
````{tab} Python
7471
```python
7572
# Fit GLM to bad components only
7673
betas = np.linalg.lstsq(motion_components, arr, rcond=None)[0]
@@ -83,26 +80,24 @@ arr_denoised = arr - pred_arr
8380
img_denoised = masking.unmask(arr_denoised.T, data['mask'])
8481
img_denoised.to_filename("denoised.nii.gz")
8582
```
86-
::::
87-
::::{tab-item} FSL
83+
````
84+
````{tab} FSL
8885
```bash
8986
3dcalc --input stuff
9087
```
91-
::::
92-
::::{tab-item} AFNI
88+
````
89+
````{tab} AFNI
9390
```bash
9491
3dcalc --input stuff
9592
```
96-
::::
97-
:::::
93+
````
9894

9995
## Non-Aggressive Denoising
10096

10197
If you include both nuisance regressors and regressors of interest in your regression,
10298
you are doing nonaggressive denoising.
10399

104-
:::::{tab-set}
105-
::::{tab-item} Python
100+
````{tab} Python
106101
```python
107102
# Fit GLM to all components
108103
betas = np.linalg.lstsq(mixing, arr, rcond=None)[0]
@@ -115,18 +110,17 @@ arr_denoised = arr - pred_arr
115110
img_denoised = masking.unmask(arr_denoised.T, data['mask'])
116111
img_denoised.to_filename("denoised.nii.gz")
117112
```
118-
::::
119-
::::{tab-item} FSL
113+
````
114+
````{tab} FSL
120115
```bash
121116
3dcalc --input stuff
122117
```
123-
::::
124-
::::{tab-item} AFNI
118+
````
119+
````{tab} AFNI
125120
```bash
126121
3dcalc --input stuff
127122
```
128-
::::
129-
:::::
123+
````
130124

131125
## Component orthogonalization
132126

@@ -136,8 +130,7 @@ If you want to ensure that variance shared between the accepted and rejected com
136130
you may wish to orthogonalize the rejected components with respect to the accepted components.
137131
This way, you can regress the rejected components out of the data in the form of, what we call, "pure evil" components.
138132

139-
:::::{tab-set}
140-
::::{tab-item} Python
133+
````{tab} Python
141134
```python
142135
good_idx = np.setdiff1d(np.arange(mixing.shape[1]), den_idx)
143136
@@ -153,23 +146,21 @@ orth_motion_components = bad_mixing - pred_bad_mixing
153146
# Replace the old component time series in the mixing matrix with the new ones
154147
mixing[:, den_idx] = orth_motion_components
155148
```
156-
::::
157-
::::{tab-item} FSL
149+
````
150+
````{tab} FSL
158151
```bash
159152
3dcalc --input stuff
160153
```
161-
::::
162-
::::{tab-item} AFNI
154+
````
155+
````{tab} AFNI
163156
```bash
164157
3dcalc --input stuff
165158
```
166-
::::
167-
:::::
159+
````
168160

169161
Once you have these "pure evil" components, you can perform aggressive denoising on the data.
170162

171-
:::::{tab-set}
172-
::::{tab-item} Python
163+
````{tab} Python
173164
```python
174165
# Fit GLM to bad components only
175166
betas = np.linalg.lstsq(orth_motion_components, arr, rcond=None)[0]
@@ -182,15 +173,14 @@ arr_denoised = arr - pred_arr
182173
img_denoised = masking.unmask(arr_denoised.T, data['mask'])
183174
img_denoised.to_filename("denoised.nii.gz")
184175
```
185-
::::
186-
::::{tab-item} FSL
176+
````
177+
````{tab} FSL
187178
```bash
188179
3dcalc --input stuff
189180
```
190-
::::
191-
::::{tab-item} AFNI
181+
````
182+
````{tab} AFNI
192183
```bash
193184
3dcalc --input stuff
194185
```
195-
::::
196-
:::::
186+
````

0 commit comments

Comments
 (0)