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])
---- repo2data starting ----
/opt/hostedtoolcache/Python/3.10.17/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.17/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:596 Using output directory: /home/runner/work/multi-echo-data-analysis/multi-echo-data-analysis/data/multi-echo-data-analysis/tedana
INFO     tedana:tedana_workflow:615 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:618 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:703 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:759 Computing T2* map
2-echo monoexponential:   0%|          | 0/2224 [00:00<?, ?it/s]
2-echo monoexponential:   3%|▎         | 64/2224 [00:00<00:03, 634.85it/s]
2-echo monoexponential:   6%|▋         | 144/2224 [00:00<00:02, 731.45it/s]
2-echo monoexponential:  10%|█         | 226/2224 [00:00<00:02, 769.15it/s]
2-echo monoexponential:  14%|█▍        | 309/2224 [00:00<00:02, 789.13it/s]
2-echo monoexponential:  17%|█▋        | 388/2224 [00:00<00:02, 752.06it/s]
2-echo monoexponential:  21%|██▏       | 474/2224 [00:00<00:02, 786.19it/s]
2-echo monoexponential:  25%|██▌       | 557/2224 [00:00<00:02, 799.46it/s]
2-echo monoexponential:  29%|██▊       | 638/2224 [00:00<00:02, 790.96it/s]
2-echo monoexponential:  32%|███▏      | 718/2224 [00:00<00:01, 791.25it/s]
2-echo monoexponential:  36%|███▌      | 803/2224 [00:01<00:01, 806.93it/s]
2-echo monoexponential:  40%|███▉      | 885/2224 [00:01<00:01, 808.05it/s]
2-echo monoexponential:  43%|████▎     | 966/2224 [00:01<00:01, 806.00it/s]
2-echo monoexponential:  47%|████▋     | 1049/2224 [00:01<00:01, 810.13it/s]
2-echo monoexponential:  51%|█████     | 1131/2224 [00:01<00:01, 800.13it/s]
2-echo monoexponential:  54%|█████▍    | 1212/2224 [00:01<00:01, 801.02it/s]
2-echo monoexponential:  58%|█████▊    | 1294/2224 [00:01<00:01, 806.34it/s]
2-echo monoexponential:  62%|██████▏   | 1375/2224 [00:01<00:01, 803.86it/s]
2-echo monoexponential:  65%|██████▌   | 1456/2224 [00:01<00:00, 801.45it/s]
2-echo monoexponential:  69%|██████▉   | 1537/2224 [00:01<00:00, 803.46it/s]
2-echo monoexponential:  73%|███████▎  | 1620/2224 [00:02<00:00, 810.50it/s]
2-echo monoexponential:  77%|███████▋  | 1702/2224 [00:02<00:00, 811.14it/s]
2-echo monoexponential:  80%|████████  | 1784/2224 [00:02<00:00, 812.43it/s]
2-echo monoexponential:  84%|████████▍ | 1868/2224 [00:02<00:00, 820.48it/s]
2-echo monoexponential:  88%|████████▊ | 1953/2224 [00:02<00:00, 827.20it/s]
2-echo monoexponential:  92%|█████████▏| 2036/2224 [00:02<00:00, 821.12it/s]
2-echo monoexponential:  95%|█████████▌| 2119/2224 [00:02<00:00, 809.73it/s]
2-echo monoexponential:  99%|█████████▉| 2201/2224 [00:02<00:00, 807.47it/s]
2-echo monoexponential: 100%|██████████| 2224/2224 [00:02<00:00, 799.57it/s]

3-echo monoexponential:   0%|          | 0/1092 [00:00<?, ?it/s]
3-echo monoexponential:   5%|▍         | 50/1092 [00:00<00:02, 499.01it/s]
3-echo monoexponential:   9%|▉         | 103/1092 [00:00<00:01, 514.45it/s]
3-echo monoexponential:  14%|█▍        | 157/1092 [00:00<00:01, 525.32it/s]
3-echo monoexponential:  19%|█▉        | 211/1092 [00:00<00:01, 530.52it/s]
3-echo monoexponential:  24%|██▍       | 265/1092 [00:00<00:01, 531.22it/s]
3-echo monoexponential:  29%|██▉       | 319/1092 [00:00<00:01, 524.48it/s]
3-echo monoexponential:  34%|███▍      | 372/1092 [00:00<00:01, 519.00it/s]
3-echo monoexponential:  39%|███▉      | 424/1092 [00:00<00:01, 518.01it/s]
3-echo monoexponential:  44%|████▍     | 479/1092 [00:00<00:01, 527.69it/s]
3-echo monoexponential:  49%|████▊     | 532/1092 [00:01<00:01, 524.32it/s]
3-echo monoexponential:  54%|█████▎    | 585/1092 [00:01<00:00, 517.59it/s]
3-echo monoexponential:  58%|█████▊    | 637/1092 [00:01<00:00, 515.91it/s]
3-echo monoexponential:  63%|██████▎   | 689/1092 [00:01<00:00, 514.97it/s]
3-echo monoexponential:  68%|██████▊   | 742/1092 [00:01<00:00, 517.54it/s]
3-echo monoexponential:  73%|███████▎  | 794/1092 [00:01<00:00, 504.95it/s]
3-echo monoexponential:  78%|███████▊  | 848/1092 [00:01<00:00, 512.01it/s]
3-echo monoexponential:  82%|████████▏ | 900/1092 [00:01<00:00, 513.27it/s]
3-echo monoexponential:  87%|████████▋ | 953/1092 [00:01<00:00, 516.98it/s]
3-echo monoexponential:  92%|█████████▏| 1006/1092 [00:01<00:00, 518.41it/s]
3-echo monoexponential:  97%|█████████▋| 1060/1092 [00:02<00:00, 522.19it/s]
3-echo monoexponential: 100%|██████████| 1092/1092 [00:02<00:00, 518.99it/s]

4-echo monoexponential:   0%|          | 0/20176 [00:00<?, ?it/s]
4-echo monoexponential:   0%|          | 53/20176 [00:00<00:38, 526.13it/s]
4-echo monoexponential:   1%|          | 109/20176 [00:00<00:36, 543.08it/s]
4-echo monoexponential:   1%|          | 170/20176 [00:00<00:34, 571.66it/s]
4-echo monoexponential:   1%|          | 231/20176 [00:00<00:34, 585.73it/s]
4-echo monoexponential:   1%|▏         | 290/20176 [00:00<00:34, 581.94it/s]
4-echo monoexponential:   2%|▏         | 352/20176 [00:00<00:33, 591.80it/s]
4-echo monoexponential:   2%|▏         | 413/20176 [00:00<00:33, 590.71it/s]
4-echo monoexponential:   2%|▏         | 474/20176 [00:00<00:33, 595.45it/s]
4-echo monoexponential:   3%|▎         | 536/20176 [00:00<00:32, 600.68it/s]
4-echo monoexponential:   3%|▎         | 597/20176 [00:01<00:32, 599.32it/s]
4-echo monoexponential:   3%|▎         | 657/20176 [00:01<00:33, 591.25it/s]
4-echo monoexponential:   4%|▎         | 717/20176 [00:01<00:32, 590.33it/s]
4-echo monoexponential:   4%|▍         | 777/20176 [00:01<00:32, 592.15it/s]
4-echo monoexponential:   4%|▍         | 837/20176 [00:01<00:32, 592.62it/s]
4-echo monoexponential:   4%|▍         | 899/20176 [00:01<00:32, 597.61it/s]
4-echo monoexponential:   5%|▍         | 959/20176 [00:01<00:32, 593.64it/s]
4-echo monoexponential:   5%|▌         | 1019/20176 [00:01<00:33, 566.26it/s]
4-echo monoexponential:   5%|▌         | 1077/20176 [00:01<00:33, 569.95it/s]
4-echo monoexponential:   6%|▌         | 1139/20176 [00:01<00:32, 583.94it/s]
4-echo monoexponential:   6%|▌         | 1200/20176 [00:02<00:32, 590.15it/s]
4-echo monoexponential:   6%|▌         | 1260/20176 [00:02<00:31, 592.30it/s]
4-echo monoexponential:   7%|▋         | 1324/20176 [00:02<00:31, 604.69it/s]
4-echo monoexponential:   7%|▋         | 1390/20176 [00:02<00:30, 618.29it/s]
4-echo monoexponential:   7%|▋         | 1452/20176 [00:02<00:31, 599.84it/s]
4-echo monoexponential:   7%|▋         | 1513/20176 [00:02<00:31, 586.57it/s]
4-echo monoexponential:   8%|▊         | 1576/20176 [00:02<00:31, 598.82it/s]
4-echo monoexponential:   8%|▊         | 1639/20176 [00:02<00:30, 605.82it/s]
4-echo monoexponential:   8%|▊         | 1703/20176 [00:02<00:30, 613.93it/s]
4-echo monoexponential:   9%|▊         | 1765/20176 [00:02<00:29, 613.86it/s]
4-echo monoexponential:   9%|▉         | 1828/20176 [00:03<00:29, 618.08it/s]
4-echo monoexponential:   9%|▉         | 1891/20176 [00:03<00:29, 618.68it/s]
4-echo monoexponential:  10%|▉         | 1953/20176 [00:03<00:29, 618.39it/s]
4-echo monoexponential:  10%|▉         | 2015/20176 [00:03<00:30, 591.05it/s]
4-echo monoexponential:  10%|█         | 2078/20176 [00:03<00:30, 600.93it/s]
4-echo monoexponential:  11%|█         | 2140/20176 [00:03<00:30, 601.17it/s]
4-echo monoexponential:  11%|█         | 2205/20176 [00:03<00:29, 613.90it/s]
4-echo monoexponential:  11%|█         | 2269/20176 [00:03<00:28, 620.77it/s]
4-echo monoexponential:  12%|█▏        | 2335/20176 [00:03<00:28, 629.53it/s]
4-echo monoexponential:  12%|█▏        | 2399/20176 [00:03<00:28, 632.35it/s]
4-echo monoexponential:  12%|█▏        | 2464/20176 [00:04<00:27, 635.77it/s]
4-echo monoexponential:  13%|█▎        | 2528/20176 [00:04<00:27, 633.70it/s]
4-echo monoexponential:  13%|█▎        | 2592/20176 [00:04<00:29, 605.78it/s]
4-echo monoexponential:  13%|█▎        | 2653/20176 [00:04<00:29, 603.56it/s]
4-echo monoexponential:  13%|█▎        | 2717/20176 [00:04<00:28, 611.68it/s]
4-echo monoexponential:  14%|█▍        | 2779/20176 [00:04<00:28, 613.08it/s]
4-echo monoexponential:  14%|█▍        | 2844/20176 [00:04<00:27, 622.60it/s]
4-echo monoexponential:  14%|█▍        | 2909/20176 [00:04<00:27, 629.26it/s]
4-echo monoexponential:  15%|█▍        | 2973/20176 [00:04<00:27, 631.91it/s]
4-echo monoexponential:  15%|█▌        | 3038/20176 [00:05<00:26, 636.88it/s]
4-echo monoexponential:  15%|█▌        | 3103/20176 [00:05<00:26, 640.12it/s]
4-echo monoexponential:  16%|█▌        | 3168/20176 [00:05<00:26, 639.74it/s]
4-echo monoexponential:  16%|█▌        | 3232/20176 [00:05<00:27, 615.93it/s]
4-echo monoexponential:  16%|█▋        | 3294/20176 [00:05<00:27, 615.88it/s]
4-echo monoexponential:  17%|█▋        | 3357/20176 [00:05<00:27, 618.20it/s]
4-echo monoexponential:  17%|█▋        | 3419/20176 [00:05<00:27, 616.38it/s]
4-echo monoexponential:  17%|█▋        | 3483/20176 [00:05<00:26, 621.68it/s]
4-echo monoexponential:  18%|█▊        | 3551/20176 [00:05<00:26, 637.90it/s]
4-echo monoexponential:  18%|█▊        | 3615/20176 [00:05<00:26, 635.21it/s]
4-echo monoexponential:  18%|█▊        | 3679/20176 [00:06<00:26, 632.18it/s]
4-echo monoexponential:  19%|█▊        | 3744/20176 [00:06<00:25, 637.26it/s]
4-echo monoexponential:  19%|█▉        | 3808/20176 [00:06<00:25, 636.38it/s]
4-echo monoexponential:  19%|█▉        | 3872/20176 [00:06<00:25, 631.05it/s]
4-echo monoexponential:  20%|█▉        | 3936/20176 [00:06<00:26, 617.66it/s]
4-echo monoexponential:  20%|█▉        | 3999/20176 [00:06<00:26, 616.93it/s]
4-echo monoexponential:  20%|██        | 4061/20176 [00:06<00:26, 616.75it/s]
4-echo monoexponential:  20%|██        | 4123/20176 [00:06<00:26, 611.38it/s]
4-echo monoexponential:  21%|██        | 4185/20176 [00:06<00:26, 608.76it/s]
4-echo monoexponential:  21%|██        | 4250/20176 [00:06<00:25, 620.35it/s]
4-echo monoexponential:  21%|██▏       | 4317/20176 [00:07<00:25, 632.34it/s]
4-echo monoexponential:  22%|██▏       | 4381/20176 [00:07<00:25, 627.38it/s]
4-echo monoexponential:  22%|██▏       | 4445/20176 [00:07<00:24, 630.48it/s]
4-echo monoexponential:  22%|██▏       | 4510/20176 [00:07<00:24, 634.48it/s]
4-echo monoexponential:  23%|██▎       | 4574/20176 [00:07<00:24, 635.41it/s]
4-echo monoexponential:  23%|██▎       | 4638/20176 [00:07<00:24, 631.69it/s]
4-echo monoexponential:  23%|██▎       | 4702/20176 [00:07<00:25, 614.38it/s]
4-echo monoexponential:  24%|██▎       | 4766/20176 [00:07<00:24, 620.43it/s]
4-echo monoexponential:  24%|██▍       | 4829/20176 [00:07<00:24, 621.82it/s]
4-echo monoexponential:  24%|██▍       | 4892/20176 [00:07<00:24, 614.51it/s]
4-echo monoexponential:  25%|██▍       | 4955/20176 [00:08<00:24, 617.95it/s]
4-echo monoexponential:  25%|██▍       | 5021/20176 [00:08<00:24, 628.37it/s]
4-echo monoexponential:  25%|██▌       | 5086/20176 [00:08<00:23, 632.60it/s]
4-echo monoexponential:  26%|██▌       | 5154/20176 [00:08<00:23, 643.85it/s]
4-echo monoexponential:  26%|██▌       | 5219/20176 [00:08<00:23, 643.65it/s]
4-echo monoexponential:  26%|██▌       | 5284/20176 [00:08<00:23, 643.07it/s]
4-echo monoexponential:  27%|██▋       | 5349/20176 [00:08<00:23, 642.49it/s]
4-echo monoexponential:  27%|██▋       | 5414/20176 [00:08<00:23, 624.86it/s]
4-echo monoexponential:  27%|██▋       | 5477/20176 [00:08<00:23, 614.30it/s]
4-echo monoexponential:  27%|██▋       | 5539/20176 [00:09<00:23, 614.67it/s]
4-echo monoexponential:  28%|██▊       | 5603/20176 [00:09<00:23, 619.63it/s]
4-echo monoexponential:  28%|██▊       | 5666/20176 [00:09<00:23, 617.90it/s]
4-echo monoexponential:  28%|██▊       | 5732/20176 [00:09<00:22, 630.14it/s]
4-echo monoexponential:  29%|██▊       | 5800/20176 [00:09<00:22, 641.98it/s]
4-echo monoexponential:  29%|██▉       | 5865/20176 [00:09<00:22, 643.06it/s]
4-echo monoexponential:  29%|██▉       | 5930/20176 [00:09<00:22, 639.21it/s]
4-echo monoexponential:  30%|██▉       | 5994/20176 [00:09<00:22, 630.91it/s]
4-echo monoexponential:  30%|███       | 6058/20176 [00:09<00:22, 629.96it/s]
4-echo monoexponential:  30%|███       | 6123/20176 [00:09<00:22, 633.40it/s]
4-echo monoexponential:  31%|███       | 6187/20176 [00:10<00:22, 621.97it/s]
4-echo monoexponential:  31%|███       | 6250/20176 [00:10<00:23, 602.38it/s]
4-echo monoexponential:  31%|███▏      | 6311/20176 [00:10<00:23, 597.98it/s]
4-echo monoexponential:  32%|███▏      | 6373/20176 [00:10<00:22, 603.19it/s]
4-echo monoexponential:  32%|███▏      | 6435/20176 [00:10<00:22, 607.77it/s]
4-echo monoexponential:  32%|███▏      | 6502/20176 [00:10<00:21, 623.65it/s]
4-echo monoexponential:  33%|███▎      | 6567/20176 [00:10<00:21, 629.17it/s]
4-echo monoexponential:  33%|███▎      | 6632/20176 [00:10<00:21, 632.68it/s]
4-echo monoexponential:  33%|███▎      | 6696/20176 [00:10<00:21, 634.43it/s]
4-echo monoexponential:  34%|███▎      | 6760/20176 [00:10<00:21, 633.20it/s]
4-echo monoexponential:  34%|███▍      | 6824/20176 [00:11<00:21, 634.79it/s]
4-echo monoexponential:  34%|███▍      | 6888/20176 [00:11<00:21, 632.00it/s]
4-echo monoexponential:  34%|███▍      | 6952/20176 [00:11<00:21, 617.56it/s]
4-echo monoexponential:  35%|███▍      | 7014/20176 [00:11<00:22, 597.13it/s]
4-echo monoexponential:  35%|███▌      | 7077/20176 [00:11<00:21, 604.80it/s]
4-echo monoexponential:  35%|███▌      | 7140/20176 [00:11<00:21, 610.78it/s]
4-echo monoexponential:  36%|███▌      | 7202/20176 [00:11<00:21, 605.87it/s]
4-echo monoexponential:  36%|███▌      | 7267/20176 [00:11<00:20, 617.16it/s]
4-echo monoexponential:  36%|███▋      | 7334/20176 [00:11<00:20, 630.62it/s]
4-echo monoexponential:  37%|███▋      | 7399/20176 [00:12<00:20, 635.45it/s]
4-echo monoexponential:  37%|███▋      | 7463/20176 [00:12<00:20, 624.62it/s]
4-echo monoexponential:  37%|███▋      | 7526/20176 [00:12<00:20, 624.40it/s]
4-echo monoexponential:  38%|███▊      | 7591/20176 [00:12<00:19, 630.42it/s]
4-echo monoexponential:  38%|███▊      | 7656/20176 [00:12<00:19, 635.89it/s]
4-echo monoexponential:  38%|███▊      | 7720/20176 [00:12<00:19, 624.78it/s]
4-echo monoexponential:  39%|███▊      | 7783/20176 [00:12<00:20, 602.96it/s]
4-echo monoexponential:  39%|███▉      | 7844/20176 [00:12<00:20, 603.99it/s]
4-echo monoexponential:  39%|███▉      | 7905/20176 [00:12<00:20, 602.70it/s]
4-echo monoexponential:  40%|███▉      | 7970/20176 [00:12<00:19, 614.30it/s]
4-echo monoexponential:  40%|███▉      | 8032/20176 [00:13<00:20, 606.44it/s]
4-echo monoexponential:  40%|████      | 8099/20176 [00:13<00:19, 622.88it/s]
4-echo monoexponential:  40%|████      | 8164/20176 [00:13<00:19, 630.39it/s]
4-echo monoexponential:  41%|████      | 8228/20176 [00:13<00:18, 631.68it/s]
4-echo monoexponential:  41%|████      | 8293/20176 [00:13<00:18, 636.41it/s]
4-echo monoexponential:  41%|████▏     | 8358/20176 [00:13<00:18, 639.06it/s]
4-echo monoexponential:  42%|████▏     | 8422/20176 [00:13<00:18, 625.00it/s]
4-echo monoexponential:  42%|████▏     | 8487/20176 [00:13<00:18, 631.96it/s]
4-echo monoexponential:  42%|████▏     | 8551/20176 [00:13<00:18, 616.42it/s]
4-echo monoexponential:  43%|████▎     | 8613/20176 [00:13<00:18, 608.86it/s]
4-echo monoexponential:  43%|████▎     | 8674/20176 [00:14<00:18, 606.25it/s]
4-echo monoexponential:  43%|████▎     | 8735/20176 [00:14<00:18, 602.49it/s]
4-echo monoexponential:  44%|████▎     | 8799/20176 [00:14<00:18, 613.22it/s]
4-echo monoexponential:  44%|████▍     | 8863/20176 [00:14<00:18, 618.11it/s]
4-echo monoexponential:  44%|████▍     | 8925/20176 [00:14<00:18, 618.19it/s]
4-echo monoexponential:  45%|████▍     | 8989/20176 [00:14<00:17, 623.18it/s]
4-echo monoexponential:  45%|████▍     | 9052/20176 [00:14<00:17, 622.67it/s]
4-echo monoexponential:  45%|████▌     | 9116/20176 [00:14<00:17, 625.47it/s]
4-echo monoexponential:  46%|████▌     | 9184/20176 [00:14<00:17, 640.51it/s]
4-echo monoexponential:  46%|████▌     | 9249/20176 [00:14<00:16, 643.05it/s]
4-echo monoexponential:  46%|████▌     | 9314/20176 [00:15<00:16, 642.93it/s]
4-echo monoexponential:  46%|████▋     | 9379/20176 [00:15<00:17, 619.28it/s]
4-echo monoexponential:  47%|████▋     | 9443/20176 [00:15<00:17, 623.46it/s]
4-echo monoexponential:  47%|████▋     | 9506/20176 [00:15<00:17, 612.03it/s]
4-echo monoexponential:  47%|████▋     | 9568/20176 [00:15<00:17, 612.21it/s]
4-echo monoexponential:  48%|████▊     | 9632/20176 [00:15<00:17, 618.34it/s]
4-echo monoexponential:  48%|████▊     | 9694/20176 [00:15<00:17, 611.48it/s]
4-echo monoexponential:  48%|████▊     | 9758/20176 [00:15<00:16, 619.26it/s]
4-echo monoexponential:  49%|████▊     | 9820/20176 [00:15<00:16, 619.00it/s]
4-echo monoexponential:  49%|████▉     | 9885/20176 [00:16<00:16, 627.72it/s]
4-echo monoexponential:  49%|████▉     | 9950/20176 [00:16<00:16, 633.94it/s]
4-echo monoexponential:  50%|████▉     | 10018/20176 [00:16<00:15, 646.37it/s]
4-echo monoexponential:  50%|████▉     | 10083/20176 [00:16<00:15, 642.04it/s]
4-echo monoexponential:  50%|█████     | 10148/20176 [00:16<00:15, 633.71it/s]
4-echo monoexponential:  51%|█████     | 10212/20176 [00:16<00:16, 609.02it/s]
4-echo monoexponential:  51%|█████     | 10275/20176 [00:16<00:16, 613.26it/s]
4-echo monoexponential:  51%|█████     | 10337/20176 [00:16<00:16, 609.94it/s]
4-echo monoexponential:  52%|█████▏    | 10400/20176 [00:16<00:15, 613.80it/s]
4-echo monoexponential:  52%|█████▏    | 10463/20176 [00:16<00:15, 616.57it/s]
4-echo monoexponential:  52%|█████▏    | 10528/20176 [00:17<00:15, 623.97it/s]
4-echo monoexponential:  53%|█████▎    | 10595/20176 [00:17<00:15, 635.34it/s]
4-echo monoexponential:  53%|█████▎    | 10659/20176 [00:17<00:15, 619.14it/s]
4-echo monoexponential:  53%|█████▎    | 10725/20176 [00:17<00:15, 629.02it/s]
4-echo monoexponential:  53%|█████▎    | 10790/20176 [00:17<00:14, 631.83it/s]
4-echo monoexponential:  54%|█████▍    | 10854/20176 [00:17<00:14, 632.27it/s]
4-echo monoexponential:  54%|█████▍    | 10918/20176 [00:17<00:14, 632.43it/s]
4-echo monoexponential:  54%|█████▍    | 10982/20176 [00:17<00:15, 608.35it/s]
4-echo monoexponential:  55%|█████▍    | 11044/20176 [00:17<00:15, 602.53it/s]
4-echo monoexponential:  55%|█████▌    | 11105/20176 [00:17<00:15, 600.55it/s]
4-echo monoexponential:  55%|█████▌    | 11167/20176 [00:18<00:14, 604.87it/s]
4-echo monoexponential:  56%|█████▌    | 11237/20176 [00:18<00:14, 629.55it/s]
4-echo monoexponential:  56%|█████▌    | 11301/20176 [00:18<00:14, 630.71it/s]
4-echo monoexponential:  56%|█████▋    | 11365/20176 [00:18<00:13, 632.05it/s]
4-echo monoexponential:  57%|█████▋    | 11429/20176 [00:18<00:13, 631.55it/s]
4-echo monoexponential:  57%|█████▋    | 11495/20176 [00:18<00:13, 639.27it/s]
4-echo monoexponential:  57%|█████▋    | 11559/20176 [00:18<00:13, 636.07it/s]
4-echo monoexponential:  58%|█████▊    | 11625/20176 [00:18<00:13, 640.35it/s]
4-echo monoexponential:  58%|█████▊    | 11691/20176 [00:18<00:13, 644.06it/s]
4-echo monoexponential:  58%|█████▊    | 11756/20176 [00:19<00:14, 599.78it/s]
4-echo monoexponential:  59%|█████▊    | 11817/20176 [00:19<00:14, 586.60it/s]
4-echo monoexponential:  59%|█████▉    | 11879/20176 [00:19<00:13, 593.48it/s]
4-echo monoexponential:  59%|█████▉    | 11943/20176 [00:19<00:13, 604.82it/s]
4-echo monoexponential:  60%|█████▉    | 12006/20176 [00:19<00:13, 609.17it/s]
4-echo monoexponential:  60%|█████▉    | 12069/20176 [00:19<00:13, 612.74it/s]
4-echo monoexponential:  60%|██████    | 12135/20176 [00:19<00:12, 622.43it/s]
4-echo monoexponential:  60%|██████    | 12198/20176 [00:19<00:12, 623.78it/s]
4-echo monoexponential:  61%|██████    | 12264/20176 [00:19<00:12, 633.22it/s]
4-echo monoexponential:  61%|██████    | 12330/20176 [00:19<00:12, 640.06it/s]
4-echo monoexponential:  61%|██████▏   | 12395/20176 [00:20<00:12, 639.91it/s]
4-echo monoexponential:  62%|██████▏   | 12460/20176 [00:20<00:12, 640.33it/s]
4-echo monoexponential:  62%|██████▏   | 12525/20176 [00:20<00:12, 633.12it/s]
4-echo monoexponential:  62%|██████▏   | 12589/20176 [00:20<00:12, 594.88it/s]
4-echo monoexponential:  63%|██████▎   | 12653/20176 [00:20<00:12, 605.36it/s]
4-echo monoexponential:  63%|██████▎   | 12717/20176 [00:20<00:12, 615.14it/s]
4-echo monoexponential:  63%|██████▎   | 12782/20176 [00:20<00:11, 623.33it/s]
4-echo monoexponential:  64%|██████▎   | 12848/20176 [00:20<00:11, 632.12it/s]
4-echo monoexponential:  64%|██████▍   | 12915/20176 [00:20<00:11, 641.33it/s]
4-echo monoexponential:  64%|██████▍   | 12980/20176 [00:20<00:11, 638.55it/s]
4-echo monoexponential:  65%|██████▍   | 13046/20176 [00:21<00:11, 644.18it/s]
4-echo monoexponential:  65%|██████▍   | 13111/20176 [00:21<00:11, 642.14it/s]
4-echo monoexponential:  65%|██████▌   | 13176/20176 [00:21<00:11, 635.74it/s]
4-echo monoexponential:  66%|██████▌   | 13240/20176 [00:21<00:10, 636.42it/s]
4-echo monoexponential:  66%|██████▌   | 13304/20176 [00:21<00:10, 627.96it/s]
4-echo monoexponential:  66%|██████▋   | 13367/20176 [00:21<00:11, 600.50it/s]
4-echo monoexponential:  67%|██████▋   | 13431/20176 [00:21<00:11, 611.80it/s]
4-echo monoexponential:  67%|██████▋   | 13493/20176 [00:21<00:11, 603.91it/s]
4-echo monoexponential:  67%|██████▋   | 13554/20176 [00:21<00:10, 605.12it/s]
4-echo monoexponential:  68%|██████▊   | 13619/20176 [00:22<00:10, 616.46it/s]
4-echo monoexponential:  68%|██████▊   | 13685/20176 [00:22<00:10, 627.29it/s]
4-echo monoexponential:  68%|██████▊   | 13751/20176 [00:22<00:10, 634.60it/s]
4-echo monoexponential:  68%|██████▊   | 13815/20176 [00:22<00:10, 625.85it/s]
4-echo monoexponential:  69%|██████▉   | 13880/20176 [00:22<00:09, 631.51it/s]
4-echo monoexponential:  69%|██████▉   | 13944/20176 [00:22<00:09, 631.86it/s]
4-echo monoexponential:  69%|██████▉   | 14009/20176 [00:22<00:09, 636.01it/s]
4-echo monoexponential:  70%|██████▉   | 14073/20176 [00:22<00:09, 630.99it/s]
4-echo monoexponential:  70%|███████   | 14137/20176 [00:22<00:09, 606.96it/s]
4-echo monoexponential:  70%|███████   | 14198/20176 [00:22<00:09, 605.50it/s]
4-echo monoexponential:  71%|███████   | 14259/20176 [00:23<00:09, 606.64it/s]
4-echo monoexponential:  71%|███████   | 14323/20176 [00:23<00:09, 616.39it/s]
4-echo monoexponential:  71%|███████▏  | 14388/20176 [00:23<00:09, 624.27it/s]
4-echo monoexponential:  72%|███████▏  | 14451/20176 [00:23<00:09, 618.47it/s]
4-echo monoexponential:  72%|███████▏  | 14516/20176 [00:23<00:09, 627.65it/s]
4-echo monoexponential:  72%|███████▏  | 14582/20176 [00:23<00:08, 635.37it/s]
4-echo monoexponential:  73%|███████▎  | 14646/20176 [00:23<00:08, 636.59it/s]
4-echo monoexponential:  73%|███████▎  | 14710/20176 [00:23<00:08, 623.02it/s]
4-echo monoexponential:  73%|███████▎  | 14773/20176 [00:23<00:08, 623.46it/s]
4-echo monoexponential:  74%|███████▎  | 14836/20176 [00:23<00:08, 619.54it/s]
4-echo monoexponential:  74%|███████▍  | 14898/20176 [00:24<00:08, 603.30it/s]
4-echo monoexponential:  74%|███████▍  | 14959/20176 [00:24<00:08, 603.38it/s]
4-echo monoexponential:  74%|███████▍  | 15025/20176 [00:24<00:08, 617.40it/s]
4-echo monoexponential:  75%|███████▍  | 15087/20176 [00:24<00:08, 616.52it/s]
4-echo monoexponential:  75%|███████▌  | 15153/20176 [00:24<00:07, 629.07it/s]
4-echo monoexponential:  75%|███████▌  | 15216/20176 [00:24<00:07, 625.57it/s]
4-echo monoexponential:  76%|███████▌  | 15281/20176 [00:24<00:07, 631.44it/s]
4-echo monoexponential:  76%|███████▌  | 15346/20176 [00:24<00:07, 636.70it/s]
4-echo monoexponential:  76%|███████▋  | 15410/20176 [00:24<00:07, 636.28it/s]
4-echo monoexponential:  77%|███████▋  | 15474/20176 [00:24<00:07, 635.53it/s]
4-echo monoexponential:  77%|███████▋  | 15538/20176 [00:25<00:07, 633.95it/s]
4-echo monoexponential:  77%|███████▋  | 15602/20176 [00:25<00:07, 607.65it/s]
4-echo monoexponential:  78%|███████▊  | 15666/20176 [00:25<00:07, 615.02it/s]
4-echo monoexponential:  78%|███████▊  | 15730/20176 [00:25<00:07, 620.80it/s]
4-echo monoexponential:  78%|███████▊  | 15793/20176 [00:25<00:07, 603.61it/s]
4-echo monoexponential:  79%|███████▊  | 15854/20176 [00:25<00:07, 604.06it/s]
4-echo monoexponential:  79%|███████▉  | 15920/20176 [00:25<00:06, 619.05it/s]
4-echo monoexponential:  79%|███████▉  | 15985/20176 [00:25<00:06, 627.00it/s]
4-echo monoexponential:  80%|███████▉  | 16051/20176 [00:25<00:06, 636.48it/s]
4-echo monoexponential:  80%|███████▉  | 16116/20176 [00:26<00:06, 638.86it/s]
4-echo monoexponential:  80%|████████  | 16180/20176 [00:26<00:06, 630.82it/s]
4-echo monoexponential:  81%|████████  | 16244/20176 [00:26<00:06, 632.20it/s]
4-echo monoexponential:  81%|████████  | 16308/20176 [00:26<00:06, 611.97it/s]
4-echo monoexponential:  81%|████████  | 16370/20176 [00:26<00:06, 599.48it/s]
4-echo monoexponential:  81%|████████▏ | 16431/20176 [00:26<00:06, 597.68it/s]
4-echo monoexponential:  82%|████████▏ | 16491/20176 [00:26<00:06, 595.30it/s]
4-echo monoexponential:  82%|████████▏ | 16553/20176 [00:26<00:06, 600.29it/s]
4-echo monoexponential:  82%|████████▏ | 16618/20176 [00:26<00:05, 612.51it/s]
4-echo monoexponential:  83%|████████▎ | 16682/20176 [00:26<00:05, 619.63it/s]
4-echo monoexponential:  83%|████████▎ | 16750/20176 [00:27<00:05, 636.94it/s]
4-echo monoexponential:  83%|████████▎ | 16814/20176 [00:27<00:05, 634.60it/s]
4-echo monoexponential:  84%|████████▎ | 16878/20176 [00:27<00:05, 629.59it/s]
4-echo monoexponential:  84%|████████▍ | 16941/20176 [00:27<00:05, 626.80it/s]
4-echo monoexponential:  84%|████████▍ | 17004/20176 [00:27<00:05, 602.66it/s]
4-echo monoexponential:  85%|████████▍ | 17065/20176 [00:27<00:05, 598.94it/s]
4-echo monoexponential:  85%|████████▍ | 17127/20176 [00:27<00:05, 604.76it/s]
4-echo monoexponential:  85%|████████▌ | 17188/20176 [00:27<00:05, 595.11it/s]
4-echo monoexponential:  86%|████████▌ | 17251/20176 [00:27<00:04, 600.96it/s]
4-echo monoexponential:  86%|████████▌ | 17313/20176 [00:27<00:04, 604.26it/s]
4-echo monoexponential:  86%|████████▌ | 17379/20176 [00:28<00:04, 618.46it/s]
4-echo monoexponential:  86%|████████▋ | 17443/20176 [00:28<00:04, 622.90it/s]
4-echo monoexponential:  87%|████████▋ | 17506/20176 [00:28<00:04, 619.24it/s]
4-echo monoexponential:  87%|████████▋ | 17569/20176 [00:28<00:04, 621.87it/s]
4-echo monoexponential:  87%|████████▋ | 17632/20176 [00:28<00:04, 603.85it/s]
4-echo monoexponential:  88%|████████▊ | 17693/20176 [00:28<00:04, 589.21it/s]
4-echo monoexponential:  88%|████████▊ | 17754/20176 [00:28<00:04, 593.72it/s]
4-echo monoexponential:  88%|████████▊ | 17815/20176 [00:28<00:03, 598.38it/s]
4-echo monoexponential:  89%|████████▊ | 17877/20176 [00:28<00:03, 601.78it/s]
4-echo monoexponential:  89%|████████▉ | 17942/20176 [00:29<00:03, 614.88it/s]
4-echo monoexponential:  89%|████████▉ | 18009/20176 [00:29<00:03, 629.22it/s]
4-echo monoexponential:  90%|████████▉ | 18074/20176 [00:29<00:03, 633.09it/s]
4-echo monoexponential:  90%|████████▉ | 18138/20176 [00:29<00:03, 629.14it/s]
4-echo monoexponential:  90%|█████████ | 18201/20176 [00:29<00:03, 615.07it/s]
4-echo monoexponential:  91%|█████████ | 18263/20176 [00:29<00:03, 591.71it/s]
4-echo monoexponential:  91%|█████████ | 18323/20176 [00:29<00:03, 590.95it/s]
4-echo monoexponential:  91%|█████████ | 18383/20176 [00:29<00:03, 583.46it/s]
4-echo monoexponential:  91%|█████████▏| 18444/20176 [00:29<00:02, 589.30it/s]
4-echo monoexponential:  92%|█████████▏| 18507/20176 [00:29<00:02, 599.64it/s]
4-echo monoexponential:  92%|█████████▏| 18569/20176 [00:30<00:02, 604.92it/s]
4-echo monoexponential:  92%|█████████▏| 18633/20176 [00:30<00:02, 615.23it/s]
4-echo monoexponential:  93%|█████████▎| 18695/20176 [00:30<00:02, 605.40it/s]
4-echo monoexponential:  93%|█████████▎| 18756/20176 [00:30<00:02, 589.50it/s]
4-echo monoexponential:  93%|█████████▎| 18817/20176 [00:30<00:02, 594.71it/s]
4-echo monoexponential:  94%|█████████▎| 18877/20176 [00:30<00:02, 589.31it/s]
4-echo monoexponential:  94%|█████████▍| 18940/20176 [00:30<00:02, 598.22it/s]
4-echo monoexponential:  94%|█████████▍| 19006/20176 [00:30<00:01, 614.71it/s]
4-echo monoexponential:  95%|█████████▍| 19073/20176 [00:30<00:01, 628.94it/s]
4-echo monoexponential:  95%|█████████▍| 19137/20176 [00:30<00:01, 629.98it/s]
4-echo monoexponential:  95%|█████████▌| 19201/20176 [00:31<00:01, 601.04it/s]
4-echo monoexponential:  95%|█████████▌| 19262/20176 [00:31<00:01, 596.09it/s]
4-echo monoexponential:  96%|█████████▌| 19322/20176 [00:31<00:01, 590.13it/s]
4-echo monoexponential:  96%|█████████▌| 19382/20176 [00:31<00:01, 579.75it/s]
4-echo monoexponential:  96%|█████████▋| 19443/20176 [00:31<00:01, 586.76it/s]
4-echo monoexponential:  97%|█████████▋| 19507/20176 [00:31<00:01, 602.13it/s]
4-echo monoexponential:  97%|█████████▋| 19568/20176 [00:31<00:01, 594.33it/s]
4-echo monoexponential:  97%|█████████▋| 19630/20176 [00:31<00:00, 599.46it/s]
4-echo monoexponential:  98%|█████████▊| 19692/20176 [00:31<00:00, 604.20it/s]
4-echo monoexponential:  98%|█████████▊| 19760/20176 [00:32<00:00, 625.66it/s]
4-echo monoexponential:  98%|█████████▊| 19823/20176 [00:32<00:00, 621.81it/s]
4-echo monoexponential:  99%|█████████▊| 19886/20176 [00:32<00:00, 603.38it/s]
4-echo monoexponential:  99%|█████████▉| 19947/20176 [00:32<00:00, 597.82it/s]
4-echo monoexponential:  99%|█████████▉| 20007/20176 [00:32<00:00, 591.85it/s]
4-echo monoexponential:  99%|█████████▉| 20067/20176 [00:32<00:00, 592.75it/s]
4-echo monoexponential: 100%|█████████▉| 20127/20176 [00:32<00:00, 588.33it/s]
4-echo monoexponential: 100%|██████████| 20176/20176 [00:32<00:00, 616.49it/s]

/opt/hostedtoolcache/Python/3.10.17/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:807 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.17/x64/lib/python3.10/site-packages/tedana/io.py:893: 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.17/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:407 Selected 43 components with 75.69% normalized variance explained using mdl dimensionality estimate
/opt/hostedtoolcache/Python/3.10.17/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 97 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.17/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:879 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. 3 True -> rejected. 40 False -> nochange.
INFO     selection_utils:log_classification_counts:492 Step 1: Total component classifications: 3 rejected, 40 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. 3 True -> rejected. 40 False -> nochange.
INFO     selection_utils:log_classification_counts:492 Step 2: Total component classifications: 5 rejected, 38 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.5747054016673987
INFO     selection_utils:log_classification_counts:492 Step 3: Total component classifications: 5 rejected, 38 unclassified
INFO     selection_nodes:dec_left_op_right:389 Step 4: left_op_right: rejected if ['dice_FS0>dice_FT2 & variance explained>0.57'], else nochange
INFO     selection_utils:log_decision_tree_step:447 Step 4: left_op_right applied to 43 components. 2 True -> rejected. 41 False -> nochange.
INFO     selection_utils:log_classification_counts:492 Step 4: Total component classifications: 5 rejected, 38 unclassified
INFO     selection_nodes:dec_left_op_right:389 Step 5: left_op_right: rejected if ['0>signal-noise_t & variance explained>0.57'], else nochange
INFO     selection_utils:log_decision_tree_step:447 Step 5: left_op_right applied to 43 components. 6 True -> rejected. 37 False -> nochange.
INFO     selection_utils:log_classification_counts:492 Step 5: Total component classifications: 9 rejected, 34 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=23.02857731651016, kappa_allcomps_elbow=31.8194972371194, kappa_nonsig_elbow=23.02857731651016, varex_upper_p=1.648335840512714
INFO     selection_utils:log_classification_counts:492 Step 6: Total component classifications: 9 rejected, 34 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 34 components. 3 True -> unclass_highvar. 31 False -> nochange.
INFO     selection_utils:log_classification_counts:492 Step 7: Total component classifications: 9 rejected, 3 unclass_highvar, 31 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=17.080317435186576, rho_allcomps_elbow=21.351969895060595, rho_unclassified_elbow=19.761017924485195, elbow_f05=10.127964486013928
INFO     selection_utils:log_classification_counts:492 Step 8: Total component classifications: 9 rejected, 3 unclass_highvar, 31 unclassified
INFO     selection_nodes:dec_left_op_right:389 Step 9: left_op_right: provisionalaccept if kappa>=23.03, else nochange
INFO     selection_utils:log_decision_tree_step:447 Step 9: left_op_right applied to 31 components. 19 True -> provisionalaccept. 12 False -> nochange.
INFO     selection_utils:log_classification_counts:492 Step 9: Total component classifications: 19 provisionalaccept, 9 rejected, 3 unclass_highvar, 12 unclassified
INFO     selection_nodes:dec_left_op_right:389 Step 10: left_op_right: unclassified if rho>17.08, else nochange
INFO     selection_utils:log_decision_tree_step:447 Step 10: left_op_right applied to 19 components. 15 True -> unclassified. 4 False -> nochange.
INFO     selection_utils:log_classification_counts:492 Step 10: Total component classifications: 4 provisionalaccept, 9 rejected, 3 unclass_highvar, 27 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 34 components. None True -> 0. None False -> 34.
INFO     selection_utils:log_classification_counts:492 Step 11: Total component classifications: 4 provisionalaccept, 9 rejected, 3 unclass_highvar, 27 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.4342847303734003, upper_perc=90
INFO     selection_utils:log_classification_counts:492 Step 12: Total component classifications: 4 provisionalaccept, 9 rejected, 3 unclass_highvar, 27 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.8014360629338839, lower_perc=25
INFO     selection_utils:log_classification_counts:492 Step 13: Total component classifications: 4 provisionalaccept, 9 rejected, 3 unclass_highvar, 27 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: 4 provisionalaccept, 9 rejected, 3 unclass_highvar, 27 unclassified
INFO     selection_utils:log_decision_tree_step:459 Step 15: calc_max_good_meanmetricrank calculated: max_good_meanmetricrank=8.0
INFO     selection_utils:log_classification_counts:492 Step 15: Total component classifications: 4 provisionalaccept, 9 rejected, 3 unclass_highvar, 27 unclassified
INFO     selection_utils:log_decision_tree_step:459 Step 16: calc_varex_kappa_ratio calculated: kappa_rate=16.78937289879752
INFO     selection_utils:log_classification_counts:492 Step 16: Total component classifications: 4 provisionalaccept, 9 rejected, 3 unclass_highvar, 27 unclassified
INFO     selection_nodes:dec_left_op_right:389 Step 17: left_op_right: rejected if ['d_table_score>8.0 & variance explained>2.0*1.43'], 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 34 components. 0 True -> rejected. 34 False -> nochange.
INFO     selection_utils:log_classification_counts:492 Step 17: Total component classifications: 4 provisionalaccept, 9 rejected, 3 unclass_highvar, 27 unclassified
INFO     selection_nodes:dec_left_op_right:389 Step 18: left_op_right: accepted if ['d_table_score>8.0 & variance explained<=0.8 & kappa<=23.03'], 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 34 components. 13 True -> accepted. 21 False -> nochange.
INFO     selection_utils:log_classification_counts:492 Step 18: Total component classifications: 13 accepted, 4 provisionalaccept, 9 rejected, 3 unclass_highvar, 14 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 21 components. None True -> 0. None False -> 21.
INFO     selection_utils:log_classification_counts:492 Step 19: Total component classifications: 13 accepted, 4 provisionalaccept, 9 rejected, 3 unclass_highvar, 14 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=12, conservative_guess=6.0, restrict_factor=2
INFO     selection_utils:log_classification_counts:492 Step 20: Total component classifications: 13 accepted, 4 provisionalaccept, 9 rejected, 3 unclass_highvar, 14 unclassified
INFO     selection_nodes:dec_left_op_right:389 Step 21: left_op_right: rejected if ['d_table_score_node20>6.0 & varex kappa ratio>2*2.0 & variance explained>2.0*1.43'], 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:comptable_classification_changer:293 Step 21: No components fit criterion True to change classification
INFO     selection_utils:log_decision_tree_step:447 Step 21: left_op_right applied to 21 components. 0 True -> rejected. 21 False -> nochange.
INFO     selection_utils:log_classification_counts:492 Step 21: Total component classifications: 13 accepted, 4 provisionalaccept, 9 rejected, 3 unclass_highvar, 14 unclassified
INFO     selection_nodes:dec_left_op_right:389 Step 22: left_op_right: rejected if ['d_table_score_node20>0.9*12 & variance explained>2.0*0.8'], 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:comptable_classification_changer:293 Step 22: No components fit criterion True to change classification
INFO     selection_utils:log_decision_tree_step:447 Step 22: left_op_right applied to 21 components. 0 True -> rejected. 21 False -> nochange.
INFO     selection_utils:log_classification_counts:492 Step 22: Total component classifications: 13 accepted, 4 provisionalaccept, 9 rejected, 3 unclass_highvar, 14 unclassified
INFO     selection_nodes:calc_varex_thresh:1328 Step 23: calc_varex_thresh: Calc varex_new_lower_thresh, 25th percentile threshold
INFO     selection_utils:log_decision_tree_step:459 Step 23: calc_varex_thresh calculated: varex_new_lower_thresh=0.9324182511863153, new_lower_perc=25
INFO     selection_utils:log_classification_counts:492 Step 23: Total component classifications: 13 accepted, 4 provisionalaccept, 9 rejected, 3 unclass_highvar, 14 unclassified
INFO     selection_nodes:dec_left_op_right:389 Step 24: left_op_right: accepted if ['d_table_score_node20>12 & variance explained>0.93'], 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 21 components. 1 True -> accepted. 20 False -> nochange.
INFO     selection_utils:log_classification_counts:492 Step 24: Total component classifications: 14 accepted, 4 provisionalaccept, 9 rejected, 3 unclass_highvar, 13 unclassified
INFO     selection_nodes:dec_left_op_right:389 Step 25: left_op_right: accepted if ['kappa<=23.03 & variance explained>0.93'], 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 20 components. 0 True -> accepted. 20 False -> nochange.
INFO     selection_utils:log_classification_counts:492 Step 25: Total component classifications: 14 accepted, 4 provisionalaccept, 9 rejected, 3 unclass_highvar, 13 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 20 components. 20 True -> accepted. 0 False -> nochange.
INFO     selection_utils:log_classification_counts:492 Step 26: Total component classifications: 34 accepted, 9 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:207 Performing minimum image regression to remove spatially-diffuse noise
WARNING  gscontrol:minimum_image_regression:219 Decision tree does not contain classification tags indicating low variance components (low variance, accept borderline).
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:1101 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.17/x64/lib/python3.10/site-packages/tedana/io.py:893: 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.17/x64/lib/python3.10/site-packages/tedana/io.py:893: 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.17/x64/lib/python3.10/site-packages/tedana/io.py:893: 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.17/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:1139 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:197 T2* files exist: True
INFO     html_report:_update_template_bokeh:198 S0 files exist: True
INFO     html_report:_update_template_bokeh:199 RMSE files exist: True
INFO     tedana:tedana_workflow:1142 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-05-06T002412.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 22.146228 24.116454 0.775255 0.012156 1216 941 0.158952 0.224756 1168 -6.424964 0.000000 29.200000 -1 0.587732 nan nan rejected Unlikely BOLD
1 ICA_01 51.230575 24.753611 23.506897 0.248546 5353 2484 0.513640 0.191117 965 0.000000 0.000000 5.800000 -1 7.703721 4.000000 16.016520 accepted Likely BOLD
2 ICA_02 22.893331 14.901836 0.357921 0.005175 1145 422 0.292726 0.000000 1144 6.592229 0.000000 19.400000 -1 0.262490 nan 10.316781 accepted Low variance
3 ICA_03 44.193614 19.191723 1.333745 0.017837 4209 1879 0.483883 0.270373 1179 0.000000 0.000000 10.200000 -1 0.506696 7.000000 2.511483 accepted Likely BOLD
4 ICA_04 27.567406 20.737956 0.821346 0.011342 1796 1399 0.346452 0.308638 1165 1.168751 0.251138 14.700000 -1 0.500225 11.600000 8.002623 accepted Likely BOLD
5 ICA_05 44.379684 15.646069 0.934832 0.012529 2517 592 0.454771 0.103478 1056 6.697817 0.000000 4.800000 1 0.353658 4.200000 9.192120 accepted Likely BOLD
6 ICA_06 30.018327 23.605399 1.568946 0.018061 2068 1258 0.329256 0.241267 1218 0.000000 0.000000 18.000000 1 0.877518 13.000000 40.951937 accepted Accept borderline
7 ICA_07 22.990509 14.921279 0.419216 0.006445 967 365 0.238532 0.000000 1223 0.000000 0.000000 28.900000 -1 0.306142 nan 6.227725 accepted Low variance
8 ICA_08 21.753897 14.043088 0.276220 0.004194 1029 276 0.315582 0.000000 1099 8.598623 0.000000 17.800000 -1 0.213183 nan 3.232917 accepted Low variance
9 ICA_09 31.741634 18.654378 0.739212 0.008564 1903 723 0.328529 0.187891 1225 3.541223 0.001735 16.800000 1 0.390998 12.200000 24.554134 accepted Likely BOLD
10 ICA_10 27.289797 23.521625 1.200922 0.015285 1342 895 0.273556 0.270520 1178 -9.156475 0.000000 25.200000 1 0.738838 nan nan rejected Unlikely BOLD
11 ICA_11 33.098399 21.068734 0.421799 0.005226 1881 515 0.433748 0.237955 1196 2.047632 0.044022 12.200000 -1 0.213960 9.000000 4.040531 accepted Likely BOLD
12 ICA_12 28.180872 24.242923 0.837907 0.010496 1307 961 0.261074 0.229680 1205 7.085985 0.000001 19.000000 -1 0.499202 13.000000 24.966597 accepted Likely BOLD
13 ICA_13 26.217677 28.703490 1.042861 0.015046 2138 2476 0.304978 0.356087 1147 -6.288982 0.000000 20.600000 -1 0.667831 nan nan rejected Unlikely BOLD
14 ICA_14 21.048686 18.999745 0.321634 0.004681 903 542 0.245929 0.289668 1272 0.000000 0.000000 33.400000 1 0.256550 nan 5.366744 accepted Low variance
15 ICA_15 19.460252 15.964998 0.325640 0.004480 477 277 0.192593 0.288809 1228 0.000000 0.000000 34.400000 1 0.280947 nan 12.427411 accepted Low variance
16 ICA_16 18.899450 16.000196 0.230781 0.003543 406 426 0.244275 0.163772 1225 0.000000 0.000000 34.000000 1 0.205015 nan nan rejected Unlikely BOLD
17 ICA_17 26.319786 24.731221 0.437352 0.005085 1090 651 0.404684 0.374608 1229 -5.740283 0.000002 26.900000 1 0.278987 17.000000 4.294990 accepted Likely BOLD
18 ICA_18 29.325502 20.396341 1.186225 0.014014 1460 924 0.233885 0.160920 1229 -1.924252 0.065655 27.500000 -1 0.679135 nan nan rejected Unlikely BOLD
19 ICA_19 17.374136 13.313379 0.269176 0.003986 326 72 0.000000 0.000000 1223 -1.758980 0.086436 37.700000 1 0.260116 nan 15.405991 accepted Low variance
20 ICA_20 28.948899 26.340361 0.925177 0.012726 2207 1902 0.369525 0.277733 1208 1.969493 0.060622 14.800000 1 0.536571 11.200000 21.046319 accepted Likely BOLD
21 ICA_21 50.518207 23.817301 35.792080 0.259929 5123 2946 0.486619 0.194260 947 0.000000 0.000000 6.400000 1 11.895248 4.600000 10.133716 accepted Likely BOLD
22 ICA_22 26.138694 17.736148 0.369724 0.004821 1180 361 0.455685 0.085349 1203 5.950242 0.000000 15.900000 1 0.237481 11.200000 14.440551 accepted Likely BOLD
23 ICA_23 36.218894 19.761018 1.818097 0.016928 2752 662 0.442593 0.126984 1210 2.400991 0.019381 11.400000 1 0.842784 8.000000 6.784044 accepted Likely BOLD
24 ICA_24 18.628510 17.525927 0.256949 0.003607 422 460 0.235443 0.238739 1225 0.000000 0.000000 34.400000 1 0.231581 nan nan rejected Unlikely BOLD
25 ICA_25 25.320432 16.376623 0.897535 0.012538 1447 437 0.329221 0.061393 1219 0.000000 0.000000 23.000000 -1 0.595134 16.800000 5.451428 accepted Likely BOLD
26 ICA_26 26.152276 19.268627 0.687006 0.009539 1522 1337 0.373057 0.313010 1192 -3.831767 0.000568 21.600000 -1 0.441047 nan nan rejected Unlikely BOLD
27 ICA_27 20.653733 18.187818 0.437837 0.006150 1374 1172 0.443958 0.307824 1238 0.000000 0.000000 25.800000 -1 0.355916 nan 12.619104 accepted Low variance
28 ICA_28 21.332113 14.852464 0.251351 0.003734 868 328 0.320700 0.000000 1209 3.143230 0.004219 24.400000 -1 0.197825 nan 6.235915 accepted Low variance
29 ICA_29 21.335666 17.724435 0.400618 0.005437 758 416 0.144120 0.000000 1236 0.000000 0.000000 33.600000 -1 0.315252 nan 3.122712 accepted Low variance
30 ICA_30 29.031634 18.450691 0.574705 0.008088 1671 874 0.292073 0.107551 1259 4.074479 0.000304 21.700000 -1 0.332360 14.300000 15.850655 accepted Likely BOLD
31 ICA_31 31.819497 24.529542 0.781948 0.009984 1973 1168 0.384201 0.220774 1169 4.803848 0.000016 10.800000 -1 0.412590 8.200000 15.219292 accepted Likely BOLD
32 ICA_32 25.588172 16.080564 0.513138 0.007719 1718 617 0.301669 0.113729 1259 0.000000 0.000000 25.900000 -1 0.336690 17.300000 22.875354 accepted Likely BOLD
33 ICA_33 36.717310 15.796473 1.648336 0.022094 4794 2828 0.518028 0.294260 1120 8.112906 0.000000 3.400000 1 0.753719 2.800000 14.110766 accepted Likely BOLD
34 ICA_34 20.727932 17.020308 0.302689 0.004039 740 416 0.366599 0.211706 1222 0.000000 0.000000 28.400000 -1 0.245175 nan 4.093091 accepted Low variance
35 ICA_35 23.028577 19.611960 0.542973 0.007931 1341 833 0.297052 0.133498 1165 -3.583948 0.000700 24.300000 -1 0.395863 nan 5.272240 accepted Low variance
36 ICA_36 26.886630 17.629377 0.438053 0.006157 1621 571 0.376559 0.137255 1200 0.000000 0.000000 18.400000 1 0.273542 13.800000 8.395674 accepted Likely BOLD
37 ICA_37 62.834284 18.313377 13.202186 0.133574 5157 2061 0.541503 0.099068 1071 0.000000 0.000000 6.000000 -1 3.527635 4.000000 6.806975 accepted Likely BOLD
38 ICA_38 20.849615 19.672935 0.639069 0.007577 1223 1129 0.448980 0.307337 1039 -5.347541 0.000000 21.800000 1 0.514617 nan nan rejected Unlikely BOLD
39 ICA_39 35.859042 21.351970 1.443613 0.016344 3201 911 0.428389 0.175458 1233 0.000000 0.000000 16.800000 -1 0.675906 11.000000 6.914911 accepted Likely BOLD
40 ICA_40 21.287998 15.991776 0.393314 0.004478 933 251 0.451650 0.163673 1203 0.000000 0.000000 23.100000 -1 0.310198 nan 11.690362 accepted Low variance
41 ICA_41 19.355907 19.965188 0.436800 0.006226 514 361 0.128257 0.000000 1245 0.000000 0.000000 36.200000 -1 0.378882 nan nan rejected Unlikely BOLD
42 ICA_42 21.534814 12.658974 0.238916 0.003687 812 326 0.294856 0.000000 1247 7.820508 0.000000 27.000000 1 0.186268 nan 7.579854 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.17/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'