Multi-Echo Denoising with tedana#
In this analysis tutorial, we will use tedana [DuPre et al., 2021] to perform multi-echo denoising.
Specifically, we will use tedana.workflows.tedana_workflow().
import json
import os
import shutil
from glob import glob
from pprint import pprint
import nibabel as nb
import pandas as pd
from IPython.display import HTML, display
from book_utils import export_html_report, load_pafin
from tedana import workflows
data_path = os.path.abspath('../data')
/mnt/c/Users/tsalo/Documents/ME-ICA/multi-echo-data-analysis/meda/lib/python3.14/site-packages/tqdm/auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html
from .autonotebook import tqdm as notebook_tqdm
tedana keeps the logs and reports of earlier runs in its output folder,
so we start from an empty folder to list only the files from this run.
data = load_pafin(data_path)
out_dir = os.path.join(data_path, "tedana")
if os.path.isdir(out_dir):
shutil.rmtree(out_dir)
workflows.tedana_workflow(
data['echo_files'],
data['echo_times'],
out_dir=out_dir,
mask=data['mask'],
prefix="sub-24053_ses-1_task-rat_dir-PA_run-01",
fittype="loglin",
tedpca="mdl",
verbose=True,
gscontrol=["mir"],
overwrite=True,
)
The tedana workflow writes out a number of files.
out_files = sorted(glob(os.path.join(out_dir, "*")))
out_files = [os.path.basename(f) for f in out_files]
print("\n".join(out_files))
figures
open_rica_report.py
sub-24053_ses-1_task-rat_dir-PA_run-01_S0map.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_T2starmap.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_dataset_description.json
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-ICAAcceptedMIRDenoised_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-ICAAccepted_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-ICAAccepted_stat-z_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-ICAAveragingWeights_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-ICACrossComponent_metrics.json
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-ICAMIRDenoised_mixing.tsv
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-ICAS0_stat-F_statmap.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-ICAT2_stat-F_statmap.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-ICA_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-ICA_decision_tree.json
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-ICA_decomposition.json
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-ICA_mixing.tsv
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-ICA_stat-z_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-ICA_status_table.tsv
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-PCAAveragingWeights_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-PCACrossComponent_metrics.json
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-PCAS0_stat-F_statmap.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-PCAT2_stat-F_statmap.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-PCA_decomposition.json
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-PCA_metrics.json
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-PCA_metrics.tsv
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-PCA_mixing.tsv
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-PCA_stat-z_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-T1likeEffect_min.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-adaptiveGoodSignal_mask.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-confounds_timeseries.tsv
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-denoised_bold.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-limited_S0map.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-limited_T2starmap.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-optcomAcceptedMIRDenoised_bold.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-optcomAccepted_bold.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-optcomMIRDenoised_bold.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-optcomRejected_bold.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-optcom_bold.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-optcom_whitened_bold.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-rmse_statmap.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-tedana_metrics.json
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-tedana_metrics.tsv
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-tedana_registry.json
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-1_desc-Accepted_bold.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-1_desc-Denoised_bold.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-1_desc-ICAS0ModelPredictions_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-1_desc-ICAT2ModelPredictions_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-1_desc-ICA_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-1_desc-PCAS0ModelPredictions_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-1_desc-PCAT2ModelPredictions_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-1_desc-PCA_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-1_desc-Rejected_bold.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-2_desc-Accepted_bold.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-2_desc-Denoised_bold.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-2_desc-ICAS0ModelPredictions_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-2_desc-ICAT2ModelPredictions_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-2_desc-ICA_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-2_desc-PCAS0ModelPredictions_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-2_desc-PCAT2ModelPredictions_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-2_desc-PCA_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-2_desc-Rejected_bold.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-3_desc-Accepted_bold.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-3_desc-Denoised_bold.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-3_desc-ICAS0ModelPredictions_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-3_desc-ICAT2ModelPredictions_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-3_desc-ICA_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-3_desc-PCAS0ModelPredictions_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-3_desc-PCAT2ModelPredictions_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-3_desc-PCA_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-3_desc-Rejected_bold.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-4_desc-Accepted_bold.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-4_desc-Denoised_bold.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-4_desc-ICAS0ModelPredictions_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-4_desc-ICAT2ModelPredictions_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-4_desc-ICA_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-4_desc-PCAS0ModelPredictions_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-4_desc-PCAT2ModelPredictions_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-4_desc-PCA_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-4_desc-Rejected_bold.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-5_desc-Accepted_bold.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-5_desc-Denoised_bold.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-5_desc-ICAS0ModelPredictions_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-5_desc-ICAT2ModelPredictions_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-5_desc-ICA_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-5_desc-PCAS0ModelPredictions_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-5_desc-PCAT2ModelPredictions_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-5_desc-PCA_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-5_desc-Rejected_bold.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_references.bib
sub-24053_ses-1_task-rat_dir-PA_run-01_report.txt
sub-24053_ses-1_task-rat_dir-PA_run-01_tedana_report.html
tedana_2026-11-15T090507.tsv
metrics = pd.read_table(
os.path.join(out_dir, "sub-24053_ses-1_task-rat_dir-PA_run-01_desc-tedana_metrics.tsv")
)
| Component | kappa | rho | variance explained | normalized variance explained | countsigFT2 | countsigFS0 | dice_FT2 | dice_FS0 | countnoise | signal-noise_t | signal-noise_p | d_table_score | optimal sign | varex kappa ratio | d_table_score_node20 | Var Exp of rejected to accepted | classification | classification_tags | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | ICA_00 | 9.592609 | 12.063096 | 0.768602 | 0.340238 | 770 | 1170 | 0.691406 | 0.629500 | 9852 | 0.000000 | 0.000000 | 41.800000 | -1 | 4.296001 | nan | nan | rejected | Unlikely BOLD |
| 1 | ICA_01 | 26.398791 | 17.053341 | 2.558903 | 3.086440 | 14470 | 6965 | 0.390140 | 0.206592 | 9852 | 0.000000 | 0.000000 | 30.600000 | -1 | 5.197196 | 17.000000 | nan | rejected | Less likely BOLD |
| 2 | ICA_02 | 11.104476 | 12.893428 | 2.889234 | 1.126994 | 1297 | 784 | 0.551347 | 0.504054 | 9852 | 0.000000 | 0.000000 | 39.800000 | 1 | 13.950314 | nan | nan | rejected | Unlikely BOLD |
| 3 | ICA_03 | 10.618871 | 12.667075 | 1.825249 | 0.882938 | 1416 | 979 | 0.554336 | 0.377637 | 9852 | 0.000000 | 0.000000 | 39.400000 | -1 | 9.216014 | nan | nan | rejected | Unlikely BOLD |
| 4 | ICA_04 | 8.335777 | 12.095820 | 0.760621 | 0.518241 | 410 | 1044 | 0.000000 | 0.498519 | 9852 | 0.000000 | 0.000000 | 59.100000 | -1 | 4.892398 | nan | nan | rejected | Unlikely BOLD |
| 5 | ICA_05 | 14.959501 | 9.525499 | 0.672167 | 1.120608 | 5916 | 1344 | 0.108682 | 0.334950 | 9852 | 0.000000 | 0.000000 | 42.800000 | 1 | 2.409127 | nan | nan | rejected | Unlikely BOLD |
| 6 | ICA_06 | 8.879025 | 10.414320 | 0.752265 | 0.535569 | 604 | 565 | 0.563123 | 0.536723 | 9852 | 0.000000 | 0.000000 | 44.600000 | 1 | 4.542607 | nan | nan | rejected | Unlikely BOLD |
| 7 | ICA_07 | 19.044173 | 6.569479 | 0.358500 | 0.561763 | 7445 | 520 | 0.345060 | 0.000000 | 7881 | 25.923906 | 0.000000 | 20.200000 | 1 | 1.009314 | 15.400000 | 19.663344 | accepted | Likely BOLD |
| 8 | ICA_08 | 13.769305 | 7.204780 | 0.361807 | 0.452721 | 3695 | 732 | 0.137645 | 0.735254 | 9149 | 15.224036 | 0.000000 | 31.400000 | 1 | 1.408848 | 22.200000 | 14.778735 | accepted | Likely BOLD |
| 9 | ICA_09 | 16.702084 | 7.964866 | 0.621647 | 1.320624 | 3686 | 652 | 0.139483 | 0.000000 | 9852 | 0.000000 | 0.000000 | 41.800000 | 1 | 1.995597 | 24.800000 | nan | rejected | Less likely BOLD |
| 10 | ICA_10 | 8.882325 | 12.101781 | 0.802865 | 0.514214 | 919 | 1421 | 0.472155 | 0.398669 | 9852 | 0.000000 | 0.000000 | 46.400000 | 1 | 4.846356 | nan | nan | rejected | Unlikely BOLD |
| 11 | ICA_11 | 24.884186 | 6.453645 | 0.239327 | 0.373056 | 4338 | 446 | 0.342588 | 0.000000 | 8444 | 33.039840 | 0.000000 | 20.200000 | 1 | 0.515664 | 15.000000 | 8.589155 | accepted | Likely BOLD |
| 12 | ICA_12 | 12.246319 | 12.347034 | 2.827091 | 1.056610 | 1257 | 782 | 0.560479 | 0.541100 | 9852 | 0.000000 | 0.000000 | 38.800000 | -1 | 12.377517 | nan | nan | rejected | Unlikely BOLD |
| 13 | ICA_13 | 7.443414 | 8.569363 | 0.319339 | 0.354397 | 0 | 232 | 0.000000 | 0.000000 | 9852 | 0.000000 | 0.000000 | 61.700000 | 1 | 2.300275 | nan | nan | rejected | Unlikely BOLD |
| 14 | ICA_14 | 7.688928 | 6.570974 | 0.331542 | 0.316073 | 277 | 336 | 0.000000 | 0.000000 | 9852 | 0.000000 | 0.000000 | 60.900000 | 1 | 2.311913 | nan | nan | rejected | Unlikely BOLD |
| 15 | ICA_15 | 11.269102 | 13.237924 | 3.388805 | 1.197162 | 1313 | 1644 | 0.438857 | 0.374923 | 9852 | 0.000000 | 0.000000 | 42.600000 | -1 | 16.123401 | nan | nan | rejected | Unlikely BOLD |
| 16 | ICA_16 | 36.778410 | 7.012462 | 0.728235 | 1.274882 | 16243 | 756 | 0.472632 | 0.000000 | 5173 | 23.078721 | 0.000000 | 8.000000 | 1 | 1.061642 | 5.200000 | 25.274542 | accepted | Likely BOLD |
| 17 | ICA_17 | 11.184613 | 7.462585 | 0.324831 | 0.681980 | 1205 | 113 | 0.000000 | 0.000000 | 9852 | 0.000000 | 0.000000 | 51.500000 | 1 | 1.557171 | 27.400000 | 32.827127 | accepted | Accept borderline |
| 18 | ICA_18 | 9.691719 | 12.266797 | 0.499090 | 0.320409 | 1323 | 1152 | 0.322311 | 0.652705 | 9852 | 0.000000 | 0.000000 | 46.200000 | 1 | 2.761070 | nan | nan | rejected | Unlikely BOLD |
| 19 | ICA_19 | 15.222631 | 18.848327 | 0.345116 | 0.695708 | 8092 | 6329 | 0.129887 | 0.198692 | 9517 | -4.949054 | 0.000001 | 40.000000 | -1 | 1.215555 | nan | nan | rejected | Unlikely BOLD |
| 20 | ICA_20 | 32.495626 | 6.382252 | 0.352883 | 0.687084 | 11697 | 643 | 0.416279 | 0.000000 | 5763 | 29.377390 | 0.000000 | 11.600000 | -1 | 0.582245 | 8.000000 | 15.428320 | accepted | Likely BOLD |
| 21 | ICA_21 | 27.508820 | 6.627727 | 0.342477 | 0.562767 | 12059 | 607 | 0.448727 | 0.549505 | 6726 | 31.502445 | 0.000000 | 12.200000 | -1 | 0.667512 | 9.000000 | 16.610066 | accepted | Likely BOLD |
| 22 | ICA_22 | 8.132508 | 11.150534 | 1.103184 | 0.561793 | 491 | 558 | 0.629328 | 0.609099 | 9852 | 0.000000 | 0.000000 | 45.800000 | 1 | 7.273154 | nan | nan | rejected | Unlikely BOLD |
| 23 | ICA_23 | 15.049997 | 6.260331 | 0.192144 | 0.380042 | 4428 | 333 | 0.164177 | 0.000000 | 9481 | 15.439914 | 0.000000 | 29.800000 | 1 | 0.684527 | 20.800000 | 11.491067 | accepted | Likely BOLD |
| 24 | ICA_24 | 26.866325 | 10.726354 | 7.298831 | 11.929208 | 28809 | 3951 | 0.455153 | 0.000000 | 9852 | 0.000000 | 0.000000 | 27.000000 | -1 | 14.566138 | 14.200000 | nan | rejected | Less likely BOLD |
| 25 | ICA_25 | 45.459733 | 7.650466 | 0.701304 | 0.951707 | 9413 | 1192 | 0.518515 | 0.187389 | 4212 | 32.087624 | 0.000000 | 7.000000 | -1 | 0.827140 | 4.400000 | 11.289813 | accepted | Likely BOLD |
| 26 | ICA_26 | 12.545157 | 12.995376 | 4.408561 | 1.483780 | 1982 | 1044 | 0.515079 | 0.374877 | 9852 | 0.000000 | 0.000000 | 37.800000 | -1 | 18.841701 | nan | nan | rejected | Unlikely BOLD |
| 27 | ICA_27 | 21.087185 | 13.270027 | 9.029004 | 14.079296 | 19979 | 5422 | 0.292056 | 0.107893 | 9726 | -9.984459 | 0.000000 | 32.600000 | -1 | 22.957288 | nan | nan | rejected | Unlikely BOLD |
| 28 | ICA_28 | 28.924123 | 18.768205 | 0.905946 | 1.576603 | 8506 | 3924 | 0.250839 | 0.221769 | 9852 | 0.000000 | 0.000000 | 34.200000 | -1 | 1.679351 | 19.600000 | 54.813335 | accepted | Likely BOLD |
| 29 | ICA_29 | 16.315704 | 6.502467 | 0.327005 | 0.514787 | 6388 | 447 | 0.249033 | 0.000000 | 8622 | 18.264301 | 0.000000 | 25.200000 | 1 | 1.074601 | 19.000000 | 19.319017 | accepted | Likely BOLD |
| 30 | ICA_30 | 26.353257 | 6.649401 | 0.367208 | 0.619529 | 9740 | 446 | 0.393845 | 0.000000 | 6338 | 27.497160 | 0.000000 | 15.400000 | 1 | 0.747098 | 11.600000 | 18.333648 | accepted | Likely BOLD |
| 31 | ICA_31 | 9.934749 | 7.744468 | 0.236713 | 0.393348 | 1085 | 729 | 0.287431 | 0.716796 | 9852 | 0.000000 | 0.000000 | 48.000000 | 1 | 1.277510 | nan | 18.144165 | accepted | Low variance |
| 32 | ICA_32 | 8.676613 | 11.313043 | 0.665164 | 1.369200 | 1639 | 892 | 0.175514 | 0.000000 | 8791 | 7.495849 | 0.000000 | 38.400000 | -1 | 4.110341 | nan | nan | rejected | Unlikely BOLD |
| 33 | ICA_33 | 10.176822 | 34.177145 | 3.842812 | 0.751295 | 2256 | 2844 | 0.625511 | 0.771830 | 9171 | 8.092881 | 0.000000 | 25.400000 | -1 | 20.245863 | nan | nan | rejected | Unlikely BOLD |
| 34 | ICA_34 | 9.795763 | 7.880940 | 0.287937 | 0.313535 | 1870 | 730 | 0.208724 | 0.768698 | 9852 | 0.000000 | 0.000000 | 46.600000 | -1 | 1.576011 | nan | 21.095895 | accepted | Low variance |
| 35 | ICA_35 | 25.193077 | 7.247792 | 1.890731 | 2.992457 | 9946 | 471 | 0.434139 | 0.000000 | 9852 | 0.000000 | 0.000000 | 31.600000 | -1 | 4.023907 | 18.200000 | nan | rejected | Less likely BOLD |
| 36 | ICA_36 | 12.690184 | 7.103585 | 0.289771 | 0.470755 | 1287 | 541 | 0.148410 | 0.747681 | 9852 | 0.000000 | 0.000000 | 47.200000 | -1 | 1.224296 | 26.200000 | 21.653767 | accepted | Likely BOLD |
| 37 | ICA_37 | 9.676477 | 12.591106 | 1.666762 | 0.886729 | 1136 | 1117 | 0.486655 | 0.411951 | 9852 | 0.000000 | 0.000000 | 43.800000 | 1 | 9.235398 | nan | nan | rejected | Unlikely BOLD |
| 38 | ICA_38 | 8.547149 | 9.526162 | 0.374753 | 0.274694 | 573 | 830 | 0.661431 | 0.632024 | 9852 | 0.000000 | 0.000000 | 44.400000 | -1 | 2.350842 | nan | nan | rejected | Unlikely BOLD |
| 39 | ICA_39 | 10.901330 | 7.004408 | 0.268166 | 0.335234 | 2468 | 473 | 0.106213 | 0.667391 | 9852 | 0.000000 | 0.000000 | 47.000000 | -1 | 1.318937 | nan | 19.929813 | accepted | Low variance |
| 40 | ICA_40 | 9.689745 | 26.934865 | 1.288349 | 0.321330 | 1708 | 2627 | 0.650667 | 0.775926 | 9528 | 7.350561 | 0.000000 | 28.600000 | 1 | 7.128870 | nan | nan | rejected | Unlikely BOLD |
| 41 | ICA_41 | 22.183679 | 13.617278 | 0.495843 | 0.919115 | 3430 | 1924 | 0.216314 | 0.296474 | 9184 | 6.059253 | 0.000000 | 28.800000 | -1 | 1.198422 | nan | nan | rejected | Unlikely BOLD |
| 42 | ICA_42 | 33.609802 | 20.676707 | 2.616751 | 2.914722 | 13753 | 7444 | 0.349515 | 0.261332 | 9852 | 0.000000 | 0.000000 | 29.400000 | 1 | 4.174417 | 15.800000 | nan | rejected | Less likely BOLD |
| 43 | ICA_43 | 7.544725 | 8.609963 | 0.337878 | 0.289643 | 379 | 623 | 0.000000 | 0.632107 | 9852 | 0.000000 | 0.000000 | 60.700000 | 1 | 2.401130 | nan | nan | rejected | Unlikely BOLD |
| 44 | ICA_44 | 8.093991 | 8.685063 | 0.216749 | 0.287417 | 1459 | 586 | 0.158143 | 0.669020 | 9852 | 0.000000 | 0.000000 | 51.800000 | 1 | 1.435800 | nan | nan | rejected | Unlikely BOLD |
| 45 | ICA_45 | 16.626587 | 13.458381 | 0.892116 | 1.012116 | 4931 | 2642 | 0.141350 | 0.278281 | 9852 | 0.000000 | 0.000000 | 41.000000 | -1 | 2.876853 | nan | nan | rejected | Unlikely BOLD |
| 46 | ICA_46 | 25.954867 | 6.795133 | 0.358038 | 0.548020 | 8253 | 551 | 0.450277 | 0.000000 | 6260 | 32.365444 | 0.000000 | 13.400000 | -1 | 0.739622 | 10.000000 | 18.439667 | accepted | Likely BOLD |
| 47 | ICA_47 | 7.891441 | 8.899790 | 0.332700 | 0.291403 | 414 | 604 | 0.617647 | 0.623032 | 9852 | 0.000000 | 0.000000 | 47.400000 | -1 | 2.260456 | nan | nan | rejected | Unlikely BOLD |
| 48 | ICA_48 | 7.785682 | 9.711550 | 0.389429 | 0.846807 | 618 | 532 | 0.000000 | 0.000000 | 9749 | -17.067190 | 0.000000 | 58.900000 | -1 | 2.681831 | nan | nan | rejected | Unlikely BOLD |
| 49 | ICA_49 | 18.753264 | 6.065704 | 0.191439 | 0.362230 | 7941 | 412 | 0.315796 | 0.000000 | 8248 | 22.639203 | 0.000000 | 22.200000 | -1 | 0.547335 | 17.000000 | 5.999123 | accepted | Likely BOLD |
| 50 | ICA_50 | 8.407534 | 7.294649 | 0.177430 | 0.237322 | 434 | 502 | 0.000000 | 0.743028 | 9852 | 0.000000 | 0.000000 | 58.500000 | -1 | 1.131508 | nan | nan | rejected | Unlikely BOLD |
| 51 | ICA_51 | 31.770896 | 23.334644 | 2.643199 | 2.860010 | 14378 | 7118 | 0.397084 | 0.239347 | 9852 | 0.000000 | 0.000000 | 29.200000 | -1 | 4.460667 | 15.800000 | nan | rejected | Less likely BOLD |
| 52 | ICA_52 | 9.148140 | 11.181392 | 0.984194 | 0.577639 | 572 | 765 | 0.000000 | 0.512516 | 9852 | 0.000000 | 0.000000 | 56.700000 | -1 | 5.768294 | nan | nan | rejected | Unlikely BOLD |
| 53 | ICA_53 | 13.174544 | 6.749207 | 0.278165 | 0.590490 | 2035 | 282 | 0.151642 | 0.000000 | 9852 | 0.000000 | 0.000000 | 44.600000 | 1 | 1.132050 | 25.600000 | 11.762327 | accepted | Likely BOLD |
| 54 | ICA_54 | 32.090942 | 6.426100 | 0.470289 | 0.984535 | 11007 | 292 | 0.440908 | 0.000000 | 6660 | 21.552071 | 0.000000 | 13.800000 | -1 | 0.785745 | 10.400000 | 20.221572 | accepted | Likely BOLD |
| 55 | ICA_55 | 15.173376 | 19.499616 | 12.784448 | 2.978705 | 3262 | 2752 | 0.540888 | 0.552815 | 9233 | 12.461495 | 0.000000 | 23.400000 | 1 | 45.175101 | nan | nan | rejected | Unlikely BOLD |
| 56 | ICA_56 | 9.199509 | 6.663263 | 0.189690 | 0.278929 | 864 | 375 | 0.311343 | 0.760375 | 9852 | 0.000000 | 0.000000 | 50.200000 | -1 | 1.105549 | nan | 7.632825 | accepted | Low variance |
| 57 | ICA_57 | 29.442290 | 9.896503 | 11.818106 | 16.140972 | 29383 | 1879 | 0.478931 | 0.000000 | 9852 | 0.000000 | 0.000000 | 25.400000 | 1 | 21.521654 | 13.000000 | nan | rejected | Less likely BOLD |
| 58 | ICA_58 | 16.243588 | 12.317011 | 1.956652 | 0.668785 | 6649 | 913 | 0.468556 | 0.543635 | 7691 | 14.541253 | 0.000000 | 20.800000 | -1 | 6.458489 | nan | nan | rejected | Unlikely BOLD |
| 59 | ICA_59 | 38.333081 | 6.133155 | 0.465921 | 0.911580 | 14723 | 413 | 0.541538 | 0.000000 | 4807 | 30.298007 | 0.000000 | 5.200000 | -1 | 0.651685 | 3.000000 | 22.521943 | accepted | Likely BOLD |
| 60 | ICA_60 | 46.207029 | 6.392247 | 0.842289 | 1.348628 | 13428 | 972 | 0.559075 | 0.020354 | 4556 | 24.176760 | 0.000000 | 5.600000 | -1 | 0.977355 | 3.800000 | 16.383248 | accepted | Likely BOLD |
| 61 | ICA_61 | 7.895488 | 6.569722 | 0.342675 | 0.336026 | 334 | 339 | 0.000000 | 0.000000 | 9852 | 0.000000 | 0.000000 | 60.100000 | -1 | 2.327037 | nan | nan | rejected | Unlikely BOLD |
| 62 | ICA_62 | 25.177033 | 6.438584 | 0.359714 | 0.497323 | 8044 | 580 | 0.316062 | 0.571429 | 7508 | 18.062819 | 0.000000 | 20.600000 | -1 | 0.766040 | 16.200000 | 18.313138 | accepted | Likely BOLD |
| 63 | ICA_63 | 9.242266 | 8.081451 | 0.163273 | 0.303358 | 2108 | 412 | 0.058894 | 0.682095 | 9719 | 9.236079 | 0.000000 | 39.600000 | 1 | 0.947184 | 24.400000 | 8.406460 | accepted | Likely BOLD |
| 64 | ICA_64 | 9.450062 | 7.041295 | 0.384465 | 0.703733 | 475 | 284 | 0.182203 | 0.000000 | 9852 | 0.000000 | 0.000000 | 52.600000 | 1 | 2.181328 | 26.400000 | 34.092392 | accepted | Accept borderline |
| 65 | ICA_65 | 8.547493 | 9.402827 | 0.356753 | 0.317595 | 1005 | 811 | 0.390562 | 0.765432 | 9852 | 0.000000 | 0.000000 | 49.000000 | -1 | 2.237835 | nan | nan | rejected | Unlikely BOLD |
| 66 | ICA_66 | 9.804710 | 6.550308 | 0.232428 | 0.373470 | 925 | 405 | 0.171365 | 0.000000 | 9852 | 0.000000 | 0.000000 | 50.000000 | 1 | 1.271025 | nan | 22.148955 | accepted | Low variance |
| 67 | ICA_67 | 32.992776 | 6.582726 | 0.678708 | 1.199201 | 15187 | 624 | 0.512719 | 0.000000 | 6156 | 23.770719 | 0.000000 | 8.600000 | -1 | 1.102969 | 6.000000 | 35.152159 | accepted | Likely BOLD |
| 68 | ICA_68 | 13.911545 | 35.972551 | 0.515928 | 0.766355 | 9880 | 19317 | 0.441544 | 0.476750 | 7965 | 17.392675 | 0.000000 | 20.400000 | -1 | 1.988442 | nan | nan | rejected | Unlikely BOLD |
| 69 | ICA_69 | 35.013471 | 5.976296 | 0.494372 | 0.975903 | 17809 | 392 | 0.532860 | 0.000000 | 5981 | 16.565802 | 0.000000 | 8.400000 | 1 | 0.757038 | 5.800000 | 14.558122 | accepted | Likely BOLD |
| 70 | ICA_70 | 7.121085 | 7.269320 | 0.211341 | 0.256944 | 220 | 272 | 0.000000 | 0.000000 | 9852 | 0.000000 | 0.000000 | 61.700000 | 1 | 1.591245 | nan | nan | rejected | Unlikely BOLD |
| 71 | ICA_71 | 11.310667 | 6.949636 | 0.217479 | 0.454340 | 2106 | 321 | 0.000000 | 0.000000 | 9852 | 0.000000 | 0.000000 | 48.300000 | 1 | 1.030928 | nan | 21.109498 | accepted | Low variance |
| 72 | ICA_72 | 12.544222 | 11.221088 | 0.386594 | 0.580883 | 1662 | 2845 | 0.000000 | 0.156476 | 9852 | 0.000000 | 0.000000 | 48.900000 | 1 | 1.652385 | nan | nan | rejected | Unlikely BOLD |
with open(
os.path.join(out_dir, "sub-24053_ses-1_task-rat_dir-PA_run-01_desc-tedana_metrics.json"),
"r",
) as fo:
metrics = json.load(fo)
first_five_keys = list(metrics.keys())[:5]
reduced_metrics = {k: metrics[k] for k in first_five_keys}
pprint(reduced_metrics)
{'Component': {'Description': 'The unique identifier of each component. This '
'identifier matches column names in the mixing '
'matrix TSV file.',
'LongName': 'Component identifier'},
'classification_tags': {'Description': 'A single tag or a comma separated '
'list of tags to describe why a '
'component received its classification',
'LongName': 'Component classification tags'},
'countnoise': {'Description': "Number of 'noise' voxels (voxels highly "
'weighted for component, but not from clusters) '
'from each component.',
'LongName': 'Noise voxel count',
'Units': 'voxel'},
'countsigFS0': {'Description': 'Number of significant voxels from the '
'cluster-extent thresholded S0 model '
'F-statistic map for each component.',
'LongName': 'S0 model F-statistic map significant voxel count',
'Units': 'voxel'},
'countsigFT2': {'Description': 'Number of significant voxels from the '
'cluster-extent thresholded T2 model '
'F-statistic map for each component.',
'LongName': 'T2 model F-statistic map significant voxel count',
'Units': 'voxel'}}
df = pd.DataFrame.from_dict(metrics, orient="index")
df = df.fillna("n/a")
display(HTML(df.to_html()))
| Description | LongName | Units | Levels | |
|---|---|---|---|---|
| Component | The unique identifier of each component. This identifier matches column names in the mixing matrix TSV file. | Component identifier | n/a | n/a |
| classification_tags | A single tag or a comma separated list of tags to describe why a component received its classification | Component classification tags | n/a | n/a |
| countnoise | Number of 'noise' voxels (voxels highly weighted for component, but not from clusters) from each component. | Noise voxel count | voxel | n/a |
| countsigFS0 | Number of significant voxels from the cluster-extent thresholded S0 model F-statistic map for each component. | S0 model F-statistic map significant voxel count | voxel | n/a |
| countsigFT2 | Number of significant voxels from the cluster-extent thresholded T2 model F-statistic map for each component. | T2 model F-statistic map significant voxel count | voxel | n/a |
| d_table_score | Summary score compiled from five metrics, with smaller values (i.e., higher ranks) indicating more BOLD dependence and less noise. | Decision table score | arbitrary | n/a |
| dice_FS0 | Dice value of cluster-extent thresholded maps of S0-model betas and F-statistics. | S0 model beta map-F-statistic map Dice similarity index | arbitrary | n/a |
| dice_FT2 | Dice value of cluster-extent thresholded maps of T2-model betas and F-statistics. | T2 model beta map-F-statistic map Dice similarity index | arbitrary | n/a |
| kappa | A pseudo-F-statistic indicating TE-dependence of the component. This metric is calculated by computing fit to the TE-dependence model at each voxel, and then performing a weighted average based on the voxel-wise weights of the component. | Kappa | arbitrary | n/a |
| normalized variance explained | 'Normalized' variance explained by each component in the ICA weights maps. This is calculated by z-scoring the mixing matrix and optimally combined data over time, then fitting a GLM to calculate voxel-wise parameter estimates for each component. These parameter estimates are then cropped to values between -0.999 and 0.999, and then the Fisher's z-transform is applied to the parameter estimates. This is then used to calculate the variance explained for each component. On a scale from 0 to 100. | Normalized variance explained | percent | n/a |
| optimal sign | Optimal sign determined based on skew direction of component parameter estimates across the brain. In cases where components were left-skewed (-1), the component time series and map weights are flipped prior to metric calculation. This sign applies to the original mixing matrix and map weights. The outputs produced by tedana are already flipped. | Optimal component sign | n/a | {'-1': 'Component is flipped prior to metric calculation.', '1': 'Component is not flipped prior to metric calculation.'} |
| rho | A pseudo-F-statistic indicating TE-independence of the component. This metric is calculated by computing fit to the TE-independence model at each voxel, and then performing a weighted average based on the voxel-wise weights of the component. | Rho | arbitrary | n/a |
| signal-noise_p | P-value for two-sample t-test of F-statistics from 'signal' voxels (voxels in clusters) against 'noise' voxels (voxels not in clusters) for T2 model. | Signal > noise p-value | arbitrary | n/a |
| signal-noise_t | T-statistic for two-sample t-test of F-statistics from 'signal' voxels (voxels in clusters) against 'noise' voxels (voxels not in clusters) for T2 model. | Signal > noise t-statistic | arbitrary | n/a |
| variance explained | The square of the parameter estimates from the regression of the mean-centered, but not z-scored, optimally combined data against the component time series, divided by the sum of the squares of the parameter estimates. This metric reflects relative participation in the fitted model, not unique or marginal explanatory power. On a scale from 0 to 100. | Variance explained | percent | n/a |
The tedana report#
The workflow also writes an interactive HTML report, *_tedana_report.html,
which loads its images from the figures folder next to it.
On your own computer you would simply open that file in a browser.
Here, we copy the report and its figures into the book so that it can be shown below.
report = os.path.join(out_dir, "sub-24053_ses-1_task-rat_dir-PA_run-01_tedana_report.html")
export_html_report(report, "tedana_report")
'tedana_report/index.html'
Open the report in its own tab to see it at full size.