Multi-Echo Denoising with tedana

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
from glob import glob
from pprint import pprint

import pandas as pd
from IPython.display import HTML, display
from repo2data.repo2data import Repo2Data
from tedana import workflows

# Install the data if running locally, or point to cached data if running on neurolibre
DATA_REQ_FILE = os.path.join("../binder/data_requirement.json")

# Download data
repo2data = Repo2Data(DATA_REQ_FILE)
data_path = repo2data.install()
data_path = os.path.abspath(data_path[0])
/opt/hostedtoolcache/Python/3.10.18/x64/lib/python3.10/site-packages/pybtex/plugin/__init__.py:26: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
  import pkg_resources
---- repo2data starting ----
/opt/hostedtoolcache/Python/3.10.18/x64/lib/python3.10/site-packages/repo2data
Config from file :
../binder/data_requirement.json
Destination:
./../data/multi-echo-data-analysis

Info : ./../data/multi-echo-data-analysis already downloaded
/opt/hostedtoolcache/Python/3.10.18/x64/lib/python3.10/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
func_dir = os.path.join(data_path, "func/")
data_files = [
    os.path.join(
        func_dir,
        "sub-04570_task-rest_echo-1_space-scanner_desc-partialPreproc_bold.nii.gz",
    ),
    os.path.join(
        func_dir,
        "sub-04570_task-rest_echo-2_space-scanner_desc-partialPreproc_bold.nii.gz",
    ),
    os.path.join(
        func_dir,
        "sub-04570_task-rest_echo-3_space-scanner_desc-partialPreproc_bold.nii.gz",
    ),
    os.path.join(
        func_dir,
        "sub-04570_task-rest_echo-4_space-scanner_desc-partialPreproc_bold.nii.gz",
    ),
]
echo_times = [12.0, 28.0, 44.0, 60.0]
mask_file = os.path.join(
    func_dir, "sub-04570_task-rest_space-scanner_desc-brain_mask.nii.gz"
)
confounds_file = os.path.join(
    func_dir, "sub-04570_task-rest_desc-confounds_timeseries.tsv"
)

out_dir = os.path.join(data_path, "tedana")
workflows.tedana_workflow(
    data_files,
    echo_times,
    out_dir=out_dir,
    mask=mask_file,
    prefix="sub-04570_task-rest_space-scanner",
    fittype="curvefit",
    tedpca="mdl",
    verbose=True,
    gscontrol=["mir"],
)
Hide code cell output
INFO     tedana:tedana_workflow:608 Using output directory: /home/runner/work/multi-echo-data-analysis/multi-echo-data-analysis/data/multi-echo-data-analysis/tedana
INFO     tedana:tedana_workflow:627 Initializing and validating component selection tree
WARNING  component_selector:validate_tree:146 Decision tree includes fields that are not used or logged ['_comment']
INFO     component_selector:__init__:333 Performing component selection with tedana_orig_decision_tree
INFO     component_selector:__init__:334 Very similar to the decision tree designed by Prantik Kundu
INFO     tedana:tedana_workflow:630 Loading input data: ['/home/runner/work/multi-echo-data-analysis/multi-echo-data-analysis/data/multi-echo-data-analysis/func/sub-04570_task-rest_echo-1_space-scanner_desc-partialPreproc_bold.nii.gz', '/home/runner/work/multi-echo-data-analysis/multi-echo-data-analysis/data/multi-echo-data-analysis/func/sub-04570_task-rest_echo-2_space-scanner_desc-partialPreproc_bold.nii.gz', '/home/runner/work/multi-echo-data-analysis/multi-echo-data-analysis/data/multi-echo-data-analysis/func/sub-04570_task-rest_echo-3_space-scanner_desc-partialPreproc_bold.nii.gz', '/home/runner/work/multi-echo-data-analysis/multi-echo-data-analysis/data/multi-echo-data-analysis/func/sub-04570_task-rest_echo-4_space-scanner_desc-partialPreproc_bold.nii.gz']
INFO     io:__init__:156 Generating figures directory: /home/runner/work/multi-echo-data-analysis/multi-echo-data-analysis/data/multi-echo-data-analysis/tedana/figures
INFO     tedana:tedana_workflow:718 Using user-defined mask
INFO     utils:make_adaptive_mask:202 Echo-wise intensity thresholds for adaptive mask: [258.33994278 180.98638476 134.6796175   91.51006253]
WARNING  utils:make_adaptive_mask:231 734 voxels in user-defined mask do not have good signal. Removing voxels from mask.
INFO     tedana:tedana_workflow:774 Computing T2* map
2-echo monoexponential:   0%|          | 0/2224 [00:00<?, ?it/s]
2-echo monoexponential:   3%|▎         | 63/2224 [00:00<00:03, 627.72it/s]
2-echo monoexponential:   6%|▋         | 143/2224 [00:00<00:02, 726.63it/s]
2-echo monoexponential:  10%|█         | 224/2224 [00:00<00:02, 762.27it/s]
2-echo monoexponential:  14%|█▍        | 307/2224 [00:00<00:02, 788.26it/s]
2-echo monoexponential:  18%|█▊        | 390/2224 [00:00<00:02, 800.06it/s]
2-echo monoexponential:  21%|██▏       | 477/2224 [00:00<00:02, 821.31it/s]
2-echo monoexponential:  25%|██▌       | 561/2224 [00:00<00:02, 826.68it/s]
2-echo monoexponential:  29%|██▉       | 644/2224 [00:00<00:01, 822.86it/s]
2-echo monoexponential:  33%|███▎      | 727/2224 [00:00<00:01, 821.79it/s]
2-echo monoexponential:  37%|███▋      | 813/2224 [00:01<00:01, 831.16it/s]
2-echo monoexponential:  40%|████      | 897/2224 [00:01<00:01, 822.35it/s]
2-echo monoexponential:  44%|████▍     | 980/2224 [00:01<00:01, 822.49it/s]
2-echo monoexponential:  48%|████▊     | 1063/2224 [00:01<00:01, 821.85it/s]
2-echo monoexponential:  52%|█████▏    | 1146/2224 [00:01<00:01, 776.25it/s]
2-echo monoexponential:  55%|█████▌    | 1225/2224 [00:01<00:01, 746.33it/s]
2-echo monoexponential:  59%|█████▉    | 1308/2224 [00:01<00:01, 769.43it/s]
2-echo monoexponential:  62%|██████▏   | 1389/2224 [00:01<00:01, 779.16it/s]
2-echo monoexponential:  66%|██████▌   | 1471/2224 [00:01<00:00, 789.71it/s]
2-echo monoexponential:  70%|██████▉   | 1555/2224 [00:01<00:00, 802.35it/s]
2-echo monoexponential:  74%|███████▎  | 1639/2224 [00:02<00:00, 811.44it/s]
2-echo monoexponential:  77%|███████▋  | 1721/2224 [00:02<00:00, 801.78it/s]
2-echo monoexponential:  81%|████████  | 1805/2224 [00:02<00:00, 812.08it/s]
2-echo monoexponential:  85%|████████▍ | 1890/2224 [00:02<00:00, 820.79it/s]
2-echo monoexponential:  89%|████████▉ | 1975/2224 [00:02<00:00, 828.11it/s]
2-echo monoexponential:  93%|█████████▎| 2058/2224 [00:02<00:00, 827.10it/s]
2-echo monoexponential:  96%|█████████▋| 2141/2224 [00:02<00:00, 817.30it/s]
2-echo monoexponential: 100%|█████████▉| 2223/2224 [00:02<00:00, 805.06it/s]
2-echo monoexponential: 100%|██████████| 2224/2224 [00:02<00:00, 801.48it/s]

3-echo monoexponential:   0%|          | 0/1092 [00:00<?, ?it/s]
3-echo monoexponential:   5%|▍         | 51/1092 [00:00<00:02, 505.09it/s]
3-echo monoexponential:  10%|▉         | 105/1092 [00:00<00:01, 520.90it/s]
3-echo monoexponential:  15%|█▍        | 160/1092 [00:00<00:01, 531.26it/s]
3-echo monoexponential:  20%|█▉        | 215/1092 [00:00<00:01, 534.97it/s]
3-echo monoexponential:  25%|██▍       | 269/1092 [00:00<00:01, 535.82it/s]
3-echo monoexponential:  30%|██▉       | 323/1092 [00:00<00:01, 532.92it/s]
3-echo monoexponential:  35%|███▍      | 377/1092 [00:00<00:01, 523.69it/s]
3-echo monoexponential:  39%|███▉      | 430/1092 [00:00<00:01, 523.51it/s]
3-echo monoexponential:  45%|████▍     | 486/1092 [00:00<00:01, 533.42it/s]
3-echo monoexponential:  49%|████▉     | 540/1092 [00:01<00:01, 525.42it/s]
3-echo monoexponential:  54%|█████▍    | 593/1092 [00:01<00:00, 522.23it/s]
3-echo monoexponential:  59%|█████▉    | 648/1092 [00:01<00:00, 528.72it/s]
3-echo monoexponential:  64%|██████▍   | 701/1092 [00:01<00:00, 525.63it/s]
3-echo monoexponential:  69%|██████▉   | 754/1092 [00:01<00:00, 520.45it/s]
3-echo monoexponential:  74%|███████▍  | 807/1092 [00:01<00:00, 516.87it/s]
3-echo monoexponential:  79%|███████▊  | 859/1092 [00:01<00:00, 516.40it/s]
3-echo monoexponential:  84%|████████▎ | 914/1092 [00:01<00:00, 524.95it/s]
3-echo monoexponential:  89%|████████▊ | 968/1092 [00:01<00:00, 529.07it/s]
3-echo monoexponential:  94%|█████████▎| 1022/1092 [00:01<00:00, 530.65it/s]
3-echo monoexponential:  99%|█████████▊| 1076/1092 [00:02<00:00, 525.99it/s]
3-echo monoexponential: 100%|██████████| 1092/1092 [00:02<00:00, 526.18it/s]

4-echo monoexponential:   0%|          | 0/20176 [00:00<?, ?it/s]
4-echo monoexponential:   0%|          | 52/20176 [00:00<00:38, 519.31it/s]
4-echo monoexponential:   1%|          | 108/20176 [00:00<00:37, 542.21it/s]
4-echo monoexponential:   1%|          | 167/20176 [00:00<00:35, 563.30it/s]
4-echo monoexponential:   1%|          | 229/20176 [00:00<00:34, 584.42it/s]
4-echo monoexponential:   1%|▏         | 288/20176 [00:00<00:34, 583.89it/s]
4-echo monoexponential:   2%|▏         | 352/20176 [00:00<00:32, 601.47it/s]
4-echo monoexponential:   2%|▏         | 413/20176 [00:00<00:32, 600.22it/s]
4-echo monoexponential:   2%|▏         | 474/20176 [00:00<00:32, 603.07it/s]
4-echo monoexponential:   3%|▎         | 537/20176 [00:00<00:32, 610.01it/s]
4-echo monoexponential:   3%|▎         | 599/20176 [00:01<00:32, 605.10it/s]
4-echo monoexponential:   3%|▎         | 660/20176 [00:01<00:32, 599.49it/s]
4-echo monoexponential:   4%|▎         | 720/20176 [00:01<00:32, 597.95it/s]
4-echo monoexponential:   4%|▍         | 781/20176 [00:01<00:32, 601.34it/s]
4-echo monoexponential:   4%|▍         | 842/20176 [00:01<00:32, 597.50it/s]
4-echo monoexponential:   4%|▍         | 906/20176 [00:01<00:31, 608.18it/s]
4-echo monoexponential:   5%|▍         | 967/20176 [00:01<00:31, 604.84it/s]
4-echo monoexponential:   5%|▌         | 1028/20176 [00:01<00:33, 576.44it/s]
4-echo monoexponential:   5%|▌         | 1087/20176 [00:01<00:32, 579.04it/s]
4-echo monoexponential:   6%|▌         | 1149/20176 [00:01<00:32, 588.54it/s]
4-echo monoexponential:   6%|▌         | 1210/20176 [00:02<00:31, 593.72it/s]
4-echo monoexponential:   6%|▋         | 1273/20176 [00:02<00:31, 602.99it/s]
4-echo monoexponential:   7%|▋         | 1337/20176 [00:02<00:30, 612.78it/s]
4-echo monoexponential:   7%|▋         | 1403/20176 [00:02<00:30, 624.21it/s]
4-echo monoexponential:   7%|▋         | 1466/20176 [00:02<00:31, 601.48it/s]
4-echo monoexponential:   8%|▊         | 1527/20176 [00:02<00:31, 597.91it/s]
4-echo monoexponential:   8%|▊         | 1587/20176 [00:02<00:31, 595.55it/s]
4-echo monoexponential:   8%|▊         | 1651/20176 [00:02<00:30, 606.28it/s]
4-echo monoexponential:   9%|▊         | 1717/20176 [00:02<00:29, 619.60it/s]
4-echo monoexponential:   9%|▉         | 1780/20176 [00:02<00:29, 618.86it/s]
4-echo monoexponential:   9%|▉         | 1844/20176 [00:03<00:29, 624.45it/s]
4-echo monoexponential:   9%|▉         | 1907/20176 [00:03<00:29, 624.25it/s]
4-echo monoexponential:  10%|▉         | 1970/20176 [00:03<00:29, 613.08it/s]
4-echo monoexponential:  10%|█         | 2032/20176 [00:03<00:30, 598.87it/s]
4-echo monoexponential:  10%|█         | 2093/20176 [00:03<00:30, 600.85it/s]
4-echo monoexponential:  11%|█         | 2155/20176 [00:03<00:29, 605.98it/s]
4-echo monoexponential:  11%|█         | 2221/20176 [00:03<00:28, 619.88it/s]
4-echo monoexponential:  11%|█▏        | 2286/20176 [00:03<00:28, 627.42it/s]
4-echo monoexponential:  12%|█▏        | 2351/20176 [00:03<00:28, 633.83it/s]
4-echo monoexponential:  12%|█▏        | 2417/20176 [00:03<00:27, 638.24it/s]
4-echo monoexponential:  12%|█▏        | 2483/20176 [00:04<00:27, 644.62it/s]
4-echo monoexponential:  13%|█▎        | 2548/20176 [00:04<00:27, 637.08it/s]
4-echo monoexponential:  13%|█▎        | 2612/20176 [00:04<00:28, 607.93it/s]
4-echo monoexponential:  13%|█▎        | 2674/20176 [00:04<00:28, 609.20it/s]
4-echo monoexponential:  14%|█▎        | 2738/20176 [00:04<00:28, 616.71it/s]
4-echo monoexponential:  14%|█▍        | 2801/20176 [00:04<00:28, 618.67it/s]
4-echo monoexponential:  14%|█▍        | 2868/20176 [00:04<00:27, 633.23it/s]
4-echo monoexponential:  15%|█▍        | 2934/20176 [00:04<00:26, 639.27it/s]
4-echo monoexponential:  15%|█▍        | 3000/20176 [00:04<00:26, 640.57it/s]
4-echo monoexponential:  15%|█▌        | 3067/20176 [00:05<00:26, 646.85it/s]
4-echo monoexponential:  16%|█▌        | 3133/20176 [00:05<00:26, 647.52it/s]
4-echo monoexponential:  16%|█▌        | 3198/20176 [00:05<00:26, 639.31it/s]
4-echo monoexponential:  16%|█▌        | 3262/20176 [00:05<00:27, 619.53it/s]
4-echo monoexponential:  16%|█▋        | 3325/20176 [00:05<00:27, 620.91it/s]
4-echo monoexponential:  17%|█▋        | 3389/20176 [00:05<00:26, 623.77it/s]
4-echo monoexponential:  17%|█▋        | 3452/20176 [00:05<00:26, 625.27it/s]
4-echo monoexponential:  17%|█▋        | 3519/20176 [00:05<00:26, 635.02it/s]
4-echo monoexponential:  18%|█▊        | 3585/20176 [00:05<00:25, 641.17it/s]
4-echo monoexponential:  18%|█▊        | 3650/20176 [00:05<00:25, 638.96it/s]
4-echo monoexponential:  18%|█▊        | 3714/20176 [00:06<00:25, 638.69it/s]
4-echo monoexponential:  19%|█▊        | 3780/20176 [00:06<00:25, 644.01it/s]
4-echo monoexponential:  19%|█▉        | 3845/20176 [00:06<00:25, 636.88it/s]
4-echo monoexponential:  19%|█▉        | 3909/20176 [00:06<00:25, 629.35it/s]
4-echo monoexponential:  20%|█▉        | 3972/20176 [00:06<00:26, 621.45it/s]
4-echo monoexponential:  20%|██        | 4036/20176 [00:06<00:25, 624.38it/s]
4-echo monoexponential:  20%|██        | 4099/20176 [00:06<00:25, 623.62it/s]
4-echo monoexponential:  21%|██        | 4162/20176 [00:06<00:25, 622.67it/s]
4-echo monoexponential:  21%|██        | 4226/20176 [00:06<00:25, 626.19it/s]
4-echo monoexponential:  21%|██▏       | 4291/20176 [00:06<00:25, 632.44it/s]
4-echo monoexponential:  22%|██▏       | 4355/20176 [00:07<00:24, 634.52it/s]
4-echo monoexponential:  22%|██▏       | 4419/20176 [00:07<00:24, 635.80it/s]
4-echo monoexponential:  22%|██▏       | 4486/20176 [00:07<00:24, 643.24it/s]
4-echo monoexponential:  23%|██▎       | 4551/20176 [00:07<00:24, 643.31it/s]
4-echo monoexponential:  23%|██▎       | 4616/20176 [00:07<00:24, 641.57it/s]
4-echo monoexponential:  23%|██▎       | 4681/20176 [00:07<00:24, 622.46it/s]
4-echo monoexponential:  24%|██▎       | 4745/20176 [00:07<00:24, 627.44it/s]
4-echo monoexponential:  24%|██▍       | 4809/20176 [00:07<00:24, 629.40it/s]
4-echo monoexponential:  24%|██▍       | 4873/20176 [00:07<00:24, 625.75it/s]
4-echo monoexponential:  24%|██▍       | 4937/20176 [00:07<00:24, 628.65it/s]
4-echo monoexponential:  25%|██▍       | 5003/20176 [00:08<00:23, 636.06it/s]
4-echo monoexponential:  25%|██▌       | 5070/20176 [00:08<00:23, 643.87it/s]
4-echo monoexponential:  25%|██▌       | 5138/20176 [00:08<00:23, 652.00it/s]
4-echo monoexponential:  26%|██▌       | 5204/20176 [00:08<00:23, 647.72it/s]
4-echo monoexponential:  26%|██▌       | 5270/20176 [00:08<00:22, 650.71it/s]
4-echo monoexponential:  26%|██▋       | 5336/20176 [00:08<00:22, 649.75it/s]
4-echo monoexponential:  27%|██▋       | 5401/20176 [00:08<00:23, 637.30it/s]
4-echo monoexponential:  27%|██▋       | 5465/20176 [00:08<00:23, 619.23it/s]
4-echo monoexponential:  27%|██▋       | 5529/20176 [00:08<00:23, 623.48it/s]
4-echo monoexponential:  28%|██▊       | 5592/20176 [00:09<00:23, 623.38it/s]
4-echo monoexponential:  28%|██▊       | 5655/20176 [00:09<00:23, 623.74it/s]
4-echo monoexponential:  28%|██▊       | 5722/20176 [00:09<00:22, 634.27it/s]
4-echo monoexponential:  29%|██▊       | 5792/20176 [00:09<00:22, 652.90it/s]
4-echo monoexponential:  29%|██▉       | 5858/20176 [00:09<00:22, 646.93it/s]
4-echo monoexponential:  29%|██▉       | 5923/20176 [00:09<00:22, 644.27it/s]
4-echo monoexponential:  30%|██▉       | 5988/20176 [00:09<00:22, 639.34it/s]
4-echo monoexponential:  30%|██▉       | 6052/20176 [00:09<00:22, 636.88it/s]
4-echo monoexponential:  30%|███       | 6118/20176 [00:09<00:21, 640.95it/s]
4-echo monoexponential:  31%|███       | 6183/20176 [00:09<00:22, 631.89it/s]
4-echo monoexponential:  31%|███       | 6247/20176 [00:10<00:22, 610.77it/s]
4-echo monoexponential:  31%|███▏      | 6309/20176 [00:10<00:22, 608.32it/s]
4-echo monoexponential:  32%|███▏      | 6370/20176 [00:10<00:22, 608.73it/s]
4-echo monoexponential:  32%|███▏      | 6434/20176 [00:10<00:22, 615.73it/s]
4-echo monoexponential:  32%|███▏      | 6501/20176 [00:10<00:21, 630.22it/s]
4-echo monoexponential:  33%|███▎      | 6567/20176 [00:10<00:21, 636.83it/s]
4-echo monoexponential:  33%|███▎      | 6633/20176 [00:10<00:21, 641.08it/s]
4-echo monoexponential:  33%|███▎      | 6698/20176 [00:10<00:20, 642.65it/s]
4-echo monoexponential:  34%|███▎      | 6763/20176 [00:10<00:20, 641.32it/s]
4-echo monoexponential:  34%|███▍      | 6829/20176 [00:10<00:20, 644.65it/s]
4-echo monoexponential:  34%|███▍      | 6894/20176 [00:11<00:20, 641.84it/s]
4-echo monoexponential:  34%|███▍      | 6959/20176 [00:11<00:21, 623.29it/s]
4-echo monoexponential:  35%|███▍      | 7022/20176 [00:11<00:21, 610.09it/s]
4-echo monoexponential:  35%|███▌      | 7085/20176 [00:11<00:21, 613.54it/s]
4-echo monoexponential:  35%|███▌      | 7149/20176 [00:11<00:21, 618.43it/s]
4-echo monoexponential:  36%|███▌      | 7211/20176 [00:11<00:21, 616.22it/s]
4-echo monoexponential:  36%|███▌      | 7277/20176 [00:11<00:20, 627.07it/s]
4-echo monoexponential:  36%|███▋      | 7345/20176 [00:11<00:20, 641.48it/s]
4-echo monoexponential:  37%|███▋      | 7411/20176 [00:11<00:19, 645.16it/s]
4-echo monoexponential:  37%|███▋      | 7476/20176 [00:11<00:19, 637.48it/s]
4-echo monoexponential:  37%|███▋      | 7540/20176 [00:12<00:19, 635.39it/s]
4-echo monoexponential:  38%|███▊      | 7605/20176 [00:12<00:19, 639.09it/s]
4-echo monoexponential:  38%|███▊      | 7671/20176 [00:12<00:19, 644.99it/s]
4-echo monoexponential:  38%|███▊      | 7736/20176 [00:12<00:19, 624.57it/s]
4-echo monoexponential:  39%|███▊      | 7799/20176 [00:12<00:20, 615.48it/s]
4-echo monoexponential:  39%|███▉      | 7861/20176 [00:12<00:20, 615.35it/s]
4-echo monoexponential:  39%|███▉      | 7923/20176 [00:12<00:20, 612.07it/s]
4-echo monoexponential:  40%|███▉      | 7985/20176 [00:12<00:19, 614.18it/s]
4-echo monoexponential:  40%|███▉      | 8048/20176 [00:12<00:19, 617.18it/s]
4-echo monoexponential:  40%|████      | 8116/20176 [00:13<00:19, 632.90it/s]
4-echo monoexponential:  41%|████      | 8182/20176 [00:13<00:18, 640.61it/s]
4-echo monoexponential:  41%|████      | 8247/20176 [00:13<00:18, 639.83it/s]
4-echo monoexponential:  41%|████      | 8312/20176 [00:13<00:18, 641.72it/s]
4-echo monoexponential:  42%|████▏     | 8377/20176 [00:13<00:18, 642.89it/s]
4-echo monoexponential:  42%|████▏     | 8442/20176 [00:13<00:18, 638.79it/s]
4-echo monoexponential:  42%|████▏     | 8508/20176 [00:13<00:18, 643.32it/s]
4-echo monoexponential:  42%|████▏     | 8573/20176 [00:13<00:18, 616.25it/s]
4-echo monoexponential:  43%|████▎     | 8635/20176 [00:13<00:18, 610.18it/s]
4-echo monoexponential:  43%|████▎     | 8697/20176 [00:13<00:18, 609.51it/s]
4-echo monoexponential:  43%|████▎     | 8759/20176 [00:14<00:18, 611.04it/s]
4-echo monoexponential:  44%|████▎     | 8824/20176 [00:14<00:18, 622.12it/s]
4-echo monoexponential:  44%|████▍     | 8888/20176 [00:14<00:18, 624.71it/s]
4-echo monoexponential:  44%|████▍     | 8951/20176 [00:14<00:17, 624.06it/s]
4-echo monoexponential:  45%|████▍     | 9018/20176 [00:14<00:17, 635.44it/s]
4-echo monoexponential:  45%|████▌     | 9082/20176 [00:14<00:17, 632.63it/s]
4-echo monoexponential:  45%|████▌     | 9147/20176 [00:14<00:17, 637.50it/s]
4-echo monoexponential:  46%|████▌     | 9215/20176 [00:14<00:16, 649.08it/s]
4-echo monoexponential:  46%|████▌     | 9281/20176 [00:14<00:16, 650.11it/s]
4-echo monoexponential:  46%|████▋     | 9347/20176 [00:14<00:16, 647.30it/s]
4-echo monoexponential:  47%|████▋     | 9412/20176 [00:15<00:17, 628.86it/s]
4-echo monoexponential:  47%|████▋     | 9475/20176 [00:15<00:17, 622.95it/s]
4-echo monoexponential:  47%|████▋     | 9538/20176 [00:15<00:17, 618.43it/s]
4-echo monoexponential:  48%|████▊     | 9600/20176 [00:15<00:17, 618.51it/s]
4-echo monoexponential:  48%|████▊     | 9663/20176 [00:15<00:16, 620.89it/s]
4-echo monoexponential:  48%|████▊     | 9728/20176 [00:15<00:16, 626.73it/s]
4-echo monoexponential:  49%|████▊     | 9793/20176 [00:15<00:16, 632.85it/s]
4-echo monoexponential:  49%|████▉     | 9857/20176 [00:15<00:16, 627.02it/s]
4-echo monoexponential:  49%|████▉     | 9925/20176 [00:15<00:16, 639.44it/s]
4-echo monoexponential:  50%|████▉     | 9994/20176 [00:15<00:15, 652.86it/s]
4-echo monoexponential:  50%|████▉     | 10060/20176 [00:16<00:15, 653.17it/s]
4-echo monoexponential:  50%|█████     | 10126/20176 [00:16<00:15, 644.04it/s]
4-echo monoexponential:  51%|█████     | 10191/20176 [00:16<00:16, 623.46it/s]
4-echo monoexponential:  51%|█████     | 10254/20176 [00:16<00:16, 620.11it/s]
4-echo monoexponential:  51%|█████     | 10317/20176 [00:16<00:15, 619.01it/s]
4-echo monoexponential:  51%|█████▏    | 10381/20176 [00:16<00:15, 623.86it/s]
4-echo monoexponential:  52%|█████▏    | 10444/20176 [00:16<00:15, 623.43it/s]
4-echo monoexponential:  52%|█████▏    | 10510/20176 [00:16<00:15, 633.40it/s]
4-echo monoexponential:  52%|█████▏    | 10578/20176 [00:16<00:14, 647.00it/s]
4-echo monoexponential:  53%|█████▎    | 10643/20176 [00:17<00:15, 633.75it/s]
4-echo monoexponential:  53%|█████▎    | 10708/20176 [00:17<00:14, 634.89it/s]
4-echo monoexponential:  53%|█████▎    | 10775/20176 [00:17<00:14, 644.43it/s]
4-echo monoexponential:  54%|█████▎    | 10842/20176 [00:17<00:14, 648.02it/s]
4-echo monoexponential:  54%|█████▍    | 10907/20176 [00:17<00:14, 641.92it/s]
4-echo monoexponential:  54%|█████▍    | 10972/20176 [00:17<00:14, 619.15it/s]
4-echo monoexponential:  55%|█████▍    | 11035/20176 [00:17<00:14, 610.53it/s]
4-echo monoexponential:  55%|█████▌    | 11097/20176 [00:17<00:15, 588.13it/s]
4-echo monoexponential:  55%|█████▌    | 11159/20176 [00:17<00:15, 594.52it/s]
4-echo monoexponential:  56%|█████▌    | 11230/20176 [00:17<00:14, 626.28it/s]
4-echo monoexponential:  56%|█████▌    | 11296/20176 [00:18<00:14, 632.91it/s]
4-echo monoexponential:  56%|█████▋    | 11360/20176 [00:18<00:13, 634.04it/s]
4-echo monoexponential:  57%|█████▋    | 11424/20176 [00:18<00:13, 634.64it/s]
4-echo monoexponential:  57%|█████▋    | 11491/20176 [00:18<00:13, 642.95it/s]
4-echo monoexponential:  57%|█████▋    | 11557/20176 [00:18<00:13, 646.71it/s]
4-echo monoexponential:  58%|█████▊    | 11624/20176 [00:18<00:13, 650.51it/s]
4-echo monoexponential:  58%|█████▊    | 11690/20176 [00:18<00:13, 652.20it/s]
4-echo monoexponential:  58%|█████▊    | 11756/20176 [00:18<00:13, 606.90it/s]
4-echo monoexponential:  59%|█████▊    | 11818/20176 [00:18<00:14, 593.72it/s]
4-echo monoexponential:  59%|█████▉    | 11880/20176 [00:19<00:13, 600.76it/s]
4-echo monoexponential:  59%|█████▉    | 11945/20176 [00:19<00:13, 611.95it/s]
4-echo monoexponential:  60%|█████▉    | 12008/20176 [00:19<00:13, 614.95it/s]
4-echo monoexponential:  60%|█████▉    | 12071/20176 [00:19<00:13, 618.39it/s]
4-echo monoexponential:  60%|██████    | 12136/20176 [00:19<00:12, 627.60it/s]
4-echo monoexponential:  60%|██████    | 12201/20176 [00:19<00:12, 633.53it/s]
4-echo monoexponential:  61%|██████    | 12268/20176 [00:19<00:12, 642.02it/s]
4-echo monoexponential:  61%|██████    | 12334/20176 [00:19<00:12, 646.50it/s]
4-echo monoexponential:  61%|██████▏   | 12400/20176 [00:19<00:12, 647.79it/s]
4-echo monoexponential:  62%|██████▏   | 12465/20176 [00:19<00:11, 647.74it/s]
4-echo monoexponential:  62%|██████▏   | 12530/20176 [00:20<00:11, 639.71it/s]
4-echo monoexponential:  62%|██████▏   | 12595/20176 [00:20<00:12, 600.79it/s]
4-echo monoexponential:  63%|██████▎   | 12660/20176 [00:20<00:12, 613.06it/s]
4-echo monoexponential:  63%|██████▎   | 12724/20176 [00:20<00:12, 619.45it/s]
4-echo monoexponential:  63%|██████▎   | 12790/20176 [00:20<00:11, 628.65it/s]
4-echo monoexponential:  64%|██████▎   | 12857/20176 [00:20<00:11, 639.35it/s]
4-echo monoexponential:  64%|██████▍   | 12923/20176 [00:20<00:11, 644.10it/s]
4-echo monoexponential:  64%|██████▍   | 12988/20176 [00:20<00:11, 641.50it/s]
4-echo monoexponential:  65%|██████▍   | 13054/20176 [00:20<00:11, 645.97it/s]
4-echo monoexponential:  65%|██████▌   | 13119/20176 [00:20<00:10, 644.05it/s]
4-echo monoexponential:  65%|██████▌   | 13184/20176 [00:21<00:10, 638.95it/s]
4-echo monoexponential:  66%|██████▌   | 13248/20176 [00:21<00:10, 637.08it/s]
4-echo monoexponential:  66%|██████▌   | 13312/20176 [00:21<00:10, 630.22it/s]
4-echo monoexponential:  66%|██████▋   | 13376/20176 [00:21<00:11, 603.08it/s]
4-echo monoexponential:  67%|██████▋   | 13439/20176 [00:21<00:11, 609.43it/s]
4-echo monoexponential:  67%|██████▋   | 13503/20176 [00:21<00:10, 617.11it/s]
4-echo monoexponential:  67%|██████▋   | 13566/20176 [00:21<00:10, 619.07it/s]
4-echo monoexponential:  68%|██████▊   | 13632/20176 [00:21<00:10, 629.44it/s]
4-echo monoexponential:  68%|██████▊   | 13698/20176 [00:21<00:10, 636.50it/s]
4-echo monoexponential:  68%|██████▊   | 13765/20176 [00:21<00:09, 643.32it/s]
4-echo monoexponential:  69%|██████▊   | 13831/20176 [00:22<00:09, 647.79it/s]
4-echo monoexponential:  69%|██████▉   | 13896/20176 [00:22<00:09, 646.36it/s]
4-echo monoexponential:  69%|██████▉   | 13962/20176 [00:22<00:09, 647.49it/s]
4-echo monoexponential:  70%|██████▉   | 14027/20176 [00:22<00:09, 647.80it/s]
4-echo monoexponential:  70%|██████▉   | 14092/20176 [00:22<00:09, 642.02it/s]
4-echo monoexponential:  70%|███████   | 14157/20176 [00:22<00:09, 613.75it/s]
4-echo monoexponential:  70%|███████   | 14219/20176 [00:22<00:09, 611.30it/s]
4-echo monoexponential:  71%|███████   | 14284/20176 [00:22<00:09, 622.17it/s]
4-echo monoexponential:  71%|███████   | 14348/20176 [00:22<00:09, 624.20it/s]
4-echo monoexponential:  71%|███████▏  | 14416/20176 [00:23<00:09, 638.29it/s]
4-echo monoexponential:  72%|███████▏  | 14486/20176 [00:23<00:08, 654.65it/s]
4-echo monoexponential:  72%|███████▏  | 14553/20176 [00:23<00:08, 656.30it/s]
4-echo monoexponential:  72%|███████▏  | 14619/20176 [00:23<00:08, 653.20it/s]
4-echo monoexponential:  73%|███████▎  | 14685/20176 [00:23<00:08, 646.78it/s]
4-echo monoexponential:  73%|███████▎  | 14750/20176 [00:23<00:08, 638.82it/s]
4-echo monoexponential:  73%|███████▎  | 14814/20176 [00:23<00:08, 634.60it/s]
4-echo monoexponential:  74%|███████▎  | 14878/20176 [00:23<00:08, 608.94it/s]
4-echo monoexponential:  74%|███████▍  | 14943/20176 [00:23<00:08, 619.14it/s]
4-echo monoexponential:  74%|███████▍  | 15007/20176 [00:23<00:08, 621.40it/s]
4-echo monoexponential:  75%|███████▍  | 15070/20176 [00:24<00:08, 621.28it/s]
4-echo monoexponential:  75%|███████▌  | 15137/20176 [00:24<00:07, 634.96it/s]
4-echo monoexponential:  75%|███████▌  | 15201/20176 [00:24<00:07, 632.90it/s]
4-echo monoexponential:  76%|███████▌  | 15267/20176 [00:24<00:07, 640.04it/s]
4-echo monoexponential:  76%|███████▌  | 15332/20176 [00:24<00:07, 642.04it/s]
4-echo monoexponential:  76%|███████▋  | 15397/20176 [00:24<00:07, 643.58it/s]
4-echo monoexponential:  77%|███████▋  | 15462/20176 [00:24<00:07, 643.92it/s]
4-echo monoexponential:  77%|███████▋  | 15527/20176 [00:24<00:07, 645.09it/s]
4-echo monoexponential:  77%|███████▋  | 15592/20176 [00:24<00:07, 622.74it/s]
4-echo monoexponential:  78%|███████▊  | 15655/20176 [00:24<00:07, 623.57it/s]
4-echo monoexponential:  78%|███████▊  | 15719/20176 [00:25<00:07, 627.85it/s]
4-echo monoexponential:  78%|███████▊  | 15782/20176 [00:25<00:07, 621.68it/s]
4-echo monoexponential:  79%|███████▊  | 15845/20176 [00:25<00:07, 615.85it/s]
4-echo monoexponential:  79%|███████▉  | 15912/20176 [00:25<00:06, 631.41it/s]
4-echo monoexponential:  79%|███████▉  | 15976/20176 [00:25<00:06, 632.78it/s]
4-echo monoexponential:  80%|███████▉  | 16045/20176 [00:25<00:06, 647.16it/s]
4-echo monoexponential:  80%|███████▉  | 16110/20176 [00:25<00:06, 645.01it/s]
4-echo monoexponential:  80%|████████  | 16175/20176 [00:25<00:06, 635.90it/s]
4-echo monoexponential:  80%|████████  | 16240/20176 [00:25<00:06, 638.38it/s]
4-echo monoexponential:  81%|████████  | 16304/20176 [00:26<00:06, 621.16it/s]
4-echo monoexponential:  81%|████████  | 16367/20176 [00:26<00:06, 615.19it/s]
4-echo monoexponential:  81%|████████▏ | 16429/20176 [00:26<00:06, 611.98it/s]
4-echo monoexponential:  82%|████████▏ | 16491/20176 [00:26<00:06, 609.32it/s]
4-echo monoexponential:  82%|████████▏ | 16554/20176 [00:26<00:05, 613.07it/s]
4-echo monoexponential:  82%|████████▏ | 16620/20176 [00:26<00:05, 625.99it/s]
4-echo monoexponential:  83%|████████▎ | 16686/20176 [00:26<00:05, 634.80it/s]
4-echo monoexponential:  83%|████████▎ | 16754/20176 [00:26<00:05, 647.16it/s]
4-echo monoexponential:  83%|████████▎ | 16819/20176 [00:26<00:05, 646.17it/s]
4-echo monoexponential:  84%|████████▎ | 16884/20176 [00:26<00:05, 639.44it/s]
4-echo monoexponential:  84%|████████▍ | 16948/20176 [00:27<00:05, 638.16it/s]
4-echo monoexponential:  84%|████████▍ | 17012/20176 [00:27<00:05, 607.87it/s]
4-echo monoexponential:  85%|████████▍ | 17074/20176 [00:27<00:05, 609.19it/s]
4-echo monoexponential:  85%|████████▍ | 17138/20176 [00:27<00:04, 615.24it/s]
4-echo monoexponential:  85%|████████▌ | 17200/20176 [00:27<00:04, 604.98it/s]
4-echo monoexponential:  86%|████████▌ | 17265/20176 [00:27<00:04, 615.05it/s]
4-echo monoexponential:  86%|████████▌ | 17327/20176 [00:27<00:04, 615.22it/s]
4-echo monoexponential:  86%|████████▌ | 17394/20176 [00:27<00:04, 629.60it/s]
4-echo monoexponential:  87%|████████▋ | 17459/20176 [00:27<00:04, 634.61it/s]
4-echo monoexponential:  87%|████████▋ | 17523/20176 [00:27<00:04, 627.15it/s]
4-echo monoexponential:  87%|████████▋ | 17588/20176 [00:28<00:04, 631.29it/s]
4-echo monoexponential:  87%|████████▋ | 17652/20176 [00:28<00:04, 602.57it/s]
4-echo monoexponential:  88%|████████▊ | 17715/20176 [00:28<00:04, 608.38it/s]
4-echo monoexponential:  88%|████████▊ | 17777/20176 [00:28<00:03, 602.57it/s]
4-echo monoexponential:  88%|████████▊ | 17838/20176 [00:28<00:03, 604.07it/s]
4-echo monoexponential:  89%|████████▊ | 17900/20176 [00:28<00:03, 606.88it/s]
4-echo monoexponential:  89%|████████▉ | 17967/20176 [00:28<00:03, 624.08it/s]
4-echo monoexponential:  89%|████████▉ | 18037/20176 [00:28<00:03, 643.10it/s]
4-echo monoexponential:  90%|████████▉ | 18102/20176 [00:28<00:03, 640.85it/s]
4-echo monoexponential:  90%|█████████ | 18167/20176 [00:28<00:03, 632.64it/s]
4-echo monoexponential:  90%|█████████ | 18231/20176 [00:29<00:03, 611.99it/s]
4-echo monoexponential:  91%|█████████ | 18293/20176 [00:29<00:03, 592.41it/s]
4-echo monoexponential:  91%|█████████ | 18355/20176 [00:29<00:03, 599.14it/s]
4-echo monoexponential:  91%|█████████▏| 18416/20176 [00:29<00:02, 593.99it/s]
4-echo monoexponential:  92%|█████████▏| 18479/20176 [00:29<00:02, 604.12it/s]
4-echo monoexponential:  92%|█████████▏| 18543/20176 [00:29<00:02, 612.38it/s]
4-echo monoexponential:  92%|█████████▏| 18608/20176 [00:29<00:02, 621.79it/s]
4-echo monoexponential:  93%|█████████▎| 18671/20176 [00:29<00:02, 622.96it/s]
4-echo monoexponential:  93%|█████████▎| 18734/20176 [00:29<00:02, 611.23it/s]
4-echo monoexponential:  93%|█████████▎| 18796/20176 [00:30<00:02, 597.82it/s]
4-echo monoexponential:  93%|█████████▎| 18857/20176 [00:30<00:02, 600.24it/s]
4-echo monoexponential:  94%|█████████▍| 18918/20176 [00:30<00:02, 602.46it/s]
4-echo monoexponential:  94%|█████████▍| 18983/20176 [00:30<00:01, 614.29it/s]
4-echo monoexponential:  94%|█████████▍| 19050/20176 [00:30<00:01, 628.84it/s]
4-echo monoexponential:  95%|█████████▍| 19113/20176 [00:30<00:01, 629.16it/s]
4-echo monoexponential:  95%|█████████▌| 19176/20176 [00:30<00:01, 615.30it/s]
4-echo monoexponential:  95%|█████████▌| 19238/20176 [00:30<00:01, 601.85it/s]
4-echo monoexponential:  96%|█████████▌| 19299/20176 [00:30<00:01, 599.49it/s]
4-echo monoexponential:  96%|█████████▌| 19360/20176 [00:30<00:01, 595.74it/s]
4-echo monoexponential:  96%|█████████▋| 19420/20176 [00:31<00:01, 593.08it/s]
4-echo monoexponential:  97%|█████████▋| 19484/20176 [00:31<00:01, 604.86it/s]
4-echo monoexponential:  97%|█████████▋| 19546/20176 [00:31<00:01, 606.78it/s]
4-echo monoexponential:  97%|█████████▋| 19607/20176 [00:31<00:00, 604.48it/s]
4-echo monoexponential:  97%|█████████▋| 19670/20176 [00:31<00:00, 610.20it/s]
4-echo monoexponential:  98%|█████████▊| 19736/20176 [00:31<00:00, 622.36it/s]
4-echo monoexponential:  98%|█████████▊| 19803/20176 [00:31<00:00, 635.38it/s]
4-echo monoexponential:  98%|█████████▊| 19867/20176 [00:31<00:00, 618.36it/s]
4-echo monoexponential:  99%|█████████▉| 19929/20176 [00:31<00:00, 609.90it/s]
4-echo monoexponential:  99%|█████████▉| 19991/20176 [00:31<00:00, 606.30it/s]
4-echo monoexponential:  99%|█████████▉| 20052/20176 [00:32<00:00, 603.99it/s]
4-echo monoexponential: 100%|█████████▉| 20113/20176 [00:32<00:00, 599.14it/s]
4-echo monoexponential: 100%|█████████▉| 20173/20176 [00:32<00:00, 589.18it/s]
4-echo monoexponential: 100%|██████████| 20176/20176 [00:32<00:00, 624.33it/s]

/opt/hostedtoolcache/Python/3.10.18/x64/lib/python3.10/site-packages/tedana/decay.py:541: RuntimeWarning: Mean of empty slice
  rmse_map = np.nanmean(rmse, axis=1)
INFO     combine:make_optcom:192 Optimally combining data with voxel-wise T2* estimates
INFO     tedana:tedana_workflow:822 Writing optimally combined data set: /home/runner/work/multi-echo-data-analysis/multi-echo-data-analysis/data/multi-echo-data-analysis/tedana/sub-04570_task-rest_space-scanner_desc-optcom_bold.nii.gz
INFO     pca:tedpca:208 Computing PCA of optimally combined multi-echo data with selection criteria: mdl
/opt/hostedtoolcache/Python/3.10.18/x64/lib/python3.10/site-packages/tedana/io.py:904: UserWarning: Data array used to create a new image contains 64-bit ints. This is likely due to creating the array with numpy and passing `int` as the `dtype`. Many tools such as FSL and SPM cannot deal with int64 in Nifti images, so for compatibility the data has been converted to int32.
  nii = new_img_like(ref_img, newdata, affine=affine, copy_header=copy_header)
INFO     pca:tedpca:248 Optimal number of components based on different criteria:
INFO     pca:tedpca:249 AIC: 77 | KIC: 67 | MDL: 43 | 90% varexp: 141 | 95% varexp: 186
INFO     pca:tedpca:254 Explained variance based on different criteria:
INFO     pca:tedpca:255 AIC: 0.816% | KIC: 0.801% | MDL: 0.757% | 90% varexp: 0.9% | 95% varexp: 0.95%
INFO     pca:tedpca:272 Plotting maPCA optimization curves
INFO     collect:generate_metrics:161 Calculating weight maps
INFO     collect:generate_metrics:173 Calculating parameter estimate maps for optimally combined data
INFO     collect:generate_metrics:193 Calculating z-statistic maps
INFO     collect:generate_metrics:203 Calculating F-statistic maps
INFO     collect:generate_metrics:228 Thresholding z-statistic maps
INFO     collect:generate_metrics:238 Calculating T2* F-statistic maps
INFO     collect:generate_metrics:248 Calculating S0 F-statistic maps
INFO     collect:generate_metrics:259 Counting significant voxels in T2* F-statistic maps
INFO     collect:generate_metrics:265 Counting significant voxels in S0 F-statistic maps
INFO     collect:generate_metrics:272 Thresholding optimal combination beta maps to match T2* F-statistic maps
INFO     collect:generate_metrics:281 Thresholding optimal combination beta maps to match S0 F-statistic maps
INFO     collect:generate_metrics:291 Calculating kappa and rho
INFO     collect:generate_metrics:300 Calculating variance explained
INFO     collect:generate_metrics:306 Calculating normalized variance explained
INFO     collect:generate_metrics:313 Calculating DSI between thresholded T2* F-statistic and optimal combination beta maps
INFO     collect:generate_metrics:323 Calculating DSI between thresholded S0 F-statistic and optimal combination beta maps
INFO     collect:generate_metrics:334 Calculating signal-noise t-statistics
/opt/hostedtoolcache/Python/3.10.18/x64/lib/python3.10/site-packages/scipy/_lib/deprecation.py:234: SmallSampleWarning: One or more sample arguments is too small; all returned values will be NaN. See documentation for sample size requirements.
  return f(*args, **kwargs)
INFO     collect:generate_metrics:368 Counting significant noise voxels from z-statistic maps
INFO     collect:generate_metrics:380 Calculating decision table score
INFO     pca:tedpca:412 Selected 43 components with 75.69% normalized variance explained using mdl dimensionality estimate
/opt/hostedtoolcache/Python/3.10.18/x64/lib/python3.10/site-packages/tedana/io.py:355: FutureWarning: Downcasting behavior in `replace` is deprecated and will be removed in a future version. To retain the old behavior, explicitly call `result.infer_objects(copy=False)`. To opt-in to the future behavior, set `pd.set_option('future.no_silent_downcasting', True)`
  deblanked = data.replace("", np.nan)
INFO     ica:f_ica:344 ICA with random seed 42 converged in 62 iterations
INFO     collect:generate_metrics:161 Calculating weight maps
INFO     collect:generate_metrics:173 Calculating parameter estimate maps for optimally combined data
INFO     collect:generate_metrics:193 Calculating z-statistic maps
INFO     collect:generate_metrics:203 Calculating F-statistic maps
INFO     collect:generate_metrics:228 Thresholding z-statistic maps
INFO     collect:generate_metrics:238 Calculating T2* F-statistic maps
INFO     collect:generate_metrics:248 Calculating S0 F-statistic maps
INFO     collect:generate_metrics:259 Counting significant voxels in T2* F-statistic maps
INFO     collect:generate_metrics:265 Counting significant voxels in S0 F-statistic maps
INFO     collect:generate_metrics:272 Thresholding optimal combination beta maps to match T2* F-statistic maps
INFO     collect:generate_metrics:281 Thresholding optimal combination beta maps to match S0 F-statistic maps
INFO     collect:generate_metrics:291 Calculating kappa and rho
INFO     collect:generate_metrics:300 Calculating variance explained
INFO     collect:generate_metrics:306 Calculating normalized variance explained
INFO     collect:generate_metrics:313 Calculating DSI between thresholded T2* F-statistic and optimal combination beta maps
INFO     collect:generate_metrics:323 Calculating DSI between thresholded S0 F-statistic and optimal combination beta maps
INFO     collect:generate_metrics:334 Calculating signal-noise t-statistics
/opt/hostedtoolcache/Python/3.10.18/x64/lib/python3.10/site-packages/scipy/_lib/deprecation.py:234: SmallSampleWarning: One or more sample arguments is too small; all returned values will be NaN. See documentation for sample size requirements.
  return f(*args, **kwargs)
INFO     collect:generate_metrics:368 Counting significant noise voxels from z-statistic maps
INFO     collect:generate_metrics:380 Calculating decision table score
INFO     tedana:tedana_workflow:894 Selecting components from ICA results
INFO     tedica:automatic_selection:54 Performing ICA component selection with tree: tedana_orig
INFO     selection_nodes:manual_classify:104 Step 0: manual_classify: Set all to unclassified 
INFO     selection_utils:comptable_classification_changer:293 Step 0: No components fit criterion False to change classification
INFO     selection_utils:log_decision_tree_step:447 Step 0: manual_classify applied to 43 components. 43 True -> unclassified. 0 False -> nochange.
INFO     selection_nodes:manual_classify:136 Step 0: manual_classify component classification tags are cleared
INFO     selection_utils:log_classification_counts:492 Step 0: Total component classifications: 43 unclassified
INFO     selection_nodes:dec_left_op_right:389 Step 1: left_op_right: rejected if rho>kappa, else nochange
INFO     selection_utils:log_decision_tree_step:447 Step 1: left_op_right applied to 43 components. 15 True -> rejected. 28 False -> nochange.
INFO     selection_utils:log_classification_counts:492 Step 1: Total component classifications: 15 rejected, 28 unclassified
INFO     selection_nodes:dec_left_op_right:389 Step 2: left_op_right: rejected if ['countsigFS0>countsigFT2 & countsigFT2>0'], else nochange
INFO     selection_utils:log_decision_tree_step:447 Step 2: left_op_right applied to 43 components. 15 True -> rejected. 28 False -> nochange.
INFO     selection_utils:log_classification_counts:492 Step 2: Total component classifications: 16 rejected, 27 unclassified
INFO     selection_nodes:calc_median:653 Step 3: calc_median: Median(median_varex)
INFO     selection_utils:log_decision_tree_step:459 Step 3: calc_median calculated: median_varex=0.6369008306484385
INFO     selection_utils:log_classification_counts:492 Step 3: Total component classifications: 16 rejected, 27 unclassified
INFO     selection_nodes:dec_left_op_right:389 Step 4: left_op_right: rejected if ['dice_FS0>dice_FT2 & variance explained>0.64'], else nochange
INFO     selection_utils:log_decision_tree_step:447 Step 4: left_op_right applied to 43 components. 4 True -> rejected. 39 False -> nochange.
INFO     selection_utils:log_classification_counts:492 Step 4: Total component classifications: 16 rejected, 27 unclassified
INFO     selection_nodes:dec_left_op_right:389 Step 5: left_op_right: rejected if ['0>signal-noise_t & variance explained>0.64'], else nochange
INFO     selection_utils:log_decision_tree_step:447 Step 5: left_op_right applied to 43 components. 2 True -> rejected. 41 False -> nochange.
INFO     selection_utils:log_classification_counts:492 Step 5: Total component classifications: 18 rejected, 25 unclassified
INFO     selection_nodes:calc_kappa_elbow:767 Step 6: calc_kappa_elbow: Calc Kappa Elbow
INFO     selection_utils:kappa_elbow_kundu:664 Calculating kappa elbow based on min of all and nonsig components.
INFO     selection_utils:log_decision_tree_step:459 Step 6: calc_kappa_elbow calculated: kappa_elbow_kundu=24.006482976612357, kappa_allcomps_elbow=37.56289039370621, kappa_nonsig_elbow=24.006482976612357, varex_upper_p=0.8089089913339598
INFO     selection_utils:log_classification_counts:492 Step 6: Total component classifications: 18 rejected, 25 unclassified
INFO     selection_nodes:dec_reclassify_high_var_comps:1140 Step 7: reclassify_high_var_comps: Change unclassified to unclass_highvar for the top couple of components with the highest jumps in variance
INFO     selection_utils:log_decision_tree_step:447 Step 7: reclassify_high_var_comps applied to 25 components. 3 True -> unclass_highvar. 22 False -> nochange.
INFO     selection_utils:log_classification_counts:492 Step 7: Total component classifications: 18 rejected, 3 unclass_highvar, 22 unclassified
INFO     selection_nodes:calc_rho_elbow:902 Step 8: calc_rho_elbow: Calc Rho Elbow
INFO     selection_utils:log_decision_tree_step:459 Step 8: calc_rho_elbow calculated: rho_elbow_kundu=16.593474162929414, rho_allcomps_elbow=24.547042487268047, rho_unclassified_elbow=15.105415515506271, elbow_f05=10.127964486013928
INFO     selection_utils:log_classification_counts:492 Step 8: Total component classifications: 18 rejected, 3 unclass_highvar, 22 unclassified
INFO     selection_nodes:dec_left_op_right:389 Step 9: left_op_right: provisionalaccept if kappa>=24.01, else nochange
INFO     selection_utils:log_decision_tree_step:447 Step 9: left_op_right applied to 22 components. 16 True -> provisionalaccept. 6 False -> nochange.
INFO     selection_utils:log_classification_counts:492 Step 9: Total component classifications: 16 provisionalaccept, 18 rejected, 3 unclass_highvar, 6 unclassified
INFO     selection_nodes:dec_left_op_right:389 Step 10: left_op_right: unclassified if rho>16.59, else nochange
INFO     selection_utils:log_decision_tree_step:447 Step 10: left_op_right applied to 16 components. 6 True -> unclassified. 10 False -> nochange.
INFO     selection_utils:log_classification_counts:492 Step 10: Total component classifications: 10 provisionalaccept, 18 rejected, 3 unclass_highvar, 12 unclassified
INFO     selection_nodes:dec_classification_doesnt_exist:1029 Step 11: classification_doesnt_exist: Change ['provisionalaccept', 'unclassified', 'unclass_highvar'] to accepted if less than 2 components with provisionalaccept exist
INFO     selection_nodes:dec_classification_doesnt_exist:1031 Step 11: classification_doesnt_exist If nothing is provisionally accepted by this point, then rerun ICA & selection. If max iterations of rerunning done, then accept everything not already rejected
INFO     selection_utils:log_decision_tree_step:447 Step 11: classification_doesnt_exist applied to 25 components. None True -> 0. None False -> 25.
INFO     selection_utils:log_classification_counts:492 Step 11: Total component classifications: 10 provisionalaccept, 18 rejected, 3 unclass_highvar, 12 unclassified
INFO     selection_nodes:calc_varex_thresh:1328 Step 12: calc_varex_thresh: Calc varex_upper_thresh, 90th percentile threshold
INFO     selection_utils:log_decision_tree_step:459 Step 12: calc_varex_thresh calculated: varex_upper_thresh=1.0599282255701312, upper_perc=90
INFO     selection_utils:log_classification_counts:492 Step 12: Total component classifications: 10 provisionalaccept, 18 rejected, 3 unclass_highvar, 12 unclassified
INFO     selection_nodes:calc_varex_thresh:1328 Step 13: calc_varex_thresh: Calc varex_lower_thresh, 25th percentile threshold
INFO     selection_utils:log_decision_tree_step:459 Step 13: calc_varex_thresh calculated: varex_lower_thresh=0.40360285414716973, lower_perc=25
INFO     selection_utils:log_classification_counts:492 Step 13: Total component classifications: 10 provisionalaccept, 18 rejected, 3 unclass_highvar, 12 unclassified
INFO     selection_utils:get_extend_factor:846 extend_factor=2.0, based on number of fMRI volumes
INFO     selection_utils:log_decision_tree_step:459 Step 14: calc_extend_factor calculated: extend_factor=2.0
INFO     selection_utils:log_classification_counts:492 Step 14: Total component classifications: 10 provisionalaccept, 18 rejected, 3 unclass_highvar, 12 unclassified
INFO     selection_utils:log_decision_tree_step:459 Step 15: calc_max_good_meanmetricrank calculated: max_good_meanmetricrank=20.0
INFO     selection_utils:log_classification_counts:492 Step 15: Total component classifications: 10 provisionalaccept, 18 rejected, 3 unclass_highvar, 12 unclassified
INFO     selection_utils:log_decision_tree_step:459 Step 16: calc_varex_kappa_ratio calculated: kappa_rate=76.84859750445794
INFO     selection_utils:log_classification_counts:492 Step 16: Total component classifications: 10 provisionalaccept, 18 rejected, 3 unclass_highvar, 12 unclassified
INFO     selection_nodes:dec_left_op_right:389 Step 17: left_op_right: rejected if ['d_table_score>20.0 & variance explained>2.0*1.06'], else nochange
INFO     selection_nodes:dec_left_op_right:391 Step 17: left_op_right If variance and d_table_scores are high, then reject
INFO     selection_utils:comptable_classification_changer:293 Step 17: No components fit criterion True to change classification
INFO     selection_utils:log_decision_tree_step:447 Step 17: left_op_right applied to 25 components. 0 True -> rejected. 25 False -> nochange.
INFO     selection_utils:log_classification_counts:492 Step 17: Total component classifications: 10 provisionalaccept, 18 rejected, 3 unclass_highvar, 12 unclassified
INFO     selection_nodes:dec_left_op_right:389 Step 18: left_op_right: accepted if ['d_table_score>20.0 & variance explained<=0.4 & kappa<=24.01'], else nochange
INFO     selection_nodes:dec_left_op_right:391 Step 18: left_op_right If low variance, accept even if bad kappa & d_table_scores
INFO     selection_utils:log_decision_tree_step:447 Step 18: left_op_right applied to 25 components. 6 True -> accepted. 19 False -> nochange.
INFO     selection_utils:log_classification_counts:492 Step 18: Total component classifications: 6 accepted, 9 provisionalaccept, 18 rejected, 3 unclass_highvar, 7 unclassified
INFO     selection_nodes:dec_classification_doesnt_exist:1029 Step 19: classification_doesnt_exist: Change ['provisionalaccept', 'unclassified', 'unclass_highvar'] to accepted if ['unclassified', 'unclass_highvar'] doesn't exist
INFO     selection_nodes:dec_classification_doesnt_exist:1031 Step 19: classification_doesnt_exist If nothing left is unclassified, then accept all
INFO     selection_utils:log_decision_tree_step:447 Step 19: classification_doesnt_exist applied to 19 components. None True -> 0. None False -> 19.
INFO     selection_utils:log_classification_counts:492 Step 19: Total component classifications: 6 accepted, 9 provisionalaccept, 18 rejected, 3 unclass_highvar, 7 unclassified
INFO     selection_nodes:calc_revised_meanmetricrank_guesses:1788 Step 20: calc_revised_meanmetricrank_guesses: Calc revised d_table_score & num accepted component guesses
INFO     selection_utils:log_decision_tree_step:459 Step 20: calc_revised_meanmetricrank_guesses calculated: num_acc_guess=13, conservative_guess=6.5, restrict_factor=2
INFO     selection_utils:log_classification_counts:492 Step 20: Total component classifications: 6 accepted, 9 provisionalaccept, 18 rejected, 3 unclass_highvar, 7 unclassified
INFO     selection_nodes:dec_left_op_right:389 Step 21: left_op_right: rejected if ['d_table_score_node20>6.5 & varex kappa ratio>2*2.0 & variance explained>2.0*1.06'], else nochange
INFO     selection_nodes:dec_left_op_right:391 Step 21: left_op_right Reject if a combination of kappa, variance, and other factors are ranked worse than others
INFO     selection_utils:log_decision_tree_step:447 Step 21: left_op_right applied to 19 components. 2 True -> rejected. 17 False -> nochange.
INFO     selection_utils:log_classification_counts:492 Step 21: Total component classifications: 6 accepted, 9 provisionalaccept, 20 rejected, 1 unclass_highvar, 7 unclassified
INFO     selection_nodes:dec_left_op_right:389 Step 22: left_op_right: rejected if ['d_table_score_node20>0.9*13 & variance explained>2.0*0.4'], else nochange
INFO     selection_nodes:dec_left_op_right:391 Step 22: left_op_right Reject if a combination of variance and ranks of other metrics are worse than others
INFO     selection_utils:log_decision_tree_step:447 Step 22: left_op_right applied to 17 components. 5 True -> rejected. 12 False -> nochange.
INFO     selection_utils:log_classification_counts:492 Step 22: Total component classifications: 6 accepted, 8 provisionalaccept, 25 rejected, 1 unclass_highvar, 3 unclassified
INFO     selection_nodes:calc_varex_thresh:1328 Step 23: calc_varex_thresh: Calc varex_new_lower_thresh, 25th percentile threshold
INFO     selection_nodes:calc_varex_thresh:1352 Step 23: calc_varex_thresh: num_highest_var_comps (13) > len(comps2use) (12). Setting to equal len(comps2use) since selection should not use more components than exist
INFO     selection_utils:log_decision_tree_step:459 Step 23: calc_varex_thresh calculated: varex_new_lower_thresh=0.5074016845951423, new_lower_perc=25
INFO     selection_utils:log_classification_counts:492 Step 23: Total component classifications: 6 accepted, 8 provisionalaccept, 25 rejected, 1 unclass_highvar, 3 unclassified
INFO     selection_nodes:dec_left_op_right:389 Step 24: left_op_right: accepted if ['d_table_score_node20>13 & variance explained>0.51'], else nochange
INFO     selection_nodes:dec_left_op_right:391 Step 24: left_op_right Accept components with a bad d_table_score, but are at the higher end of the remaining variance so more cautious to not remove
INFO     selection_utils:log_decision_tree_step:447 Step 24: left_op_right applied to 12 components. 1 True -> accepted. 11 False -> nochange.
INFO     selection_utils:log_classification_counts:492 Step 24: Total component classifications: 7 accepted, 8 provisionalaccept, 25 rejected, 1 unclass_highvar, 2 unclassified
INFO     selection_nodes:dec_left_op_right:389 Step 25: left_op_right: accepted if ['kappa<=24.01 & variance explained>0.51'], else nochange
INFO     selection_nodes:dec_left_op_right:391 Step 25: left_op_right For not already rejected components, accept ones below the kappa elbow, but at the higher end of the remaining variance so more cautious to not remove
INFO     selection_utils:comptable_classification_changer:293 Step 25: No components fit criterion True to change classification
INFO     selection_utils:log_decision_tree_step:447 Step 25: left_op_right applied to 11 components. 0 True -> accepted. 11 False -> nochange.
INFO     selection_utils:log_classification_counts:492 Step 25: Total component classifications: 7 accepted, 8 provisionalaccept, 25 rejected, 1 unclass_highvar, 2 unclassified
INFO     selection_nodes:manual_classify:104 Step 26: manual_classify: Set ['provisionalaccept', 'unclassified', 'unclass_highvar'] to accepted 
INFO     selection_nodes:manual_classify:106 Step 26: manual_classify Anything still provisional (accepted or rejected) or unclassified should be accepted
INFO     selection_utils:comptable_classification_changer:293 Step 26: No components fit criterion False to change classification
INFO     selection_utils:log_decision_tree_step:447 Step 26: manual_classify applied to 11 components. 11 True -> accepted. 0 False -> nochange.
INFO     selection_utils:log_classification_counts:492 Step 26: Total component classifications: 18 accepted, 25 rejected
INFO     io:denoise_ts:613 Variance explained by decomposition: 91.66%
INFO     io:write_split_ts:685 Writing high-Kappa time series: /home/runner/work/multi-echo-data-analysis/multi-echo-data-analysis/data/multi-echo-data-analysis/tedana/sub-04570_task-rest_space-scanner_desc-optcomAccepted_bold.nii.gz
INFO     io:write_split_ts:693 Writing low-Kappa time series: /home/runner/work/multi-echo-data-analysis/multi-echo-data-analysis/data/multi-echo-data-analysis/tedana/sub-04570_task-rest_space-scanner_desc-optcomRejected_bold.nii.gz
INFO     io:write_split_ts:700 Writing denoised time series: /home/runner/work/multi-echo-data-analysis/multi-echo-data-analysis/data/multi-echo-data-analysis/tedana/sub-04570_task-rest_space-scanner_desc-denoised_bold.nii.gz
INFO     io:writeresults:749 Writing full ICA coefficient feature set: /home/runner/work/multi-echo-data-analysis/multi-echo-data-analysis/data/multi-echo-data-analysis/tedana/sub-04570_task-rest_space-scanner_desc-ICA_components.nii.gz
INFO     io:writeresults:753 Writing denoised ICA coefficient feature set: /home/runner/work/multi-echo-data-analysis/multi-echo-data-analysis/data/multi-echo-data-analysis/tedana/sub-04570_task-rest_space-scanner_desc-ICAAccepted_components.nii.gz
INFO     io:writeresults:759 Writing Z-normalized spatial component maps: /home/runner/work/multi-echo-data-analysis/multi-echo-data-analysis/data/multi-echo-data-analysis/tedana/sub-04570_task-rest_space-scanner_desc-ICAAccepted_stat-z_components.nii.gz
INFO     gscontrol:minimum_image_regression:213 Performing minimum image regression to remove spatially-diffuse noise
WARNING  gscontrol:minimum_image_regression:225 Decision tree does not contain classification tags indicating low variance components (low variance, accept borderline).
INFO     gscontrol:minimum_image_regression:271 Variance in optimally combined data explained by T1-like global signal: 12.87%
INFO     io:writeresults_echoes:799 Writing Kappa-filtered echo #1 timeseries
INFO     io:denoise_ts:613 Variance explained by decomposition: 83.21%
INFO     io:write_split_ts:682 Writing high-Kappa time series: /home/runner/work/multi-echo-data-analysis/multi-echo-data-analysis/data/multi-echo-data-analysis/tedana/sub-04570_task-rest_space-scanner_echo-1_desc-Accepted_bold.nii.gz
INFO     io:write_split_ts:690 Writing low-Kappa time series: /home/runner/work/multi-echo-data-analysis/multi-echo-data-analysis/data/multi-echo-data-analysis/tedana/sub-04570_task-rest_space-scanner_echo-1_desc-Rejected_bold.nii.gz
INFO     io:write_split_ts:700 Writing denoised time series: /home/runner/work/multi-echo-data-analysis/multi-echo-data-analysis/data/multi-echo-data-analysis/tedana/sub-04570_task-rest_space-scanner_echo-1_desc-Denoised_bold.nii.gz
INFO     io:writeresults_echoes:799 Writing Kappa-filtered echo #2 timeseries
INFO     io:denoise_ts:613 Variance explained by decomposition: 84.82%
INFO     io:write_split_ts:682 Writing high-Kappa time series: /home/runner/work/multi-echo-data-analysis/multi-echo-data-analysis/data/multi-echo-data-analysis/tedana/sub-04570_task-rest_space-scanner_echo-2_desc-Accepted_bold.nii.gz
INFO     io:write_split_ts:690 Writing low-Kappa time series: /home/runner/work/multi-echo-data-analysis/multi-echo-data-analysis/data/multi-echo-data-analysis/tedana/sub-04570_task-rest_space-scanner_echo-2_desc-Rejected_bold.nii.gz
INFO     io:write_split_ts:700 Writing denoised time series: /home/runner/work/multi-echo-data-analysis/multi-echo-data-analysis/data/multi-echo-data-analysis/tedana/sub-04570_task-rest_space-scanner_echo-2_desc-Denoised_bold.nii.gz
INFO     io:writeresults_echoes:799 Writing Kappa-filtered echo #3 timeseries
INFO     io:denoise_ts:613 Variance explained by decomposition: 85.41%
INFO     io:write_split_ts:682 Writing high-Kappa time series: /home/runner/work/multi-echo-data-analysis/multi-echo-data-analysis/data/multi-echo-data-analysis/tedana/sub-04570_task-rest_space-scanner_echo-3_desc-Accepted_bold.nii.gz
INFO     io:write_split_ts:690 Writing low-Kappa time series: /home/runner/work/multi-echo-data-analysis/multi-echo-data-analysis/data/multi-echo-data-analysis/tedana/sub-04570_task-rest_space-scanner_echo-3_desc-Rejected_bold.nii.gz
INFO     io:write_split_ts:700 Writing denoised time series: /home/runner/work/multi-echo-data-analysis/multi-echo-data-analysis/data/multi-echo-data-analysis/tedana/sub-04570_task-rest_space-scanner_echo-3_desc-Denoised_bold.nii.gz
INFO     io:writeresults_echoes:799 Writing Kappa-filtered echo #4 timeseries
INFO     io:denoise_ts:613 Variance explained by decomposition: 85.34%
INFO     io:write_split_ts:682 Writing high-Kappa time series: /home/runner/work/multi-echo-data-analysis/multi-echo-data-analysis/data/multi-echo-data-analysis/tedana/sub-04570_task-rest_space-scanner_echo-4_desc-Accepted_bold.nii.gz
INFO     io:write_split_ts:690 Writing low-Kappa time series: /home/runner/work/multi-echo-data-analysis/multi-echo-data-analysis/data/multi-echo-data-analysis/tedana/sub-04570_task-rest_space-scanner_echo-4_desc-Rejected_bold.nii.gz
INFO     io:write_split_ts:700 Writing denoised time series: /home/runner/work/multi-echo-data-analysis/multi-echo-data-analysis/data/multi-echo-data-analysis/tedana/sub-04570_task-rest_space-scanner_echo-4_desc-Denoised_bold.nii.gz
INFO     tedana:tedana_workflow:1116 Making figures folder with static component maps and timecourse plots.
INFO     io:denoise_ts:613 Variance explained by decomposition: 91.66%
/opt/hostedtoolcache/Python/3.10.18/x64/lib/python3.10/site-packages/tedana/io.py:904: UserWarning: Data array used to create a new image contains 64-bit ints. This is likely due to creating the array with numpy and passing `int` as the `dtype`. Many tools such as FSL and SPM cannot deal with int64 in Nifti images, so for compatibility the data has been converted to int32.
  nii = new_img_like(ref_img, newdata, affine=affine, copy_header=copy_header)
/opt/hostedtoolcache/Python/3.10.18/x64/lib/python3.10/site-packages/tedana/io.py:904: UserWarning: Data array used to create a new image contains 64-bit ints. This is likely due to creating the array with numpy and passing `int` as the `dtype`. Many tools such as FSL and SPM cannot deal with int64 in Nifti images, so for compatibility the data has been converted to int32.
  nii = new_img_like(ref_img, newdata, affine=affine, copy_header=copy_header)
/opt/hostedtoolcache/Python/3.10.18/x64/lib/python3.10/site-packages/tedana/io.py:904: UserWarning: Data array used to create a new image contains 64-bit ints. This is likely due to creating the array with numpy and passing `int` as the `dtype`. Many tools such as FSL and SPM cannot deal with int64 in Nifti images, so for compatibility the data has been converted to int32.
  nii = new_img_like(ref_img, newdata, affine=affine, copy_header=copy_header)
/opt/hostedtoolcache/Python/3.10.18/x64/lib/python3.10/site-packages/nilearn/plotting/img_plotting.py:1317: UserWarning: Non-finite values detected. These values will be replaced with zeros.
  safe_get_data(stat_map_img, ensure_finite=True),
INFO     tedana:tedana_workflow:1172 Generating dynamic report
INFO     html_report:_update_template_bokeh:164 Checking for adaptive mask: sub-04570_task-rest_space-scanner_adaptive_mask.svg, exists: True
INFO     html_report:_update_template_bokeh:204 T2* files exist: True
INFO     html_report:_update_template_bokeh:205 S0 files exist: True
INFO     html_report:_update_template_bokeh:206 RMSE files exist: True
INFO     html_report:_update_template_bokeh:212 External regressors exist: False
INFO     tedana:tedana_workflow:1175 Workflow completed
INFO     utils:log_newsletter_info:705 Don't forget to subscribe to the tedana newsletter for updates! This is a very low volume email list.
INFO     utils:log_newsletter_info:709 https://groups.google.com/g/tedana-newsletter

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
sub-04570_task-rest_space-scanner_S0map.nii.gz
sub-04570_task-rest_space-scanner_T2starmap.nii.gz
sub-04570_task-rest_space-scanner_dataset_description.json
sub-04570_task-rest_space-scanner_desc-ICAAcceptedMIRDenoised_components.nii.gz
sub-04570_task-rest_space-scanner_desc-ICAAccepted_components.nii.gz
sub-04570_task-rest_space-scanner_desc-ICAAccepted_stat-z_components.nii.gz
sub-04570_task-rest_space-scanner_desc-ICAAveragingWeights_components.nii.gz
sub-04570_task-rest_space-scanner_desc-ICACrossComponent_metrics.json
sub-04570_task-rest_space-scanner_desc-ICAMIRDenoised_mixing.tsv
sub-04570_task-rest_space-scanner_desc-ICAS0_stat-F_statmap.nii.gz
sub-04570_task-rest_space-scanner_desc-ICAT2_stat-F_statmap.nii.gz
sub-04570_task-rest_space-scanner_desc-ICA_components.nii.gz
sub-04570_task-rest_space-scanner_desc-ICA_decision_tree.json
sub-04570_task-rest_space-scanner_desc-ICA_decomposition.json
sub-04570_task-rest_space-scanner_desc-ICA_mixing.tsv
sub-04570_task-rest_space-scanner_desc-ICA_stat-z_components.nii.gz
sub-04570_task-rest_space-scanner_desc-ICA_status_table.tsv
sub-04570_task-rest_space-scanner_desc-PCAAveragingWeights_components.nii.gz
sub-04570_task-rest_space-scanner_desc-PCACrossComponent_metrics.json
sub-04570_task-rest_space-scanner_desc-PCAS0_stat-F_statmap.nii.gz
sub-04570_task-rest_space-scanner_desc-PCAT2_stat-F_statmap.nii.gz
sub-04570_task-rest_space-scanner_desc-PCA_decomposition.json
sub-04570_task-rest_space-scanner_desc-PCA_metrics.json
sub-04570_task-rest_space-scanner_desc-PCA_metrics.tsv
sub-04570_task-rest_space-scanner_desc-PCA_mixing.tsv
sub-04570_task-rest_space-scanner_desc-PCA_stat-z_components.nii.gz
sub-04570_task-rest_space-scanner_desc-T1likeEffect_min.nii.gz
sub-04570_task-rest_space-scanner_desc-adaptiveGoodSignal_mask.nii.gz
sub-04570_task-rest_space-scanner_desc-confounds_timeseries.tsv
sub-04570_task-rest_space-scanner_desc-denoised_bold.nii.gz
sub-04570_task-rest_space-scanner_desc-limited_S0map.nii.gz
sub-04570_task-rest_space-scanner_desc-limited_T2starmap.nii.gz
sub-04570_task-rest_space-scanner_desc-optcomAcceptedMIRDenoised_bold.nii.gz
sub-04570_task-rest_space-scanner_desc-optcomAccepted_bold.nii.gz
sub-04570_task-rest_space-scanner_desc-optcomMIRDenoised_bold.nii.gz
sub-04570_task-rest_space-scanner_desc-optcomRejected_bold.nii.gz
sub-04570_task-rest_space-scanner_desc-optcom_bold.nii.gz
sub-04570_task-rest_space-scanner_desc-optcom_whitened_bold.nii.gz
sub-04570_task-rest_space-scanner_desc-rmse_statmap.nii.gz
sub-04570_task-rest_space-scanner_desc-tedana_metrics.json
sub-04570_task-rest_space-scanner_desc-tedana_metrics.tsv
sub-04570_task-rest_space-scanner_desc-tedana_registry.json
sub-04570_task-rest_space-scanner_echo-1_desc-Accepted_bold.nii.gz
sub-04570_task-rest_space-scanner_echo-1_desc-Denoised_bold.nii.gz
sub-04570_task-rest_space-scanner_echo-1_desc-ICAS0ModelPredictions_components.nii.gz
sub-04570_task-rest_space-scanner_echo-1_desc-ICAT2ModelPredictions_components.nii.gz
sub-04570_task-rest_space-scanner_echo-1_desc-ICA_components.nii.gz
sub-04570_task-rest_space-scanner_echo-1_desc-PCAS0ModelPredictions_components.nii.gz
sub-04570_task-rest_space-scanner_echo-1_desc-PCAT2ModelPredictions_components.nii.gz
sub-04570_task-rest_space-scanner_echo-1_desc-PCA_components.nii.gz
sub-04570_task-rest_space-scanner_echo-1_desc-Rejected_bold.nii.gz
sub-04570_task-rest_space-scanner_echo-2_desc-Accepted_bold.nii.gz
sub-04570_task-rest_space-scanner_echo-2_desc-Denoised_bold.nii.gz
sub-04570_task-rest_space-scanner_echo-2_desc-ICAS0ModelPredictions_components.nii.gz
sub-04570_task-rest_space-scanner_echo-2_desc-ICAT2ModelPredictions_components.nii.gz
sub-04570_task-rest_space-scanner_echo-2_desc-ICA_components.nii.gz
sub-04570_task-rest_space-scanner_echo-2_desc-PCAS0ModelPredictions_components.nii.gz
sub-04570_task-rest_space-scanner_echo-2_desc-PCAT2ModelPredictions_components.nii.gz
sub-04570_task-rest_space-scanner_echo-2_desc-PCA_components.nii.gz
sub-04570_task-rest_space-scanner_echo-2_desc-Rejected_bold.nii.gz
sub-04570_task-rest_space-scanner_echo-3_desc-Accepted_bold.nii.gz
sub-04570_task-rest_space-scanner_echo-3_desc-Denoised_bold.nii.gz
sub-04570_task-rest_space-scanner_echo-3_desc-ICAS0ModelPredictions_components.nii.gz
sub-04570_task-rest_space-scanner_echo-3_desc-ICAT2ModelPredictions_components.nii.gz
sub-04570_task-rest_space-scanner_echo-3_desc-ICA_components.nii.gz
sub-04570_task-rest_space-scanner_echo-3_desc-PCAS0ModelPredictions_components.nii.gz
sub-04570_task-rest_space-scanner_echo-3_desc-PCAT2ModelPredictions_components.nii.gz
sub-04570_task-rest_space-scanner_echo-3_desc-PCA_components.nii.gz
sub-04570_task-rest_space-scanner_echo-3_desc-Rejected_bold.nii.gz
sub-04570_task-rest_space-scanner_echo-4_desc-Accepted_bold.nii.gz
sub-04570_task-rest_space-scanner_echo-4_desc-Denoised_bold.nii.gz
sub-04570_task-rest_space-scanner_echo-4_desc-ICAS0ModelPredictions_components.nii.gz
sub-04570_task-rest_space-scanner_echo-4_desc-ICAT2ModelPredictions_components.nii.gz
sub-04570_task-rest_space-scanner_echo-4_desc-ICA_components.nii.gz
sub-04570_task-rest_space-scanner_echo-4_desc-PCAS0ModelPredictions_components.nii.gz
sub-04570_task-rest_space-scanner_echo-4_desc-PCAT2ModelPredictions_components.nii.gz
sub-04570_task-rest_space-scanner_echo-4_desc-PCA_components.nii.gz
sub-04570_task-rest_space-scanner_echo-4_desc-Rejected_bold.nii.gz
sub-04570_task-rest_space-scanner_references.bib
sub-04570_task-rest_space-scanner_report.txt
sub-04570_task-rest_space-scanner_tedana_report.html
tedana_2025-06-10T003444.tsv
metrics = pd.read_table(
    os.path.join(out_dir, "sub-04570_task-rest_space-scanner_desc-tedana_metrics.tsv")
)
Hide code cell source
def color_rejected_red(series):
    """Color rejected components red."""
    return [
        "color: red" if series["classification"] == "rejected" else "" for v in series
    ]


metrics.style.apply(color_rejected_red, axis=1)
  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 23.963910 18.845160 0.974387 0.014406 813 766 0.000000 0.000000 1223 -2.264125 0.025652 31.200000 1 3.124711 nan nan rejected Unlikely BOLD
1 ICA_01 18.386390 15.105416 0.209236 0.002638 322 163 0.243200 0.000000 1228 0.000000 0.000000 31.200000 1 0.874533 nan 5.337717 accepted Low variance
2 ICA_02 53.904796 11.570936 0.365079 0.004694 1849 375 0.621872 0.252033 880 10.298052 0.000000 7.600000 -1 0.520470 6.600000 11.642397 accepted Likely BOLD
3 ICA_03 22.443964 29.659039 0.394177 0.005023 840 1175 0.336829 0.364685 1183 0.000000 0.000000 25.800000 1 1.349670 nan nan rejected Unlikely BOLD
4 ICA_04 36.402447 36.417731 1.079447 0.010505 2030 1616 0.447545 0.424479 1136 7.114071 0.000000 14.400000 -1 2.278803 nan nan rejected Unlikely BOLD
5 ICA_05 14.776330 53.185372 0.539564 0.012173 280 786 0.000000 0.362080 509 -8.452758 0.000000 31.000000 -1 2.806160 nan nan rejected Unlikely BOLD
6 ICA_06 35.682686 41.152975 1.411969 0.016422 722 729 0.268085 0.332160 1050 6.150607 0.000002 19.000000 -1 3.040910 nan nan rejected Unlikely BOLD
7 ICA_07 102.876143 10.929019 0.754819 0.009029 3277 362 0.669988 0.166436 613 6.615788 0.000000 2.800000 -1 0.563851 2.400000 14.470979 accepted Likely BOLD
8 ICA_08 14.768110 20.934533 0.273712 0.003667 226 300 0.059908 0.384615 997 -6.963965 0.000000 34.200000 -1 1.424309 nan nan rejected Unlikely BOLD
9 ICA_09 21.605372 17.761140 0.307787 0.004137 388 282 0.000000 0.000000 1225 0.000000 0.000000 32.000000 1 1.094775 nan 13.269860 accepted Low variance
10 ICA_10 49.297713 30.183255 0.940788 0.012705 3215 1499 0.515872 0.268544 1121 -1.525198 0.131335 16.400000 1 1.466563 nan nan rejected Unlikely BOLD
11 ICA_11 22.601135 36.298328 0.453209 0.004387 470 538 0.341151 0.458527 1089 1.325181 0.197289 23.400000 -1 1.541007 nan nan rejected Unlikely BOLD
12 ICA_12 23.968036 20.341244 0.472085 0.004739 570 377 0.255958 0.176471 1148 -3.632142 0.000857 29.000000 -1 1.513643 17.000000 26.592542 accepted Likely BOLD
13 ICA_13 24.006483 14.921336 0.218386 0.003102 1128 630 0.319091 0.296675 1231 0.000000 0.000000 26.000000 -1 0.699088 nan 9.380691 accepted Low variance
14 ICA_14 52.863978 11.030685 0.808909 0.009880 2942 188 0.563806 0.000000 929 12.391319 0.000000 7.600000 -1 1.175915 6.600000 11.451016 accepted Likely BOLD
15 ICA_15 28.881649 23.392165 1.202041 0.011165 1297 433 0.313320 0.163170 1233 0.000000 0.000000 25.200000 1 3.198404 15.200000 nan rejected Less likely BOLD
16 ICA_16 25.912802 31.719562 0.420603 0.004614 392 463 0.304124 0.282916 1099 0.000000 0.000000 26.400000 1 1.247365 nan nan rejected Unlikely BOLD
17 ICA_17 16.999247 19.297453 0.278863 0.003151 420 655 0.203593 0.222566 1230 0.000000 0.000000 31.800000 -1 1.260659 nan nan rejected Unlikely BOLD
18 ICA_18 66.799022 11.946827 0.683821 0.006818 2054 421 0.645953 0.255696 689 14.985958 0.000000 4.400000 -1 0.786699 3.800000 19.209823 accepted Likely BOLD
19 ICA_19 37.562890 40.905321 1.464678 0.015207 547 710 0.389199 0.400868 1001 3.334854 0.002702 17.000000 1 2.996533 nan nan rejected Unlikely BOLD
20 ICA_20 15.305864 21.290880 0.407149 0.006202 45 192 0.000000 0.317708 831 -2.145011 0.032462 33.200000 -1 2.044238 nan nan rejected Unlikely BOLD
21 ICA_21 84.952283 11.250273 1.244685 0.008481 2580 288 0.658527 0.117647 628 10.338983 0.000000 3.400000 1 1.125953 3.000000 7.678323 accepted Likely BOLD
22 ICA_22 47.428357 22.884456 18.118683 0.147507 5043 2404 0.457943 0.179092 1041 0.000000 0.000000 13.600000 -1 29.357867 9.400000 nan rejected Less likely BOLD
23 ICA_23 12.120251 29.573528 0.326093 0.004685 94 214 0.000000 0.503529 650 -8.669511 0.000000 33.600000 1 2.067595 nan nan rejected Unlikely BOLD
24 ICA_24 34.286932 24.547042 0.972365 0.010708 1262 419 0.400000 0.000000 1251 0.000000 0.000000 22.800000 1 2.179397 13.800000 nan rejected Less likely BOLD
25 ICA_25 16.953422 16.732650 0.211095 0.002731 260 459 0.000000 0.317181 1270 0.000000 0.000000 36.400000 1 0.956880 nan nan rejected Unlikely BOLD
26 ICA_26 20.361392 14.432911 0.176224 0.002748 500 235 0.377510 0.186147 1203 3.117638 0.002406 24.200000 1 0.665110 nan 7.400702 accepted Low variance
27 ICA_27 33.321036 32.060287 0.865706 0.010818 492 365 0.357895 0.000000 1084 0.000000 0.000000 22.800000 1 1.996586 14.600000 nan rejected Less likely BOLD
28 ICA_28 30.108351 12.927686 1.039400 0.007045 1158 121 0.388220 0.000000 1155 0.000000 0.000000 22.200000 1 2.652965 14.400000 nan rejected Less likely BOLD
29 ICA_29 80.883760 12.626881 0.636901 0.010566 2945 465 0.581311 0.026287 601 8.423694 0.000000 4.000000 -1 0.605127 3.600000 11.847878 accepted Likely BOLD
30 ICA_30 43.827473 11.578461 0.519174 0.005640 1534 313 0.566335 0.130081 819 14.342942 0.000000 9.000000 1 0.910338 8.000000 14.850684 accepted Likely BOLD
31 ICA_31 29.139108 23.873300 0.759698 0.011004 1720 1160 0.207729 0.188510 1255 0.000000 0.000000 26.600000 -1 2.003553 15.400000 27.335733 accepted Accept borderline
32 ICA_32 14.755411 17.029743 0.269894 0.003557 401 440 0.000000 0.000000 1239 0.000000 0.000000 35.000000 1 1.405653 nan nan rejected Unlikely BOLD
33 ICA_33 44.086324 18.077004 1.513722 0.009673 2119 408 0.523480 0.037783 777 1.150975 0.250259 10.600000 -1 2.638628 8.400000 12.408701 accepted Likely BOLD
34 ICA_34 56.429382 10.814910 0.247334 0.004278 1781 95 0.617319 0.000000 666 11.382307 0.000000 6.000000 1 0.336833 5.200000 6.951763 accepted Likely BOLD
35 ICA_35 17.790500 12.597793 0.232961 0.003241 285 51 0.352113 0.000000 1242 -5.030514 0.000018 33.600000 -1 1.006310 nan 13.233910 accepted Low variance
36 ICA_36 32.499106 34.934669 0.689722 0.007488 1095 1807 0.434334 0.462183 1082 0.153060 0.878607 18.200000 1 1.630942 nan nan rejected Unlikely BOLD
37 ICA_37 70.548540 17.969418 29.229082 0.233936 5731 1645 0.566419 0.110131 709 0.000000 0.000000 8.600000 -1 31.839269 5.800000 79.586949 accepted Likely BOLD
38 ICA_38 21.288556 23.449890 1.429819 0.018098 1218 1285 0.240820 0.334156 1131 2.114198 0.037227 23.600000 -1 5.161439 nan nan rejected Unlikely BOLD
39 ICA_39 32.808892 32.459510 1.024512 0.010649 683 544 0.362297 0.336725 1065 0.000000 0.000000 21.600000 1 2.399724 14.000000 nan rejected Less likely BOLD
40 ICA_40 16.606237 18.724607 0.389232 0.005196 270 307 0.172084 0.164204 920 -10.839641 0.000000 32.800000 1 1.801246 nan nan rejected Unlikely BOLD
41 ICA_41 48.017993 36.938387 26.082638 0.311829 6059 5930 0.515417 0.356028 719 0.000000 0.000000 10.800000 1 41.742980 7.600000 nan rejected Less likely BOLD
42 ICA_42 17.346959 15.014701 0.360350 0.005460 268 68 0.434263 0.135338 956 5.441800 0.000000 22.600000 -1 1.596382 nan 16.339245 accepted Low variance
with open(
    os.path.join(out_dir, "sub-04570_task-rest_space-scanner_desc-tedana_metrics.json"),
    "r",
) as fo:
    data = json.load(fo)

first_five_keys = list(data.keys())[:5]
reduced_data = {k: data[k] for k in first_five_keys}
pprint(reduced_data)
{'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(data, 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 in the optimally combined data of each component.On a scale from 0 to 1. Normalized variance explained arbitrary 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 Variance explained in the optimally combined data of each component. On a scale from 0 to 100. Variance explained arbitrary n/a
report = os.path.join(out_dir, "tedana_report.html")
with open(report, "r") as fo:
    report_data = fo.read()

figures_dir = os.path.relpath(os.path.join(out_dir, "figures"), os.getcwd())
report_data = report_data.replace("./figures", figures_dir)

display(HTML(report_data))
---------------------------------------------------------------------------
FileNotFoundError                         Traceback (most recent call last)
Cell In[9], line 2
      1 report = os.path.join(out_dir, "tedana_report.html")
----> 2 with open(report, "r") as fo:
      3     report_data = fo.read()
      5 figures_dir = os.path.relpath(os.path.join(out_dir, "figures"), os.getcwd())

File /opt/hostedtoolcache/Python/3.10.18/x64/lib/python3.10/site-packages/IPython/core/interactiveshell.py:324, in _modified_open(file, *args, **kwargs)
    317 if file in {0, 1, 2}:
    318     raise ValueError(
    319         f"IPython won't let you open fd={file} by default "
    320         "as it is likely to crash IPython. If you know what you are doing, "
    321         "you can use builtins' open."
    322     )
--> 324 return io_open(file, *args, **kwargs)

FileNotFoundError: [Errno 2] No such file or directory: '/home/runner/work/multi-echo-data-analysis/multi-echo-data-analysis/data/multi-echo-data-analysis/tedana/tedana_report.html'