Optimal combination with t2smap

Optimal combination with t2smap#

Use t2smap [DuPre et al., 2021] to combine data.

import os
from glob import glob

import matplotlib.pyplot as plt
import numpy as np
from myst_nb import glue
from nilearn import image, plotting
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, "t2smap")
workflows.t2smap_workflow(
    data_files,
    echo_times,
    out_dir=out_dir,
    mask=mask_file,
    prefix="sub-04570_task-rest_space-scanner",
    fittype="curvefit",
)
INFO     t2smap:t2smap_workflow:290 Using output directory: /home/runner/work/multi-echo-data-analysis/multi-echo-data-analysis/data/multi-echo-data-analysis/t2smap
INFO     t2smap:t2smap_workflow:316 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     t2smap:t2smap_workflow:338 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     t2smap:t2smap_workflow:347 Computing adaptive T2* map
2-echo monoexponential:   0%|          | 0/2224 [00:00<?, ?it/s]
2-echo monoexponential:   3%|▎         | 63/2224 [00:00<00:03, 627.88it/s]
2-echo monoexponential:   6%|▋         | 144/2224 [00:00<00:02, 729.60it/s]
2-echo monoexponential:  10%|▉         | 222/2224 [00:00<00:02, 749.76it/s]
2-echo monoexponential:  14%|█▍        | 306/2224 [00:00<00:02, 783.39it/s]
2-echo monoexponential:  17%|█▋        | 387/2224 [00:00<00:02, 792.71it/s]
2-echo monoexponential:  21%|██        | 470/2224 [00:00<00:02, 802.66it/s]
2-echo monoexponential:  25%|██▍       | 552/2224 [00:00<00:02, 806.17it/s]
2-echo monoexponential:  28%|██▊       | 633/2224 [00:00<00:01, 803.34it/s]
2-echo monoexponential:  32%|███▏      | 714/2224 [00:00<00:01, 801.65it/s]
2-echo monoexponential:  36%|███▌      | 799/2224 [00:01<00:01, 813.99it/s]
2-echo monoexponential:  40%|███▉      | 881/2224 [00:01<00:01, 810.00it/s]
2-echo monoexponential:  43%|████▎     | 963/2224 [00:01<00:01, 805.13it/s]
2-echo monoexponential:  47%|████▋     | 1044/2224 [00:01<00:01, 806.06it/s]
2-echo monoexponential:  51%|█████     | 1126/2224 [00:01<00:01, 809.36it/s]
2-echo monoexponential:  54%|█████▍    | 1207/2224 [00:01<00:01, 801.98it/s]
2-echo monoexponential:  58%|█████▊    | 1288/2224 [00:01<00:01, 802.50it/s]
2-echo monoexponential:  62%|██████▏   | 1369/2224 [00:01<00:01, 630.24it/s]
2-echo monoexponential:  65%|██████▌   | 1447/2224 [00:01<00:01, 665.43it/s]
2-echo monoexponential:  69%|██████▊   | 1528/2224 [00:02<00:00, 700.16it/s]
2-echo monoexponential:  72%|███████▏  | 1603/2224 [00:02<00:00, 713.67it/s]
2-echo monoexponential:  76%|███████▌  | 1683/2224 [00:02<00:00, 737.67it/s]
2-echo monoexponential:  79%|███████▉  | 1760/2224 [00:02<00:00, 746.41it/s]
2-echo monoexponential:  83%|████████▎ | 1840/2224 [00:02<00:00, 759.80it/s]
2-echo monoexponential:  86%|████████▋ | 1923/2224 [00:02<00:00, 778.40it/s]
2-echo monoexponential:  90%|█████████ | 2006/2224 [00:02<00:00, 793.34it/s]
2-echo monoexponential:  94%|█████████▍| 2086/2224 [00:02<00:00, 794.55it/s]
2-echo monoexponential:  97%|█████████▋| 2166/2224 [00:02<00:00, 779.67it/s]
2-echo monoexponential: 100%|██████████| 2224/2224 [00:02<00:00, 767.52it/s]

3-echo monoexponential:   0%|          | 0/1092 [00:00<?, ?it/s]
3-echo monoexponential:   5%|▍         | 50/1092 [00:00<00:02, 499.37it/s]
3-echo monoexponential:   9%|▉         | 103/1092 [00:00<00:01, 512.11it/s]
3-echo monoexponential:  14%|█▍        | 157/1092 [00:00<00:01, 522.98it/s]
3-echo monoexponential:  19%|█▉        | 211/1092 [00:00<00:01, 528.25it/s]
3-echo monoexponential:  24%|██▍       | 264/1092 [00:00<00:01, 528.22it/s]
3-echo monoexponential:  29%|██▉       | 317/1092 [00:00<00:01, 523.40it/s]
3-echo monoexponential:  34%|███▍      | 370/1092 [00:00<00:01, 516.71it/s]
3-echo monoexponential:  39%|███▊      | 422/1092 [00:00<00:01, 516.29it/s]
3-echo monoexponential:  44%|████▎     | 477/1092 [00:00<00:01, 525.16it/s]
3-echo monoexponential:  49%|████▊     | 530/1092 [00:01<00:01, 523.59it/s]
3-echo monoexponential:  53%|█████▎    | 583/1092 [00:01<00:00, 517.43it/s]
3-echo monoexponential:  58%|█████▊    | 636/1092 [00:01<00:00, 518.65it/s]
3-echo monoexponential:  63%|██████▎   | 688/1092 [00:01<00:00, 507.87it/s]
3-echo monoexponential:  68%|██████▊   | 739/1092 [00:01<00:00, 495.87it/s]
3-echo monoexponential:  72%|███████▏  | 789/1092 [00:01<00:00, 479.54it/s]
3-echo monoexponential:  77%|███████▋  | 838/1092 [00:01<00:00, 478.44it/s]
3-echo monoexponential:  81%|████████▏ | 888/1092 [00:01<00:00, 482.65it/s]
3-echo monoexponential:  86%|████████▋ | 943/1092 [00:01<00:00, 500.35it/s]
3-echo monoexponential:  91%|█████████ | 995/1092 [00:01<00:00, 504.64it/s]
3-echo monoexponential:  96%|█████████▌| 1048/1092 [00:02<00:00, 510.59it/s]
3-echo monoexponential: 100%|██████████| 1092/1092 [00:02<00:00, 509.70it/s]

4-echo monoexponential:   0%|          | 0/20176 [00:00<?, ?it/s]
4-echo monoexponential:   0%|          | 52/20176 [00:00<00:38, 517.21it/s]
4-echo monoexponential:   1%|          | 104/20176 [00:00<00:41, 489.06it/s]
4-echo monoexponential:   1%|          | 163/20176 [00:00<00:37, 533.30it/s]
4-echo monoexponential:   1%|          | 225/20176 [00:00<00:35, 565.07it/s]
4-echo monoexponential:   1%|▏         | 283/20176 [00:00<00:35, 566.58it/s]
4-echo monoexponential:   2%|▏         | 345/20176 [00:00<00:33, 583.28it/s]
4-echo monoexponential:   2%|▏         | 407/20176 [00:00<00:33, 592.34it/s]
4-echo monoexponential:   2%|▏         | 467/20176 [00:00<00:33, 590.98it/s]
4-echo monoexponential:   3%|▎         | 529/20176 [00:00<00:32, 597.84it/s]
4-echo monoexponential:   3%|▎         | 589/20176 [00:01<00:32, 594.64it/s]
4-echo monoexponential:   3%|▎         | 649/20176 [00:01<00:33, 590.03it/s]
4-echo monoexponential:   4%|▎         | 709/20176 [00:01<00:33, 586.25it/s]
4-echo monoexponential:   4%|▍         | 770/20176 [00:01<00:32, 591.57it/s]
4-echo monoexponential:   4%|▍         | 830/20176 [00:01<00:32, 589.43it/s]
4-echo monoexponential:   4%|▍         | 892/20176 [00:01<00:32, 597.50it/s]
4-echo monoexponential:   5%|▍         | 953/20176 [00:01<00:32, 599.01it/s]
4-echo monoexponential:   5%|▌         | 1013/20176 [00:01<00:33, 570.64it/s]
4-echo monoexponential:   5%|▌         | 1072/20176 [00:01<00:33, 575.16it/s]
4-echo monoexponential:   6%|▌         | 1132/20176 [00:01<00:32, 580.58it/s]
4-echo monoexponential:   6%|▌         | 1192/20176 [00:02<00:32, 586.02it/s]
4-echo monoexponential:   6%|▌         | 1254/20176 [00:02<00:31, 591.68it/s]
4-echo monoexponential:   7%|▋         | 1318/20176 [00:02<00:31, 604.98it/s]
4-echo monoexponential:   7%|▋         | 1383/20176 [00:02<00:30, 615.98it/s]
4-echo monoexponential:   7%|▋         | 1445/20176 [00:02<00:31, 593.27it/s]
4-echo monoexponential:   7%|▋         | 1505/20176 [00:02<00:31, 586.87it/s]
4-echo monoexponential:   8%|▊         | 1567/20176 [00:02<00:31, 596.35it/s]
4-echo monoexponential:   8%|▊         | 1629/20176 [00:02<00:30, 602.77it/s]
4-echo monoexponential:   8%|▊         | 1693/20176 [00:02<00:30, 612.96it/s]
4-echo monoexponential:   9%|▊         | 1756/20176 [00:02<00:29, 617.49it/s]
4-echo monoexponential:   9%|▉         | 1818/20176 [00:03<00:29, 617.68it/s]
4-echo monoexponential:   9%|▉         | 1883/20176 [00:03<00:29, 624.00it/s]
4-echo monoexponential:  10%|▉         | 1946/20176 [00:03<00:29, 620.36it/s]
4-echo monoexponential:  10%|▉         | 2009/20176 [00:03<00:30, 592.70it/s]
4-echo monoexponential:  10%|█         | 2073/20176 [00:03<00:29, 603.44it/s]
4-echo monoexponential:  11%|█         | 2135/20176 [00:03<00:29, 606.21it/s]
4-echo monoexponential:  11%|█         | 2199/20176 [00:03<00:29, 616.04it/s]
4-echo monoexponential:  11%|█         | 2263/20176 [00:03<00:28, 622.17it/s]
4-echo monoexponential:  12%|█▏        | 2328/20176 [00:03<00:28, 627.75it/s]
4-echo monoexponential:  12%|█▏        | 2392/20176 [00:04<00:28, 630.15it/s]
4-echo monoexponential:  12%|█▏        | 2457/20176 [00:04<00:27, 634.44it/s]
4-echo monoexponential:  12%|█▏        | 2521/20176 [00:04<00:27, 632.70it/s]
4-echo monoexponential:  13%|█▎        | 2585/20176 [00:04<00:28, 608.00it/s]
4-echo monoexponential:  13%|█▎        | 2647/20176 [00:04<00:28, 607.79it/s]
4-echo monoexponential:  13%|█▎        | 2708/20176 [00:04<00:28, 606.15it/s]
4-echo monoexponential:  14%|█▎        | 2770/20176 [00:04<00:28, 607.97it/s]
4-echo monoexponential:  14%|█▍        | 2835/20176 [00:04<00:28, 618.14it/s]
4-echo monoexponential:  14%|█▍        | 2899/20176 [00:04<00:27, 624.44it/s]
4-echo monoexponential:  15%|█▍        | 2962/20176 [00:04<00:27, 625.18it/s]
4-echo monoexponential:  15%|█▌        | 3027/20176 [00:05<00:27, 630.19it/s]
4-echo monoexponential:  15%|█▌        | 3093/20176 [00:05<00:26, 636.44it/s]
4-echo monoexponential:  16%|█▌        | 3157/20176 [00:05<00:26, 636.90it/s]
4-echo monoexponential:  16%|█▌        | 3221/20176 [00:05<00:27, 616.67it/s]
4-echo monoexponential:  16%|█▋        | 3283/20176 [00:05<00:27, 616.68it/s]
4-echo monoexponential:  17%|█▋        | 3345/20176 [00:05<00:27, 612.89it/s]
4-echo monoexponential:  17%|█▋        | 3408/20176 [00:05<00:27, 615.97it/s]
4-echo monoexponential:  17%|█▋        | 3471/20176 [00:05<00:26, 619.41it/s]
4-echo monoexponential:  18%|█▊        | 3538/20176 [00:05<00:26, 631.90it/s]
4-echo monoexponential:  18%|█▊        | 3602/20176 [00:05<00:26, 633.59it/s]
4-echo monoexponential:  18%|█▊        | 3666/20176 [00:06<00:26, 629.43it/s]
4-echo monoexponential:  18%|█▊        | 3730/20176 [00:06<00:26, 631.94it/s]
4-echo monoexponential:  19%|█▉        | 3795/20176 [00:06<00:25, 634.99it/s]
4-echo monoexponential:  19%|█▉        | 3859/20176 [00:06<00:25, 628.72it/s]
4-echo monoexponential:  19%|█▉        | 3922/20176 [00:06<00:26, 617.30it/s]
4-echo monoexponential:  20%|█▉        | 3984/20176 [00:06<00:26, 607.04it/s]
4-echo monoexponential:  20%|██        | 4047/20176 [00:06<00:26, 612.63it/s]
4-echo monoexponential:  20%|██        | 4109/20176 [00:06<00:26, 597.45it/s]
4-echo monoexponential:  21%|██        | 4169/20176 [00:06<00:26, 596.96it/s]
4-echo monoexponential:  21%|██        | 4234/20176 [00:06<00:26, 610.28it/s]
4-echo monoexponential:  21%|██▏       | 4301/20176 [00:07<00:25, 625.11it/s]
4-echo monoexponential:  22%|██▏       | 4364/20176 [00:07<00:25, 620.84it/s]
4-echo monoexponential:  22%|██▏       | 4427/20176 [00:07<00:25, 622.55it/s]
4-echo monoexponential:  22%|██▏       | 4493/20176 [00:07<00:24, 631.79it/s]
4-echo monoexponential:  23%|██▎       | 4557/20176 [00:07<00:24, 632.01it/s]
4-echo monoexponential:  23%|██▎       | 4621/20176 [00:07<00:24, 625.37it/s]
4-echo monoexponential:  23%|██▎       | 4684/20176 [00:07<00:25, 605.57it/s]
4-echo monoexponential:  24%|██▎       | 4748/20176 [00:07<00:25, 615.29it/s]
4-echo monoexponential:  24%|██▍       | 4811/20176 [00:07<00:24, 616.95it/s]
4-echo monoexponential:  24%|██▍       | 4873/20176 [00:08<00:24, 614.01it/s]
4-echo monoexponential:  24%|██▍       | 4936/20176 [00:08<00:24, 616.86it/s]
4-echo monoexponential:  25%|██▍       | 5001/20176 [00:08<00:24, 625.17it/s]
4-echo monoexponential:  25%|██▌       | 5066/20176 [00:08<00:23, 632.43it/s]
4-echo monoexponential:  25%|██▌       | 5133/20176 [00:08<00:23, 642.65it/s]
4-echo monoexponential:  26%|██▌       | 5198/20176 [00:08<00:23, 642.24it/s]
4-echo monoexponential:  26%|██▌       | 5263/20176 [00:08<00:23, 644.00it/s]
4-echo monoexponential:  26%|██▋       | 5328/20176 [00:08<00:23, 641.62it/s]
4-echo monoexponential:  27%|██▋       | 5393/20176 [00:08<00:23, 632.47it/s]
4-echo monoexponential:  27%|██▋       | 5457/20176 [00:08<00:24, 612.38it/s]
4-echo monoexponential:  27%|██▋       | 5519/20176 [00:09<00:23, 611.07it/s]
4-echo monoexponential:  28%|██▊       | 5584/20176 [00:09<00:23, 620.43it/s]
4-echo monoexponential:  28%|██▊       | 5647/20176 [00:09<00:23, 613.83it/s]
4-echo monoexponential:  28%|██▊       | 5712/20176 [00:09<00:23, 623.97it/s]
4-echo monoexponential:  29%|██▊       | 5780/20176 [00:09<00:22, 637.47it/s]
4-echo monoexponential:  29%|██▉       | 5844/20176 [00:09<00:22, 631.68it/s]
4-echo monoexponential:  29%|██▉       | 5908/20176 [00:09<00:22, 625.40it/s]
4-echo monoexponential:  30%|██▉       | 5971/20176 [00:09<00:22, 626.15it/s]
4-echo monoexponential:  30%|██▉       | 6034/20176 [00:09<00:22, 620.45it/s]
4-echo monoexponential:  30%|███       | 6098/20176 [00:09<00:22, 623.38it/s]
4-echo monoexponential:  31%|███       | 6161/20176 [00:10<00:22, 622.58it/s]
4-echo monoexponential:  31%|███       | 6224/20176 [00:10<00:23, 596.00it/s]
4-echo monoexponential:  31%|███       | 6284/20176 [00:10<00:23, 596.97it/s]
4-echo monoexponential:  31%|███▏      | 6345/20176 [00:10<00:23, 592.73it/s]
4-echo monoexponential:  32%|███▏      | 6407/20176 [00:10<00:23, 598.38it/s]
4-echo monoexponential:  32%|███▏      | 6469/20176 [00:10<00:22, 603.98it/s]
4-echo monoexponential:  32%|███▏      | 6534/20176 [00:10<00:22, 617.49it/s]
4-echo monoexponential:  33%|███▎      | 6600/20176 [00:10<00:21, 628.24it/s]
4-echo monoexponential:  33%|███▎      | 6663/20176 [00:10<00:21, 626.63it/s]
4-echo monoexponential:  33%|███▎      | 6727/20176 [00:10<00:21, 628.01it/s]
4-echo monoexponential:  34%|███▎      | 6792/20176 [00:11<00:21, 634.46it/s]
4-echo monoexponential:  34%|███▍      | 6856/20176 [00:11<00:21, 630.04it/s]
4-echo monoexponential:  34%|███▍      | 6920/20176 [00:11<00:21, 624.28it/s]
4-echo monoexponential:  35%|███▍      | 6983/20176 [00:11<00:22, 596.06it/s]
4-echo monoexponential:  35%|███▍      | 7046/20176 [00:11<00:21, 603.87it/s]
4-echo monoexponential:  35%|███▌      | 7109/20176 [00:11<00:21, 609.69it/s]
4-echo monoexponential:  36%|███▌      | 7171/20176 [00:11<00:21, 612.26it/s]
4-echo monoexponential:  36%|███▌      | 7234/20176 [00:11<00:21, 614.43it/s]
4-echo monoexponential:  36%|███▌      | 7300/20176 [00:11<00:20, 626.31it/s]
4-echo monoexponential:  37%|███▋      | 7366/20176 [00:12<00:20, 633.38it/s]
4-echo monoexponential:  37%|███▋      | 7430/20176 [00:12<00:20, 631.90it/s]
4-echo monoexponential:  37%|███▋      | 7494/20176 [00:12<00:20, 623.65it/s]
4-echo monoexponential:  37%|███▋      | 7558/20176 [00:12<00:20, 627.47it/s]
4-echo monoexponential:  38%|███▊      | 7622/20176 [00:12<00:19, 628.87it/s]
4-echo monoexponential:  38%|███▊      | 7686/20176 [00:12<00:19, 630.22it/s]
4-echo monoexponential:  38%|███▊      | 7750/20176 [00:12<00:20, 607.13it/s]
4-echo monoexponential:  39%|███▊      | 7811/20176 [00:12<00:20, 599.88it/s]
4-echo monoexponential:  39%|███▉      | 7872/20176 [00:12<00:20, 595.08it/s]
4-echo monoexponential:  39%|███▉      | 7934/20176 [00:12<00:20, 602.01it/s]
4-echo monoexponential:  40%|███▉      | 7995/20176 [00:13<00:20, 599.43it/s]
4-echo monoexponential:  40%|███▉      | 8058/20176 [00:13<00:19, 608.00it/s]
4-echo monoexponential:  40%|████      | 8123/20176 [00:13<00:19, 619.60it/s]
4-echo monoexponential:  41%|████      | 8189/20176 [00:13<00:19, 630.39it/s]
4-echo monoexponential:  41%|████      | 8253/20176 [00:13<00:18, 631.38it/s]
4-echo monoexponential:  41%|████      | 8317/20176 [00:13<00:18, 633.81it/s]
4-echo monoexponential:  42%|████▏     | 8381/20176 [00:13<00:18, 628.70it/s]
4-echo monoexponential:  42%|████▏     | 8444/20176 [00:13<00:18, 625.22it/s]
4-echo monoexponential:  42%|████▏     | 8508/20176 [00:13<00:18, 628.81it/s]
4-echo monoexponential:  42%|████▏     | 8571/20176 [00:13<00:19, 608.18it/s]
4-echo monoexponential:  43%|████▎     | 8632/20176 [00:14<00:19, 600.81it/s]
4-echo monoexponential:  43%|████▎     | 8694/20176 [00:14<00:18, 604.98it/s]
4-echo monoexponential:  43%|████▎     | 8755/20176 [00:14<00:18, 601.33it/s]
4-echo monoexponential:  44%|████▎     | 8820/20176 [00:14<00:18, 613.71it/s]
4-echo monoexponential:  44%|████▍     | 8882/20176 [00:14<00:18, 612.21it/s]
4-echo monoexponential:  44%|████▍     | 8945/20176 [00:14<00:18, 614.78it/s]
4-echo monoexponential:  45%|████▍     | 9011/20176 [00:14<00:17, 625.56it/s]
4-echo monoexponential:  45%|████▍     | 9074/20176 [00:14<00:17, 623.20it/s]
4-echo monoexponential:  45%|████▌     | 9139/20176 [00:14<00:17, 629.86it/s]
4-echo monoexponential:  46%|████▌     | 9206/20176 [00:14<00:17, 639.22it/s]
4-echo monoexponential:  46%|████▌     | 9271/20176 [00:15<00:17, 639.88it/s]
4-echo monoexponential:  46%|████▋     | 9335/20176 [00:15<00:17, 636.91it/s]
4-echo monoexponential:  47%|████▋     | 9399/20176 [00:15<00:17, 620.55it/s]
4-echo monoexponential:  47%|████▋     | 9462/20176 [00:15<00:17, 615.05it/s]
4-echo monoexponential:  47%|████▋     | 9524/20176 [00:15<00:17, 605.62it/s]
4-echo monoexponential:  48%|████▊     | 9587/20176 [00:15<00:17, 611.14it/s]
4-echo monoexponential:  48%|████▊     | 9649/20176 [00:15<00:17, 609.41it/s]
4-echo monoexponential:  48%|████▊     | 9713/20176 [00:15<00:16, 616.52it/s]
4-echo monoexponential:  48%|████▊     | 9777/20176 [00:15<00:16, 620.85it/s]
4-echo monoexponential:  49%|████▉     | 9840/20176 [00:16<00:16, 616.73it/s]
4-echo monoexponential:  49%|████▉     | 9906/20176 [00:16<00:16, 627.22it/s]
4-echo monoexponential:  49%|████▉     | 9973/20176 [00:16<00:15, 639.72it/s]
4-echo monoexponential:  50%|████▉     | 10039/20176 [00:16<00:15, 644.28it/s]
4-echo monoexponential:  50%|█████     | 10104/20176 [00:16<00:15, 634.20it/s]
4-echo monoexponential:  50%|█████     | 10168/20176 [00:16<00:16, 623.29it/s]
4-echo monoexponential:  51%|█████     | 10231/20176 [00:16<00:16, 604.39it/s]
4-echo monoexponential:  51%|█████     | 10294/20176 [00:16<00:16, 610.59it/s]
4-echo monoexponential:  51%|█████▏    | 10356/20176 [00:16<00:16, 609.43it/s]
4-echo monoexponential:  52%|█████▏    | 10419/20176 [00:16<00:15, 611.34it/s]
4-echo monoexponential:  52%|█████▏    | 10485/20176 [00:17<00:15, 623.22it/s]
4-echo monoexponential:  52%|█████▏    | 10550/20176 [00:17<00:15, 629.50it/s]
4-echo monoexponential:  53%|█████▎    | 10614/20176 [00:17<00:15, 629.88it/s]
4-echo monoexponential:  53%|█████▎    | 10678/20176 [00:17<00:15, 622.10it/s]
4-echo monoexponential:  53%|█████▎    | 10743/20176 [00:17<00:14, 629.75it/s]
4-echo monoexponential:  54%|█████▎    | 10808/20176 [00:17<00:14, 634.29it/s]
4-echo monoexponential:  54%|█████▍    | 10872/20176 [00:17<00:14, 625.79it/s]
4-echo monoexponential:  54%|█████▍    | 10935/20176 [00:17<00:14, 626.33it/s]
4-echo monoexponential:  55%|█████▍    | 10998/20176 [00:17<00:15, 606.45it/s]
4-echo monoexponential:  55%|█████▍    | 11059/20176 [00:17<00:15, 598.54it/s]
4-echo monoexponential:  55%|█████▌    | 11119/20176 [00:18<00:15, 595.27it/s]
4-echo monoexponential:  55%|█████▌    | 11183/20176 [00:18<00:14, 607.02it/s]
4-echo monoexponential:  56%|█████▌    | 11253/20176 [00:18<00:14, 632.04it/s]
4-echo monoexponential:  56%|█████▌    | 11317/20176 [00:18<00:14, 626.54it/s]
4-echo monoexponential:  56%|█████▋    | 11382/20176 [00:18<00:13, 633.13it/s]
4-echo monoexponential:  57%|█████▋    | 11446/20176 [00:18<00:13, 631.60it/s]
4-echo monoexponential:  57%|█████▋    | 11510/20176 [00:18<00:13, 629.35it/s]
4-echo monoexponential:  57%|█████▋    | 11574/20176 [00:18<00:13, 632.08it/s]
4-echo monoexponential:  58%|█████▊    | 11639/20176 [00:18<00:13, 635.60it/s]
4-echo monoexponential:  58%|█████▊    | 11704/20176 [00:19<00:13, 637.43it/s]
4-echo monoexponential:  58%|█████▊    | 11768/20176 [00:19<00:14, 582.98it/s]
4-echo monoexponential:  59%|█████▊    | 11828/20176 [00:19<00:14, 581.62it/s]
4-echo monoexponential:  59%|█████▉    | 11890/20176 [00:19<00:14, 591.54it/s]
4-echo monoexponential:  59%|█████▉    | 11952/20176 [00:19<00:13, 599.65it/s]
4-echo monoexponential:  60%|█████▉    | 12016/20176 [00:19<00:13, 609.08it/s]
4-echo monoexponential:  60%|█████▉    | 12078/20176 [00:19<00:13, 607.45it/s]
4-echo monoexponential:  60%|██████    | 12143/20176 [00:19<00:12, 618.26it/s]
4-echo monoexponential:  61%|██████    | 12208/20176 [00:19<00:12, 625.95it/s]
4-echo monoexponential:  61%|██████    | 12275/20176 [00:19<00:12, 636.77it/s]
4-echo monoexponential:  61%|██████    | 12340/20176 [00:20<00:12, 640.22it/s]
4-echo monoexponential:  61%|██████▏   | 12405/20176 [00:20<00:12, 637.50it/s]
4-echo monoexponential:  62%|██████▏   | 12469/20176 [00:20<00:12, 624.34it/s]
4-echo monoexponential:  62%|██████▏   | 12532/20176 [00:20<00:12, 606.67it/s]
4-echo monoexponential:  62%|██████▏   | 12593/20176 [00:20<00:13, 576.06it/s]
4-echo monoexponential:  63%|██████▎   | 12656/20176 [00:20<00:12, 590.86it/s]
4-echo monoexponential:  63%|██████▎   | 12719/20176 [00:20<00:12, 601.25it/s]
4-echo monoexponential:  63%|██████▎   | 12784/20176 [00:20<00:12, 613.49it/s]
4-echo monoexponential:  64%|██████▎   | 12850/20176 [00:20<00:11, 625.24it/s]
4-echo monoexponential:  64%|██████▍   | 12917/20176 [00:20<00:11, 635.28it/s]
4-echo monoexponential:  64%|██████▍   | 12981/20176 [00:21<00:11, 632.78it/s]
4-echo monoexponential:  65%|██████▍   | 13047/20176 [00:21<00:11, 639.38it/s]
4-echo monoexponential:  65%|██████▍   | 13112/20176 [00:21<00:11, 637.91it/s]
4-echo monoexponential:  65%|██████▌   | 13176/20176 [00:21<00:11, 630.73it/s]
4-echo monoexponential:  66%|██████▌   | 13240/20176 [00:21<00:10, 631.22it/s]
4-echo monoexponential:  66%|██████▌   | 13304/20176 [00:21<00:11, 623.49it/s]
4-echo monoexponential:  66%|██████▋   | 13367/20176 [00:21<00:11, 595.67it/s]
4-echo monoexponential:  67%|██████▋   | 13431/20176 [00:21<00:11, 606.31it/s]
4-echo monoexponential:  67%|██████▋   | 13492/20176 [00:21<00:11, 605.40it/s]
4-echo monoexponential:  67%|██████▋   | 13555/20176 [00:22<00:10, 610.38it/s]
4-echo monoexponential:  68%|██████▊   | 13620/20176 [00:22<00:10, 620.65it/s]
4-echo monoexponential:  68%|██████▊   | 13686/20176 [00:22<00:10, 630.86it/s]
4-echo monoexponential:  68%|██████▊   | 13752/20176 [00:22<00:10, 637.73it/s]
4-echo monoexponential:  68%|██████▊   | 13817/20176 [00:22<00:09, 639.72it/s]
4-echo monoexponential:  69%|██████▉   | 13882/20176 [00:22<00:09, 640.08it/s]
4-echo monoexponential:  69%|██████▉   | 13947/20176 [00:22<00:09, 637.17it/s]
4-echo monoexponential:  69%|██████▉   | 14011/20176 [00:22<00:09, 636.78it/s]
4-echo monoexponential:  70%|██████▉   | 14075/20176 [00:22<00:09, 631.22it/s]
4-echo monoexponential:  70%|███████   | 14139/20176 [00:22<00:09, 606.62it/s]
4-echo monoexponential:  70%|███████   | 14200/20176 [00:23<00:09, 602.74it/s]
4-echo monoexponential:  71%|███████   | 14262/20176 [00:23<00:09, 605.62it/s]
4-echo monoexponential:  71%|███████   | 14326/20176 [00:23<00:09, 613.24it/s]
4-echo monoexponential:  71%|███████▏  | 14390/20176 [00:23<00:09, 620.52it/s]
4-echo monoexponential:  72%|███████▏  | 14458/20176 [00:23<00:09, 634.89it/s]
4-echo monoexponential:  72%|███████▏  | 14527/20176 [00:23<00:08, 648.42it/s]
4-echo monoexponential:  72%|███████▏  | 14592/20176 [00:23<00:08, 645.94it/s]
4-echo monoexponential:  73%|███████▎  | 14657/20176 [00:23<00:08, 642.13it/s]
4-echo monoexponential:  73%|███████▎  | 14722/20176 [00:23<00:08, 629.76it/s]
4-echo monoexponential:  73%|███████▎  | 14786/20176 [00:23<00:08, 632.05it/s]
4-echo monoexponential:  74%|███████▎  | 14850/20176 [00:24<00:08, 618.03it/s]
4-echo monoexponential:  74%|███████▍  | 14912/20176 [00:24<00:08, 608.87it/s]
4-echo monoexponential:  74%|███████▍  | 14974/20176 [00:24<00:08, 611.10it/s]
4-echo monoexponential:  75%|███████▍  | 15038/20176 [00:24<00:08, 618.24it/s]
4-echo monoexponential:  75%|███████▍  | 15102/20176 [00:24<00:08, 623.47it/s]
4-echo monoexponential:  75%|███████▌  | 15167/20176 [00:24<00:07, 629.18it/s]
4-echo monoexponential:  75%|███████▌  | 15230/20176 [00:24<00:07, 625.67it/s]
4-echo monoexponential:  76%|███████▌  | 15294/20176 [00:24<00:07, 627.91it/s]
4-echo monoexponential:  76%|███████▌  | 15359/20176 [00:24<00:07, 634.39it/s]
4-echo monoexponential:  76%|███████▋  | 15423/20176 [00:25<00:07, 630.18it/s]
4-echo monoexponential:  77%|███████▋  | 15487/20176 [00:25<00:07, 632.47it/s]
4-echo monoexponential:  77%|███████▋  | 15551/20176 [00:25<00:07, 625.57it/s]
4-echo monoexponential:  77%|███████▋  | 15614/20176 [00:25<00:07, 606.35it/s]
4-echo monoexponential:  78%|███████▊  | 15678/20176 [00:25<00:07, 614.66it/s]
4-echo monoexponential:  78%|███████▊  | 15742/20176 [00:25<00:07, 620.65it/s]
4-echo monoexponential:  78%|███████▊  | 15805/20176 [00:25<00:07, 606.42it/s]
4-echo monoexponential:  79%|███████▊  | 15867/20176 [00:25<00:07, 609.20it/s]
4-echo monoexponential:  79%|███████▉  | 15932/20176 [00:25<00:06, 618.77it/s]
4-echo monoexponential:  79%|███████▉  | 15999/20176 [00:25<00:06, 631.70it/s]
4-echo monoexponential:  80%|███████▉  | 16065/20176 [00:26<00:06, 637.57it/s]
4-echo monoexponential:  80%|███████▉  | 16129/20176 [00:26<00:06, 635.02it/s]
4-echo monoexponential:  80%|████████  | 16193/20176 [00:26<00:06, 626.70it/s]
4-echo monoexponential:  81%|████████  | 16256/20176 [00:26<00:06, 626.21it/s]
4-echo monoexponential:  81%|████████  | 16319/20176 [00:26<00:06, 601.35it/s]
4-echo monoexponential:  81%|████████  | 16380/20176 [00:26<00:06, 601.52it/s]
4-echo monoexponential:  81%|████████▏ | 16442/20176 [00:26<00:06, 603.53it/s]
4-echo monoexponential:  82%|████████▏ | 16503/20176 [00:26<00:06, 594.02it/s]
4-echo monoexponential:  82%|████████▏ | 16565/20176 [00:26<00:06, 598.98it/s]
4-echo monoexponential:  82%|████████▏ | 16629/20176 [00:26<00:05, 608.08it/s]
4-echo monoexponential:  83%|████████▎ | 16696/20176 [00:27<00:05, 624.60it/s]
4-echo monoexponential:  83%|████████▎ | 16763/20176 [00:27<00:05, 635.43it/s]
4-echo monoexponential:  83%|████████▎ | 16827/20176 [00:27<00:05, 632.41it/s]
4-echo monoexponential:  84%|████████▎ | 16891/20176 [00:27<00:05, 627.78it/s]
4-echo monoexponential:  84%|████████▍ | 16954/20176 [00:27<00:05, 627.89it/s]
4-echo monoexponential:  84%|████████▍ | 17017/20176 [00:27<00:05, 591.99it/s]
4-echo monoexponential:  85%|████████▍ | 17080/20176 [00:27<00:05, 600.78it/s]
4-echo monoexponential:  85%|████████▍ | 17142/20176 [00:27<00:05, 603.93it/s]
4-echo monoexponential:  85%|████████▌ | 17203/20176 [00:27<00:05, 593.93it/s]
4-echo monoexponential:  86%|████████▌ | 17266/20176 [00:28<00:04, 603.43it/s]
4-echo monoexponential:  86%|████████▌ | 17327/20176 [00:28<00:04, 605.18it/s]
4-echo monoexponential:  86%|████████▌ | 17393/20176 [00:28<00:04, 621.16it/s]
4-echo monoexponential:  87%|████████▋ | 17457/20176 [00:28<00:04, 623.91it/s]
4-echo monoexponential:  87%|████████▋ | 17520/20176 [00:28<00:04, 617.36it/s]
4-echo monoexponential:  87%|████████▋ | 17583/20176 [00:28<00:04, 620.83it/s]
4-echo monoexponential:  87%|████████▋ | 17646/20176 [00:28<00:04, 597.23it/s]
4-echo monoexponential:  88%|████████▊ | 17706/20176 [00:28<00:04, 587.63it/s]
4-echo monoexponential:  88%|████████▊ | 17765/20176 [00:28<00:04, 583.44it/s]
4-echo monoexponential:  88%|████████▊ | 17827/20176 [00:28<00:03, 592.09it/s]
4-echo monoexponential:  89%|████████▊ | 17889/20176 [00:29<00:03, 600.24it/s]
4-echo monoexponential:  89%|████████▉ | 17954/20176 [00:29<00:03, 613.42it/s]
4-echo monoexponential:  89%|████████▉ | 18022/20176 [00:29<00:03, 631.23it/s]
4-echo monoexponential:  90%|████████▉ | 18087/20176 [00:29<00:03, 633.59it/s]
4-echo monoexponential:  90%|████████▉ | 18151/20176 [00:29<00:03, 625.75it/s]
4-echo monoexponential:  90%|█████████ | 18214/20176 [00:29<00:03, 609.31it/s]
4-echo monoexponential:  91%|█████████ | 18276/20176 [00:29<00:03, 590.77it/s]
4-echo monoexponential:  91%|█████████ | 18336/20176 [00:29<00:03, 588.49it/s]
4-echo monoexponential:  91%|█████████ | 18395/20176 [00:29<00:03, 581.87it/s]
4-echo monoexponential:  91%|█████████▏| 18457/20176 [00:29<00:02, 591.54it/s]
4-echo monoexponential:  92%|█████████▏| 18519/20176 [00:30<00:02, 598.33it/s]
4-echo monoexponential:  92%|█████████▏| 18583/20176 [00:30<00:02, 608.33it/s]
4-echo monoexponential:  92%|█████████▏| 18647/20176 [00:30<00:02, 616.69it/s]
4-echo monoexponential:  93%|█████████▎| 18709/20176 [00:30<00:02, 604.01it/s]
4-echo monoexponential:  93%|█████████▎| 18770/20176 [00:30<00:02, 593.80it/s]
4-echo monoexponential:  93%|█████████▎| 18830/20176 [00:30<00:02, 594.65it/s]
4-echo monoexponential:  94%|█████████▎| 18890/20176 [00:30<00:02, 588.55it/s]
4-echo monoexponential:  94%|█████████▍| 18949/20176 [00:30<00:02, 588.61it/s]
4-echo monoexponential:  94%|█████████▍| 19015/20176 [00:30<00:01, 607.78it/s]
4-echo monoexponential:  95%|█████████▍| 19082/20176 [00:31<00:01, 624.58it/s]
4-echo monoexponential:  95%|█████████▍| 19145/20176 [00:31<00:01, 626.10it/s]
4-echo monoexponential:  95%|█████████▌| 19208/20176 [00:31<00:01, 595.13it/s]
4-echo monoexponential:  95%|█████████▌| 19268/20176 [00:31<00:01, 588.15it/s]
4-echo monoexponential:  96%|█████████▌| 19328/20176 [00:31<00:01, 581.72it/s]
4-echo monoexponential:  96%|█████████▌| 19387/20176 [00:31<00:01, 577.77it/s]
4-echo monoexponential:  96%|█████████▋| 19448/20176 [00:31<00:01, 584.26it/s]
4-echo monoexponential:  97%|█████████▋| 19513/20176 [00:31<00:01, 601.91it/s]
4-echo monoexponential:  97%|█████████▋| 19574/20176 [00:31<00:01, 588.01it/s]
4-echo monoexponential:  97%|█████████▋| 19637/20176 [00:31<00:00, 597.72it/s]
4-echo monoexponential:  98%|█████████▊| 19701/20176 [00:32<00:00, 607.56it/s]
4-echo monoexponential:  98%|█████████▊| 19768/20176 [00:32<00:00, 623.96it/s]
4-echo monoexponential:  98%|█████████▊| 19831/20176 [00:32<00:00, 618.94it/s]
4-echo monoexponential:  99%|█████████▊| 19893/20176 [00:32<00:00, 598.90it/s]
4-echo monoexponential:  99%|█████████▉| 19954/20176 [00:32<00:00, 590.32it/s]
4-echo monoexponential:  99%|█████████▉| 20014/20176 [00:32<00:00, 584.99it/s]
4-echo monoexponential:  99%|█████████▉| 20073/20176 [00:32<00:00, 585.58it/s]
4-echo monoexponential: 100%|█████████▉| 20132/20176 [00:32<00:00, 579.40it/s]
4-echo monoexponential: 100%|██████████| 20176/20176 [00:32<00:00, 613.87it/s]
INFO     t2smap:t2smap_workflow:360 Calculating model fit quality metrics
/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     t2smap:t2smap_workflow:372 Computing optimal combination
INFO     combine:make_optcom:192 Optimally combining data with voxel-wise T2* estimates
INFO     t2smap:t2smap_workflow:430 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
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))
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-confounds_timeseries.tsv
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-optcom_bold.nii.gz
sub-04570_task-rest_space-scanner_desc-rmse_statmap.nii.gz
sub-04570_task-rest_space-scanner_desc-tedana_registry.json
fig, ax = plt.subplots(figsize=(16, 8))
plotting.plot_stat_map(
    os.path.join(out_dir, "sub-04570_task-rest_space-scanner_T2starmap.nii.gz"),
    vmax=0.6,
    draw_cross=False,
    bg_img=None,
    figure=fig,
    axes=ax,
)
glue("figure_t2starmap", fig, display=False)
<Figure size 1600x800 with 5 Axes>

Fig. 20 T2* map estimated from multi-echo data using tedana’s t2smap_workflow().#

fig, ax = plt.subplots(figsize=(16, 8))
plotting.plot_stat_map(
    os.path.join(out_dir, "sub-04570_task-rest_space-scanner_S0map.nii.gz"),
    vmax=8000,
    draw_cross=False,
    bg_img=None,
    figure=fig,
    axes=ax,
)
glue("figure_s0map", fig, display=False)
<Figure size 1600x800 with 5 Axes>

Fig. 21 S0 map estimated from multi-echo data using tedana’s t2smap_workflow().#

fig, axes = plt.subplots(figsize=(16, 15), nrows=5)
plotting.plot_epi(
    image.mean_img(data_files[0]),
    draw_cross=False,
    bg_img=None,
    cut_coords=[-10, 0, 10, 20, 30, 40, 50, 60, 70],
    display_mode="z",
    figure=fig,
    axes=axes[0],
)
plotting.plot_epi(
    image.mean_img(data_files[1]),
    draw_cross=False,
    bg_img=None,
    cut_coords=[-10, 0, 10, 20, 30, 40, 50, 60, 70],
    display_mode="z",
    figure=fig,
    axes=axes[1],
)
plotting.plot_epi(
    image.mean_img(data_files[2]),
    draw_cross=False,
    bg_img=None,
    cut_coords=[-10, 0, 10, 20, 30, 40, 50, 60, 70],
    display_mode="z",
    figure=fig,
    axes=axes[2],
)
plotting.plot_epi(
    image.mean_img(data_files[3]),
    draw_cross=False,
    bg_img=None,
    cut_coords=[-10, 0, 10, 20, 30, 40, 50, 60, 70],
    display_mode="z",
    figure=fig,
    axes=axes[3],
)
plotting.plot_epi(
    image.mean_img(
        os.path.join(
            out_dir, "sub-04570_task-rest_space-scanner_desc-optcom_bold.nii.gz"
        )
    ),
    draw_cross=False,
    bg_img=None,
    cut_coords=[-10, 0, 10, 20, 30, 40, 50, 60, 70],
    display_mode="z",
    figure=fig,
    axes=axes[4],
)
glue("figure_t2smap_epi_plots", fig, display=False)
<Figure size 1600x1500 with 50 Axes>

Fig. 22 Mean map of each of the echoes in the original data, along with the mean map of the optimally combined data.#

te30_tsnr = image.math_img(
    "(np.nanmean(img, axis=3) / np.nanstd(img, axis=3)) * mask",
    img=data_files[1],
    mask=mask_file,
)
oc_tsnr = image.math_img(
    "(np.nanmean(img, axis=3) / np.nanstd(img, axis=3)) * mask",
    img=os.path.join(
        out_dir, "sub-04570_task-rest_space-scanner_desc-optcom_bold.nii.gz"
    ),
    mask=mask_file,
)
vmax = np.nanmax(np.abs(oc_tsnr.get_fdata()))

fig, axes = plt.subplots(figsize=(10, 8), nrows=2)
plotting.plot_stat_map(
    te30_tsnr,
    draw_cross=False,
    bg_img=None,
    threshold=0.1,
    cut_coords=[0, 10, 10],
    vmax=vmax,
    symmetric_cbar=False,
    figure=fig,
    axes=axes[0],
)
axes[0].set_title("TE30 TSNR", fontsize=16)
plotting.plot_stat_map(
    oc_tsnr,
    draw_cross=False,
    bg_img=None,
    threshold=0.1,
    cut_coords=[0, 10, 10],
    vmax=vmax,
    symmetric_cbar=False,
    figure=fig,
    axes=axes[1],
)
axes[1].set_title("Optimal Combination TSNR", fontsize=16)
glue("figure_t2smap_t2snr", fig, display=False)
<string>:1: RuntimeWarning: invalid value encountered in divide
/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),
<Figure size 1000x800 with 10 Axes>

Fig. 23 TSNR map of each of the echoes in the original data, along with the TSNR map of the optimally combined data.#

fig, ax = plt.subplots(figsize=(16, 8))
plotting.plot_carpet(
    data_files[1],
    figure=fig,
    axes=ax,
)
glue("figure_echo2_carpet", fig, display=False)
<Figure size 1600x800 with 1 Axes>

Fig. 24 Carpet plot of the second echo’s data.#

fig, ax = plt.subplots(figsize=(16, 8))
plotting.plot_carpet(
    os.path.join(out_dir, "sub-04570_task-rest_space-scanner_desc-optcom_bold.nii.gz"),
    axes=ax,
)
glue("figure_optcom_carpet", fig, display=False)
<Figure size 1600x800 with 1 Axes>

Fig. 25 Carpet plot of the optimally combined data.#