Skip to content

Commit

Permalink
Aligning robustICA with current Main + (#5)
Browse files Browse the repository at this point in the history
* Limit current adaptive mask method to brain mask (ME-ICA#1060)

* Limit adaptive mask calculation to brain mask.

Limit adaptive mask calculation to brain mask.

Expand on logic of first adaptive mask method.

Update tedana/utils.py

Improve docstring.

Update test.

Add decreasing-signal-based adaptive mask.

Keep removing.

Co-Authored-By: Dan Handwerker <[email protected]>

* Use `compute_epi_mask` in t2smap workflow.

* Try fixing the tests.

* Fix make_adaptive_mask.

* Update test_utils.py

* Update test_utils.py

* Improve docstring.

* Update utils.py

* Update test_utils.py

* Revert "Update test_utils.py"

This reverts commit 259b002.

* Don't take absolute value of echo means.

* Log echo-wise thresholds in adaptive mask.

* Add comment about non-zero voxels.

* Update utils.py

* Update test_utils.py

* Update test_utils.py

* Update test_utils.py

* Log the thresholds again.

* Address review.

* Fix test.

---------

Co-authored-by: Dan Handwerker <[email protected]>

* Update nilearn requirement from <=0.10.3,>=0.7 to >=0.7,<=0.10.4 (ME-ICA#1077)

* Add adaptive mask plot to report (ME-ICA#1073)

* Update scikit-learn requirement (ME-ICA#1075)

Updates the requirements on [scikit-learn](https://github.com/scikit-learn/scikit-learn) to permit the latest version.
- [Release notes](https://github.com/scikit-learn/scikit-learn/releases)
- [Commits](scikit-learn/scikit-learn@0.21.0...1.4.2)

---
updated-dependencies:
- dependency-name: scikit-learn
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update pandas requirement from <=2.2.1,>=2.0 to >=2.0,<=2.2.2 (ME-ICA#1076)

Updates the requirements on [pandas](https://github.com/pandas-dev/pandas) to permit the latest version.
- [Release notes](https://github.com/pandas-dev/pandas/releases)
- [Commits](pandas-dev/pandas@v2.0.0...v2.2.2)

---
updated-dependencies:
- dependency-name: pandas
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update bokeh requirement from <=3.4.0,>=1.0.0 to >=1.0.0,<=3.4.1 (ME-ICA#1078)

Updates the requirements on [bokeh](https://github.com/bokeh/bokeh) to permit the latest version.
- [Changelog](https://github.com/bokeh/bokeh/blob/branch-3.5/docs/CHANGELOG)
- [Commits](bokeh/bokeh@1.0.0...3.4.1)

---
updated-dependencies:
- dependency-name: bokeh
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Load user-defined mask as expected by plot_adaptive_mask (ME-ICA#1079)

* DOC desc-optcomDenoised -> desc-denoised (ME-ICA#1080)

* docs: add mvdoc as a contributor for code, bug, and doc (ME-ICA#1082)

* docs: update README.md

* docs: update .all-contributorsrc

---------

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>

* Identify the last good echo in adaptive mask instead of sum of good echoes (ME-ICA#1061)

* Limit adaptive mask calculation to brain mask.

Limit adaptive mask calculation to brain mask.

Expand on logic of first adaptive mask method.

Update tedana/utils.py

Improve docstring.

Update test.

Add decreasing-signal-based adaptive mask.

Keep removing.

Co-Authored-By: Dan Handwerker <[email protected]>

* Use `compute_epi_mask` in t2smap workflow.

* Try fixing the tests.

* Fix make_adaptive_mask.

* Update test_utils.py

* Update test_utils.py

* Improve docstring.

* Identify the last good echo instead of sum.

Improve docstring.

Update test_utils.py

Update test_utils.py

Fix make_adaptive_mask.

Try fixing the tests.

Use `compute_epi_mask` in t2smap workflow.

Limit adaptive mask calculation to brain mask.

Limit adaptive mask calculation to brain mask.

Expand on logic of first adaptive mask method.

Update tedana/utils.py

Improve docstring.

Update test.

Add decreasing-signal-based adaptive mask.

Keep removing.

Co-Authored-By: Dan Handwerker <[email protected]>

* Fix.

* Update utils.py

* Update utils.py

* Try fixing.

* Update utils.py

* Update utils.py

* add checks

* Just loop over voxels.

* Update utils.py

* Update utils.py

* Update test_utils.py

* Revert "Update test_utils.py"

This reverts commit 259b002.

* Update test_utils.py

* Update test_utils.py

* Remove checks.

* Don't take absolute value of echo means.

* Log echo-wise thresholds in adaptive mask.

* Add comment about non-zero voxels.

* Update utils.py

* Update utils.py

* Update test_utils.py

* Update test_utils.py

* Update test_utils.py

* Log the thresholds again.

* Update test_utils.py

* Update test_utils.py

* Update test_utils.py

* Add simulated data to adaptive mask test.

* Clean up the tests.

* Add value that tests the base mask.

* Remove print in test.

* Update tedana/utils.py

Co-authored-by: Dan Handwerker <[email protected]>

* Update tedana/utils.py

Co-authored-by: Dan Handwerker <[email protected]>

---------

Co-authored-by: Dan Handwerker <[email protected]>

* Output RMSE map and time series for decay model fit (ME-ICA#1044)

* Draft function to calculate decay model fit.

* Calculate root mean squared error instead.

* Incorporate metrics.

* Output RMSE results.

* Output results in tedana.

* Hopefully fix things.

* Update decay.py

* Try improving performance.

* Update decay.py

* Fix again.

* Use tqdm.

* Update decay.py

* Update decay.py

* Update decay.py

* Update expected outputs.

* Add figures.

* Update outputs.

* Include global signal in confounds file.

* Update fiu_four_echo_outputs.txt

* Rename function.

* Rename function.

* Update tedana.py

* Update tedana/decay.py

Co-authored-by: Dan Handwerker <[email protected]>

* Update decay.py

* Update decay.py

* Whoops.

* Apply suggestions from code review

Co-authored-by: Dan Handwerker <[email protected]>

* Fix things maybe.

* Fix things.

* Update decay.py

* Remove any files that are built through appending.

* Update outputs.

* Add section on plots to docs.

* Fix the description.

* Update docs/outputs.rst

Co-authored-by: Dan Handwerker <[email protected]>

* Update docs/outputs.rst

* Fix docstring.

---------

Co-authored-by: Dan Handwerker <[email protected]>

* minimum nilearn 0.10.3 (ME-ICA#1094)

* Use nearest-neighbors interpolation in `plot_component` (ME-ICA#1098)

* Use nearest-neighbors interpolation in plot_stat_map.

* Only use NN interp for component maps.

* Update scipy requirement from <=1.13.0,>=1.2.0 to >=1.2.0,<=1.13.1 (ME-ICA#1100)

Updates the requirements on [scipy](https://github.com/scipy/scipy) to permit the latest version.
- [Release notes](https://github.com/scipy/scipy/releases)
- [Commits](scipy/scipy@v1.2.0...v1.13.1)

---
updated-dependencies:
- dependency-name: scipy
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update scikit-learn requirement from <=1.4.2,>=0.21 to >=0.21,<=1.5.0 (ME-ICA#1101)

Updates the requirements on [scikit-learn](https://github.com/scikit-learn/scikit-learn) to permit the latest version.
- [Release notes](https://github.com/scikit-learn/scikit-learn/releases)
- [Commits](scikit-learn/scikit-learn@0.21.0...1.5.0)

---
updated-dependencies:
- dependency-name: scikit-learn
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update numpy requirement from <=1.26.4,>=1.16 to >=1.16,<=2.0.0 (ME-ICA#1104)

* Update numpy requirement from <=1.26.4,>=1.16 to >=1.16,<=2.0.0

Updates the requirements on [numpy](https://github.com/numpy/numpy) to permit the latest version.
- [Release notes](https://github.com/numpy/numpy/releases)
- [Changelog](https://github.com/numpy/numpy/blob/main/doc/RELEASE_WALKTHROUGH.rst)
- [Commits](numpy/numpy@v1.16.0...v2.0.0)

---
updated-dependencies:
- dependency-name: numpy
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

* Use np.nan instead of np.NaN

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Taylor Salo <[email protected]>

* Filter out non-diagonal affine warning (ME-ICA#1103)

* Filter out non-diagonal affine warning.

* Fix warning capture.

* Update tedana/reporting/static_figures.py

Co-authored-by: Dan Handwerker <[email protected]>

* Update static_figures.py

---------

Co-authored-by: Dan Handwerker <[email protected]>

* Update bokeh requirement from <=3.4.1,>=1.0.0 to <=3.5.0,>=3.5.0 (ME-ICA#1109)

* Update bokeh requirement from <=3.4.1,>=1.0.0 to <=3.5.0,>=3.5.0

Updates the requirements on [bokeh](https://github.com/bokeh/bokeh) to permit the latest version.
- [Changelog](https://github.com/bokeh/bokeh/blob/branch-3.6/docs/CHANGELOG)
- [Commits](bokeh/bokeh@1.0.0...3.5.0)

---
updated-dependencies:
- dependency-name: bokeh
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

* Update pyproject.toml

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Taylor Salo <[email protected]>

* Update scikit-learn requirement from <=1.5.0,>=0.21 to <=1.5.1,>=1.5.1 (ME-ICA#1108)

* Update scikit-learn requirement from <=1.5.0,>=0.21 to <=1.5.1,>=1.5.1

Updates the requirements on [scikit-learn](https://github.com/scikit-learn/scikit-learn) to permit the latest version.
- [Release notes](https://github.com/scikit-learn/scikit-learn/releases)
- [Commits](scikit-learn/scikit-learn@0.21.0...1.5.1)

---
updated-dependencies:
- dependency-name: scikit-learn
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

* Update pyproject.toml to restore minimum version of scikit-learn

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Dan Handwerker <[email protected]>

* Update scipy requirement from <=1.13.1,>=1.2.0 to <=1.14.0,>=1.14.0 (ME-ICA#1106)

* Update scipy requirement from <=1.13.1,>=1.2.0 to <=1.14.0,>=1.14.0

Updates the requirements on [scipy](https://github.com/scipy/scipy) to permit the latest version.
- [Release notes](https://github.com/scipy/scipy/releases)
- [Commits](scipy/scipy@v1.2.0...v1.14.0)

---
updated-dependencies:
- dependency-name: scipy
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

* Update pyproject.toml to retain minimum version of scipy

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Dan Handwerker <[email protected]>
Co-authored-by: Eneko Uruñuela <[email protected]>

* Update numpy requirement from <=2.0.0,>=1.16 to >=1.16,<=2.0.1 (ME-ICA#1112)

Updates the requirements on [numpy](https://github.com/numpy/numpy) to permit the latest version.
- [Release notes](https://github.com/numpy/numpy/releases)
- [Changelog](https://github.com/numpy/numpy/blob/main/doc/RELEASE_WALKTHROUGH.rst)
- [Commits](numpy/numpy@v1.16.0...v2.0.1)

---
updated-dependencies:
- dependency-name: numpy
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Cleaning up installation instructions (ME-ICA#1113)

* install instructions

* Update docs/installation.rst

Co-authored-by: Taylor Salo <[email protected]>

* Update docs/installation.rst

Co-authored-by: Eneko Uruñuela <[email protected]>

---------

Co-authored-by: Taylor Salo <[email protected]>
Co-authored-by: Eneko Uruñuela <[email protected]>

* Update bokeh requirement from <=3.5.0,>=1.0.0 to >=1.0.0,<=3.5.1 (ME-ICA#1116)

Updates the requirements on [bokeh](https://github.com/bokeh/bokeh) to permit the latest version.
- [Changelog](https://github.com/bokeh/bokeh/blob/3.5.1/docs/CHANGELOG)
- [Commits](bokeh/bokeh@1.0.0...3.5.1)

---
updated-dependencies:
- dependency-name: bokeh
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update list of multi-echo datasets (ME-ICA#1115)

* Generate metrics from external regressors using F stats (ME-ICA#1064)

* Get required metrics from decision tree.

* Continue changes.

* More updates.

* Store necessary_metrics as a list.

* Update selection_nodes.py

* Update selection_utils.py

* Update across the package.

* Keep updating.

* Update tedana.py

* Add extra metrics to list.

* Update ica_reclassify.py

* Draft metric-based regressor correlations.

* Fix typo.

* Work on trees.

* Expand regular expressions in trees.

* Fix up the expansion.

* Really fix it though.

* Fix style issue.

* Added external regress integration test

* Got intregration test with external regressors working

* Added F tests and options

* added corr_no_detrend.json

* updated names and reporting

* Run black.

* Address style issues.

* Try fixing test bugs.

* Update test_component_selector.py

* Update component_selector.py

* Use component table directly in selectcomps2use.

* Fix.

* Include generated metrics in necessary metrics.

* Update component_selector.py

* responding to feedback from tsalo

* Update component_selector.py

* Update test_component_selector.py

* fixed some testing failures

* fixed test_check_null_succeeds

* fixed ica_reclassify bug and selector_properties test

* ComponentSelector initialized before loading data

* fixed docstrings

* updated building decision tree docs

* using external regressors and most tests passing

* removed corr added tasks

* fit_model moved to stats

* removed and cleaned up external_regressors_config option

* Added task regressors and some tests. Now alll in decision tree

* cleaning up decision tree json files

* removed mot12_csf.json changed task to signal

* fixed tests with task_keep signal

* Update tedana/metrics/external.py

Co-authored-by: Taylor Salo <[email protected]>

* Update tedana/metrics/_utils.py

Co-authored-by: Taylor Salo <[email protected]>

* Update tedana/metrics/collect.py

Co-authored-by: Taylor Salo <[email protected]>

* Update tedana/metrics/external.py

Co-authored-by: Taylor Salo <[email protected]>

* Update tedana/metrics/external.py

Co-authored-by: Taylor Salo <[email protected]>

* Responding to review comments

* reworded docstring

* Added type hints to external.py

* fixed external.py type hints

* type hints to _utils collect and component_selector

* type hints and doc improvements in selection_utils

* no expand_node recursion

* removed expand_nodes expand_node expand_dict

* docstring lines break on punctuation

* updating external tests and docs

* moved test data downloading to tests.utils.py and started test for fit_regressors

* fixed bug where task regressors retained in partial models

* matched testing external regressors to included mixing and fixed bugs

* Made single function for detrending regressors

* added tests for external fit_regressors and fix_mixing_to_regressors

* Full tests in test_external_metrics.py

* adding tests

* fixed extern regress validation warnings and added tests

* sorting set values for test outputs

* added to test_metrics

* Added docs to building_decision_trees.rst

* Added motion task decision tree flow chart

* made recommended change to external_regressor_config

* Finished documentation and renamed demo decision trees

* added link to example external regressors tsv file

* Apply suggestions from code review

Fixed nuissance typos

Co-authored-by: Taylor Salo <[email protected]>

* Minor documentation edits

---------

Co-authored-by: Taylor Salo <[email protected]>
Co-authored-by: Taylor Salo <[email protected]>
Co-authored-by: Neha Reddy <[email protected]>

* Link to the open-multi-echo-data website (ME-ICA#1117)

* Update multi-echo.rst

* Update multi-echo.rst

* Refactor `metrics.dependence` module (ME-ICA#1088)

* Add type hints to metric functions.

* Use keyword arguments.

* Update tests.

* Update dependence.py

* Update collect.py

* Fix other stuff.

* documentation and resource updates (ME-ICA#1114)

* documentation and resource updates

* Fixed citation numbering and updated posters

---------

Co-authored-by: Neha Reddy <[email protected]>

* Adding already requested changes

* fixed failing tests

* updated documentation in faq.rst

* more documentation changes

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Taylor Salo <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Matteo Visconti di Oleggio Castello <[email protected]>
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Eneko Uruñuela <[email protected]>
Co-authored-by: Taylor Salo <[email protected]>
Co-authored-by: Taylor Salo <[email protected]>
Co-authored-by: Neha Reddy <[email protected]>
  • Loading branch information
9 people authored Aug 30, 2024
1 parent b60e9a6 commit efb712e
Show file tree
Hide file tree
Showing 62 changed files with 4,308 additions and 618 deletions.
11 changes: 11 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,17 @@
"contributions": [
"code"
]
},
{
"login": "mvdoc",
"name": "Matteo Visconti di Oleggio Castello",
"avatar_url": "https://avatars.githubusercontent.com/u/6150554?v=4",
"profile": "https://github.com/mvdoc",
"contributions": [
"code",
"bug",
"doc"
]
}
],
"contributorsPerLine": 5,
Expand Down
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ docs/generated/
.pytest_cache/
.testing_data_cache/

# For decision tree .tex flow charts do not archive intermediate files
decision_tree*.aux
decision_tree*.fdb_latexmk
decision_tree*.fls
decision_tree*.log
decision_tree*.synctex.gz

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,9 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<td align="center" valign="top" width="20%"><a href="https://github.com/martinezeguiluz"><img src="https://avatars.githubusercontent.com/u/129765987?v=4?s=100" width="100px;" alt="Maitane Martinez Eguiluz"/><br /><sub><b>Maitane Martinez Eguiluz</b></sub></a><br /><a href="https://github.com/ME-ICA/tedana/commits?author=martinezeguiluz" title="Code">💻</a></td>
<td align="center" valign="top" width="20%"><a href="https://github.com/martaarbizu"><img src="https://avatars.githubusercontent.com/u/127724722?v=4?s=100" width="100px;" alt="Marta Arbizu Gómez"/><br /><sub><b>Marta Arbizu Gómez</b></sub></a><br /><a href="https://github.com/ME-ICA/tedana/commits?author=martaarbizu" title="Code">💻</a></td>
</tr>
<tr>
<td align="center" valign="top" width="20%"><a href="https://github.com/mvdoc"><img src="https://avatars.githubusercontent.com/u/6150554?v=4?s=100" width="100px;" alt="Matteo Visconti di Oleggio Castello"/><br /><sub><b>Matteo Visconti di Oleggio Castello</b></sub></a><br /><a href="https://github.com/ME-ICA/tedana/commits?author=mvdoc" title="Code">💻</a> <a href="https://github.com/ME-ICA/tedana/issues?q=author%3Amvdoc" title="Bug reports">🐛</a> <a href="https://github.com/ME-ICA/tedana/commits?author=mvdoc" title="Documentation">📖</a></td>
</tr>
</tbody>
</table>

Expand Down
Binary file added docs/_static/adaptive_mask.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
\documentclass[border=2pt]{standalone}
\usepackage[utf8]{inputenc} % Required for inserting images
\usepackage{tikz}
\usepackage{helvet}
\usetikzlibrary{shapes.geometric, arrows}
\pagecolor{white}

%-------------------------defining colorblind friendly colors
% Using pale color scheme in Figure 6
% by Paul Tol https://personal.sron.nl/~pault/
\definecolor{cbblue}{HTML}{BBCCEE}
\definecolor{cbcyan}{HTML}{CCEEFF}
\definecolor{cbgreen}{HTML}{CCDDAA}
\definecolor{cbyellow}{HTML}{EEEEBB}
\definecolor{cbred}{HTML}{FFCCCC}
\definecolor{cbgrey}{HTML}{DDDDDD}

% -------------------------defining nodes
\tikzstyle{input} = [trapezium, trapezium left angle =80, trapezium right angle = 100,
minimum width= 3cm, minimum height=0.5cm, text centered, draw=black, fill=cbblue]
\tikzstyle{process} = [rectangle, minimum width = 3cm, minimum height = 1cm,
text centered, , text width=4cm,draw=black, fill=cbgrey]
\tikzstyle{decision} = [diamond, minimum width = 3cm, minimum height = 1cm,
text centered, , text width=3cm, draw=black, fill=cbcyan]
\tikzstyle{changeclass} = [rectangle, rounded corners, minimum width=3cm, minimum height=1cm,
text centered, draw = black, fill=cbyellow]
\tikzstyle{reject} = [trapezium, trapezium left angle =80, trapezium right angle = 100,
minimum width= 1cm, minimum height=0.5cm, text centered, draw=black, fill=cbred]
\tikzstyle{accept} = [trapezium, trapezium left angle =80, trapezium right angle = 100,
minimum width= 1cm, minimum height=0.5cm, text centered, draw=black, fill=cbgreen]

% -------------------------defining connectors
\tikzstyle{arrow} = [thick,->, >=stealth]
\tikzstyle{line} = [thick,-,>=stealth]
\begin{document}

% ------------------------- tikz image (flow chart)
\begin{tikzpicture}[node distance = 2cm]

% ------------------------- nodes -------------------------
% ----- node: 0
\node(0)[input,label={90:\textbf{Demo Decision Tree with External Regressors, Motion, and Task Models}}, label={180:$node\ 0$}]{Set all components to unclassified};
% ----- node: 1
\node(1)[decision, below of=0,label={180:$node\ 1$}, yshift=-1.5cm]{$\rho$ $>$ $\kappa$};
\node(rej1)[changeclass, right of=1, xshift=3cm, align=center]{Unlikely BOLD\\$\rightarrow$ Provisional reject};
% ----- node: 2
\node(2)[decision, below of=1,label={180:$node\ 2$}, label={[align=center] 315: voxel counts for signif fit\\of multi-echo data\\to $T_2$ or $S_0$ decay models}, yshift=-4.0cm]{$n \, FS_0 \, > \, n \, FT_2$ \& $n \,FT_2$ $>$ 0};
\node(rej2)[changeclass, right of=2, xshift=3cm, align=center]{Unlikely BOLD\\$\rightarrow$ Provisional Reject};
% ----- node: 3
\node(3)[process, below of=2, label={180:$node\ 3$}, label={[align=center] 315: varex: variance explained\\by each component}, yshift=-2.0cm]{Calculate median(varex) across all components};
% ----- node: 4
\node(4)[decision, below of=3,label={180:$node\ 4$},label={[align=center] 315:DICE overlap between $T_2$ or $S_0$\\decay models and ICA component\\peak clusters}, yshift=-1.5cm]{dice $FS_0$ $>$ dice $FT_2$ \& varex $>$ median(varex)
};
\node(rej4)[changeclass, right of=4, xshift=3cm, align=center]{Unlikely BOLD\\$\rightarrow$ Provisional Reject};
% ----- node: 5
\node(5)[decision, below of=4,label={180:$node\ 5$}, label={[align=center] 315: $t-statistic$ of $FT_2$ values\\in component peak clusters vs\\peak voxels outside of clusters}, yshift=-4.0cm]{ $0 \, >$ signal-noise \& varex $>$ median(varex)};
\node(rej5)[changeclass, right of=5, xshift=3cm, align=center]{Unlikely BOLD\\$\rightarrow$ Provisional Reject};
% ----- node: 6
\node(6)[process, below of=5, label={180:$node\ 6$}, label={0: Uses all components}, yshift=-2.0cm]{Calculate $\kappa$ elbow};
% ----- node: 7
\node(7)[process, below of=6, label={180:$node\ 7$}, label={[align=center] 0: Uses all components and subset\\of unclassified components}]{Calculate $\rho$ elbow\\(liberal method)};
% ----- node: 8
\node(8)[decision, below of=7,label={180:$node\ 8$}, yshift=-1.5cm]{$\kappa \geq \kappa$ elbow\\$\rho$ $<$ $\rho$ elbow};
\node(chrej8)[changeclass, below of=8, xshift=0cm, yshift=-2cm]{Provisional reject};
\node(chacc8)[changeclass, right of=8, xshift=3cm, yshift=0cm]{Provisional accept};
% ----- node: 9
\node(9)[decision, below of=chrej8,label={180:$node\ 9$},label={20: Accept even if $\rho < \rho\ elbow$},yshift=-1.5cm]{$\kappa > 2\rho$\\$\kappa \geq \kappa$ elbow};
\node(chrej9)[changeclass, below of=9, xshift=0cm, yshift=-2cm]{Provisional reject};
\node(chacc9)[changeclass, right of=9, xshift=3cm, yshift=0cm]{Provisional accept};
% ----- node: 10
\node(10)[decision, below of=chacc9,label={150:$node\ 10$},label={[align=center] 310: Reject if\\fits external\\nuisance\\regressors},yshift=-2cm]{F test for\\Nuisance Regressors\\$p_{Full} \leq 0.05$\\$R^2_{Full} \geq 0.5$};
\node(chrej10)[changeclass, below of=10, xshift=0cm, yshift=-2cm, align=center]{External regressors\\$\rightarrow$Provisional reject};
% ----- node: 11
\node(11)[decision, left of=chrej10,label={180:$node\ 11$},xshift=-3cm]{Partial F test for\\Motion Regressors\\$p_{Full} \leq 0.05$\\$R^2_{Full} \geq 0.5$\\$p_{Motion} \leq 0.05$};
\node(chtag11)[changeclass, below of=11, xshift=0cm, yshift=-2cm, align=center]{Tag:\\Fits motion\\external regressors};
% ----- node: 12
\node(12)[decision, below of=chrej10,label={150:$node\ 12$},yshift=-2cm]{Partial F test for\\CSF Regressors\\$p_{Full} \leq 0.05$\\$R^2_{Full} \geq 0.5$\\$p_{CSF} \leq 0.05$};
\node(chtag12)[changeclass, below of=12, xshift=0cm, yshift=-2cm, align=center]{Tag:\\Fits CSF\\external regressors};
% ----- node: 13
\node(prej13)[changeclass, below of=chtag11, xshift=0cm, yshift=-0.5cm]{Provisional reject};
\node(13)[decision, below of=prej13,label={180:$node\ 13$},label={[align=center] 335: If fits task and\\contains T2*, accept\\even if other criteria\\would have rejected},yshift=-2cm]{F test for\\Task Regressors\\$p_{Task} \leq 0.05$\\$R^2_{Task} \geq 0.5$\\$\kappa \geq \kappa$ elbow};
\node(chacc13)[accept, right of=13,xshift=3cm, align=center]{Fits task\\$\rightarrow$Accept};
% ----- node: 14
\node(14)[decision, below of=13,label={180:$node\ 14$},label={[align=left] 335: Will accept the lowest\\variance components until\\1\% of total variance is\\accepted this way}, yshift=-3.5cm]{$if$ component variance $<0.1$};%--check in kundu
\node(acc14)[accept, right of=14, xshift=2.5cm, align=center]{Low variance\\$\rightarrow$ Accept};
% ----- node: 15
\node(15)[accept, below of=14,label={180:$node\ 15$},yshift=-1.5cm, align=center]{Likely BOLD\\Change provisional accept\\$\rightarrow$Accept};
% ----- node: 16
\node(16)[reject, below of=15,label={180:$node\ 16$}, yshift=0cm, align=center]{Unlikely BOLD\\Change provisional reject\\$\rightarrow$Reject};

% ------------------------- connections -------------------------
% draw[x](origin)--node[anchor=position]{text}(destination);
\draw[arrow](0)--(1);
\draw[arrow](1)--node[anchor=south, right=0] {no} (2);
\draw[arrow](1)--node[anchor=south] {yes} (rej1);
\draw[arrow](2)--node[anchor=south, right=0] {no} (3);
\draw[arrow](2)--node[anchor=south] {yes} (rej2);
\draw[arrow](3)--(4);
\draw[arrow](4)--node[anchor=south, right=0] {no} (5);
\draw[arrow](4)--node[anchor=south] {yes} (rej4);
\draw[arrow](5)--node[anchor=south, right=0] {no} (6);
\draw[arrow](5)--node[anchor=south] {yes} (rej5);
\draw[arrow](6)--(7);
\draw[arrow](7)--(8);
\draw[arrow](8)--node[anchor=south] {yes} (chacc8);
\draw[arrow](8)--node[anchor=south, right=0] {no} (chrej8);
\draw[arrow](chrej8)--(9);
\draw[arrow](9)--node[anchor=south] {yes} (chacc9);
\draw[arrow](9)--node[anchor=south, right=0] {no} (chrej9);
\draw[arrow](chacc9)--(10);
\draw[arrow](chrej9)--(10);
\draw[arrow](10)--node[anchor=south, right=0] {yes} (chrej10);
\draw[arrow](chrej10)--(11);
\draw[arrow](11)--node[anchor=south, right=0] {yes} (chtag11);
\draw[arrow](chrej10)--(12);
\draw[arrow](12)--node[anchor=south, right=0] {yes} (chtag12);
\draw[arrow](prej13)--(13);
\draw[arrow](13)--node[anchor=south] {yes} (chacc13);
\draw[arrow](13)--node[anchor=south, right=0] {no} (14);
\draw[arrow](14)--node[anchor=south] {yes} (acc14);
\end{tikzpicture}
\end{document}
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
109 changes: 109 additions & 0 deletions docs/_static/decision_tree_demo_external_regressors_single_model.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
\documentclass[border=2pt]{standalone}
\usepackage[utf8]{inputenc} % Required for inserting images
\usepackage{tikz}
\usepackage{helvet}
\usetikzlibrary{shapes.geometric, arrows}
\pagecolor{white}

%-------------------------defining colorblind friendly colors
% Using pale color scheme in Figure 6
% by Paul Tol https://personal.sron.nl/~pault/
\definecolor{cbblue}{HTML}{BBCCEE}
\definecolor{cbcyan}{HTML}{CCEEFF}
\definecolor{cbgreen}{HTML}{CCDDAA}
\definecolor{cbyellow}{HTML}{EEEEBB}
\definecolor{cbred}{HTML}{FFCCCC}
\definecolor{cbgrey}{HTML}{DDDDDD}

% -------------------------defining nodes
\tikzstyle{input} = [trapezium, trapezium left angle =80, trapezium right angle = 100,
minimum width= 3cm, minimum height=0.5cm, text centered, draw=black, fill=cbblue]
\tikzstyle{process} = [rectangle, minimum width = 3cm, minimum height = 1cm,
text centered, , text width=4cm,draw=black, fill=cbgrey]
\tikzstyle{decision} = [diamond, minimum width = 3cm, minimum height = 1cm,
text centered, , text width=3cm, draw=black, fill=cbcyan]
\tikzstyle{changeclass} = [rectangle, rounded corners, minimum width=3cm, minimum height=1cm,
text centered, draw = black, fill=cbyellow]
\tikzstyle{reject} = [trapezium, trapezium left angle =80, trapezium right angle = 100,
minimum width= 1cm, minimum height=0.5cm, text centered, draw=black, fill=cbred]
\tikzstyle{accept} = [trapezium, trapezium left angle =80, trapezium right angle = 100,
minimum width= 1cm, minimum height=0.5cm, text centered, draw=black, fill=cbgreen]

% -------------------------defining connectors
\tikzstyle{arrow} = [thick,->, >=stealth]
\tikzstyle{line} = [thick,-,>=stealth]
\begin{document}

% ------------------------- tikz image (flow chart)
\begin{tikzpicture}[node distance = 2cm]

% ------------------------- nodes -------------------------
% ----- node: 0
\node(0)[input,label={90:\textbf{Demo Decision Tree. Single model with external regressors}}, label={180:$node\ 0$}]{Set all components to unclassified};
% ----- node: 1
\node(1)[decision, below of=0,label={180:$node\ 1$}, yshift=-1cm]{$\rho$ $>$ $\kappa$};
\node(rej1)[reject, right of=1, xshift=2cm, align=center]{Unlikely BOLD\\$\rightarrow$ Reject};
% ----- node: 2
\node(2)[decision, below of=1,label={180:$node\ 2$}, label={[align=center] 315: voxel counts for signif fit\\of multi-echo data\\to $T_2$ or $S_0$ decay models}, yshift=-3.0cm]{$n \, FS_0 \, > \, n \, FT_2$ \& $n \,FT_2$ $>$ 0};
\node(rej2)[reject, right of=2, xshift=2cm, align=center]{Unlikely BOLD\\$\rightarrow$ Reject};
% ----- node: 3
\node(3)[process, below of=2, label={180:$node\ 3$}, label={[align=center] 315: varex: variance explained\\by each component}, yshift=-1.5cm]{Calculate median(varex) across all components};
% ----- node: 4
\node(4)[decision, below of=3,label={180:$node\ 4$},label={[align=center] 315:DICE overlap between $T_2$ or $S_0$\\decay models and ICA component\\peak clusters}, yshift=-1.5cm]{dice $FS_0$ $>$ dice $FT_2$ \& varex $>$ median(varex)
};
\node(rej4)[reject, right of=4, xshift=2.5cm, align=center]{Unlikely BOLD\\$\rightarrow$ Reject};
% ----- node: 5
\node(5)[decision, below of=4,label={180:$node\ 5$}, label={[align=center] 315: $t-statistic$ of $FT_2$ values\\in component peak clusters vs\\peak voxels outside of clusters}, yshift=-4.0cm]{ $0 \, >$ signal-noise \& varex $>$ median(varex)};
\node(rej5)[reject, right of=5, xshift=2.5cm, align=center]{Unlikely BOLD\\$\rightarrow$ Reject};
% ----- node: 6
\node(6)[process, below of=5, label={180:$node\ 6$}, label={0: Uses all components}, yshift=-2.0cm]{Calculate $\kappa$ elbow};
% ----- node: 7
\node(7)[process, below of=6, label={180:$node\ 7$}, label={[align=center] 0: Uses all components and subset\\of unclassified components}]{Calculate $\rho$ elbow\\(liberal method)};
% ----- node: 7
\node(8)[decision, below of=7,label={180:$node\ 8$}, yshift=-1.5cm]{$\kappa \geq \kappa$ elbow};
\node(chrej8)[changeclass, below of=8, yshift=-1.5cm]{Provisional reject};
\node(chacc8)[changeclass, right of=8, xshift=3cm, yshift=0cm]{Provisional accept};
% ----- node: 8
\node(9)[decision, below of=chacc8,label={170:$node\ 9$}, yshift=-1.5cm]{ $\rho$ $>$ $\rho$ elbow};
\node(chrej9)[changeclass, below of=9, yshift=-1.5cm]{Provisional reject};
% ----- node: 9
\node(10)[decision, left of=chrej9,label={180:$node\ 10$},label={235: Accept even if $\rho < \rho\ elbow$},xshift=-3.5cm]{$\kappa \geq \kappa$ elbow\\$\kappa > 2\rho$ };
\node(chacc10)[changeclass, below of=10, xshift=0cm, yshift=-1.5cm, align=center]{Provisional accept};
% ----- node: 10
\node(11)[decision, below of=chacc10,label={180:$node\ 11$}, xshift=0cm, yshift=-2cm]{External regressor\\nuisance model\\$p<0.05$\\$R^2>0.5$};%--check in kundu
\node(chrej11)[changeclass, below of=11, xshift=0cm, yshift=-1.5cm, align=center]{Tag: External Regressors\\Provisional reject};
% ----- node: 11
\node(12)[decision, below of=chrej11,label={180:$node\ 11$},label={[align=left] 335: Will accept the lowest\\variance components until\\1\% of total variance is\\accepted this way}, yshift=-1.5cm]{$if$ component variance $<0.1$};%--check in kundu
\node(acc12)[accept, right of=12, xshift=3cm, align=center]{Low variance\\$\rightarrow$ Accept};
% ----- node: 12
\node(13)[accept, below of=12,label={180:$node\ 12$},yshift=-1.5cm, align=center]{Likely BOLD\\Change provisional accept\\$\rightarrow$Accept};
% ----- node: 13
\node(14)[reject, below of=13,label={180:$node\ 13$}, yshift=0cm, align=center]{Unlikely BOLD\\Change provisional reject\\$\rightarrow$Reject};


% ------------------------- connections -------------------------
\draw[arrow](0)--(1);
\draw[arrow](1)--node[anchor=south, right=0] {no} (2);
\draw[arrow](1)--node[anchor=south] {yes} (rej1);
\draw[arrow](2)--node[anchor=south, right=0] {no} (3);
\draw[arrow](2)--node[anchor=south] {yes} (rej2);
\draw[arrow](3)--(4);
\draw[arrow](4)--node[anchor=south, right=0] {no} (5);
\draw[arrow](4)--node[anchor=south] {yes} (rej4);
\draw[arrow](5)--node[anchor=south, right=0] {no} (6);
\draw[arrow](5)--node[anchor=south] {yes} (rej5);
\draw[arrow](6)--(7);
\draw[arrow](7)--(8);
\draw[arrow](8)--node[anchor=south] {yes} (chacc8);
\draw[arrow](8)--node[anchor=south, right=0] {no} (chrej8);
\draw[arrow](chacc8)--(9);
\draw[arrow](chrej8)--(9);
\draw[arrow](9)--node[anchor=south, right=0] {yes} (chrej9);
\draw[arrow](chrej9)--(10);
\draw[arrow](10)--node[anchor=south, right=0] {yes} (chacc10);
\draw[arrow](chacc10)--(11);
\draw[arrow](11)--node[anchor=south, right=0] {yes} (chrej11);
\draw[arrow](chrej11)--(12);
\draw[arrow](12)--node[anchor=south] {yes} (acc12);
\end{tikzpicture}
\end{document}
Binary file added docs/_static/rmse_plots.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/tedana-ohbm2023-poster.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/tedana-ohbm2024-poster.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ API

tedana.metrics.collect
tedana.metrics.dependence
tedana.metrics.external


.. _api_selection_ref:
Expand Down
5 changes: 4 additions & 1 deletion docs/approach.rst
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,8 @@ Next, ``tedana`` applies TE-dependent independent component analysis (ICA) in
order to identify and remove TE-independent (i.e., non-BOLD noise) components.
The dimensionally reduced optimally combined data are first subjected to ICA in
order to fit a mixing matrix to the whitened data.
``tedana`` can use a single interation of FastICA or multiple interations of robustICA,
with an explanation of those approaches `in our FAQ`_.
This generates a number of independent timeseries (saved as **desc-ICA_mixing.tsv**),
as well as parameter estimate maps which show the spatial loading of these components on the
brain (**desc-ICA_components.nii.gz**).
Expand Down Expand Up @@ -352,10 +354,11 @@ The actual decision tree is dependent on the component selection algorithm emplo
thresholds applied to each of the metrics). `These decision trees are detailed here`_.

Components that are classified as noise are projected out of the optimally combined data,
yielding a denoised timeseries, which is saved as **desc-optcomDenoised_bold.nii.gz**.
yielding a denoised timeseries, which is saved as **desc-denoised_bold.nii.gz**.

.. image:: /_static/a15_denoised_data_timeseries.png

.. _in our FAQ: faq.html#tedana-what-is-the-right-number-of-ica-components-what-options-let-me-get-it
.. _These decision trees are detailed here: included_decision_trees.html

*******************************
Expand Down
Loading

0 comments on commit efb712e

Please sign in to comment.