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.18/x64/lib/python3.10/site-packages/repo2data
Config from file :
../binder/data_requirement.json
Destination:
./../data/multi-echo-data-analysis
Info : ./../data/multi-echo-data-analysis already downloaded
/opt/hostedtoolcache/Python/3.10.18/x64/lib/python3.10/site-packages/pybtex/plugin/__init__.py:26: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
import pkg_resources
/opt/hostedtoolcache/Python/3.10.18/x64/lib/python3.10/site-packages/tqdm/auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html
from .autonotebook import tqdm as notebook_tqdm
func_dir = os.path.join(data_path, "func/")
data_files = [
os.path.join(
func_dir,
"sub-04570_task-rest_echo-1_space-scanner_desc-partialPreproc_bold.nii.gz",
),
os.path.join(
func_dir,
"sub-04570_task-rest_echo-2_space-scanner_desc-partialPreproc_bold.nii.gz",
),
os.path.join(
func_dir,
"sub-04570_task-rest_echo-3_space-scanner_desc-partialPreproc_bold.nii.gz",
),
os.path.join(
func_dir,
"sub-04570_task-rest_echo-4_space-scanner_desc-partialPreproc_bold.nii.gz",
),
]
echo_times = [12.0, 28.0, 44.0, 60.0]
mask_file = os.path.join(
func_dir, "sub-04570_task-rest_space-scanner_desc-brain_mask.nii.gz"
)
confounds_file = os.path.join(
func_dir, "sub-04570_task-rest_desc-confounds_timeseries.tsv"
)
out_dir = os.path.join(data_path, "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:300 Using output directory: /home/runner/work/multi-echo-data-analysis/multi-echo-data-analysis/data/multi-echo-data-analysis/t2smap
INFO t2smap:t2smap_workflow:326 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:348 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:357 Computing adaptive T2* map
2-echo monoexponential: 0%| | 0/2224 [00:00<?, ?it/s]
2-echo monoexponential: 3%|▎ | 65/2224 [00:00<00:03, 646.04it/s]
2-echo monoexponential: 7%|▋ | 149/2224 [00:00<00:02, 756.47it/s]
2-echo monoexponential: 10%|█ | 225/2224 [00:00<00:02, 753.06it/s]
2-echo monoexponential: 14%|█▍ | 308/2224 [00:00<00:02, 782.30it/s]
2-echo monoexponential: 18%|█▊ | 393/2224 [00:00<00:02, 803.63it/s]
2-echo monoexponential: 22%|██▏ | 479/2224 [00:00<00:02, 818.98it/s]
2-echo monoexponential: 25%|██▌ | 563/2224 [00:00<00:02, 824.51it/s]
2-echo monoexponential: 29%|██▉ | 646/2224 [00:00<00:01, 819.84it/s]
2-echo monoexponential: 33%|███▎ | 728/2224 [00:00<00:01, 817.23it/s]
2-echo monoexponential: 37%|███▋ | 814/2224 [00:01<00:01, 830.13it/s]
2-echo monoexponential: 40%|████ | 898/2224 [00:01<00:01, 823.67it/s]
2-echo monoexponential: 44%|████▍ | 981/2224 [00:01<00:01, 807.60it/s]
2-echo monoexponential: 48%|████▊ | 1062/2224 [00:01<00:01, 799.47it/s]
2-echo monoexponential: 51%|█████▏ | 1145/2224 [00:01<00:01, 805.23it/s]
2-echo monoexponential: 55%|█████▌ | 1227/2224 [00:01<00:01, 804.99it/s]
2-echo monoexponential: 59%|█████▉ | 1308/2224 [00:01<00:01, 785.41it/s]
2-echo monoexponential: 62%|██████▏ | 1389/2224 [00:01<00:01, 791.44it/s]
2-echo monoexponential: 66%|██████▌ | 1470/2224 [00:01<00:00, 795.90it/s]
2-echo monoexponential: 70%|██████▉ | 1554/2224 [00:01<00:00, 806.93it/s]
2-echo monoexponential: 74%|███████▎ | 1635/2224 [00:02<00:00, 629.34it/s]
2-echo monoexponential: 77%|███████▋ | 1715/2224 [00:02<00:00, 670.26it/s]
2-echo monoexponential: 81%|████████ | 1797/2224 [00:02<00:00, 707.53it/s]
2-echo monoexponential: 84%|████████▍ | 1878/2224 [00:02<00:00, 733.86it/s]
2-echo monoexponential: 88%|████████▊ | 1957/2224 [00:02<00:00, 748.53it/s]
2-echo monoexponential: 92%|█████████▏| 2039/2224 [00:02<00:00, 767.11it/s]
2-echo monoexponential: 95%|█████████▌| 2119/2224 [00:02<00:00, 776.07it/s]
2-echo monoexponential: 99%|█████████▉| 2201/2224 [00:02<00:00, 786.55it/s]
2-echo monoexponential: 100%|██████████| 2224/2224 [00:02<00:00, 774.84it/s]
3-echo monoexponential: 0%| | 0/1092 [00:00<?, ?it/s]
3-echo monoexponential: 5%|▍ | 51/1092 [00:00<00:02, 500.60it/s]
3-echo monoexponential: 10%|▉ | 105/1092 [00:00<00:01, 519.16it/s]
3-echo monoexponential: 15%|█▍ | 160/1092 [00:00<00:01, 530.40it/s]
3-echo monoexponential: 20%|█▉ | 215/1092 [00:00<00:01, 534.19it/s]
3-echo monoexponential: 25%|██▍ | 269/1092 [00:00<00:01, 533.03it/s]
3-echo monoexponential: 30%|██▉ | 323/1092 [00:00<00:01, 530.37it/s]
3-echo monoexponential: 35%|███▍ | 377/1092 [00:00<00:01, 521.27it/s]
3-echo monoexponential: 39%|███▉ | 430/1092 [00:00<00:01, 521.68it/s]
3-echo monoexponential: 45%|████▍ | 486/1092 [00:00<00:01, 532.34it/s]
3-echo monoexponential: 49%|████▉ | 540/1092 [00:01<00:01, 524.01it/s]
3-echo monoexponential: 54%|█████▍ | 593/1092 [00:01<00:00, 520.65it/s]
3-echo monoexponential: 59%|█████▉ | 647/1092 [00:01<00:00, 525.47it/s]
3-echo monoexponential: 64%|██████▍ | 700/1092 [00:01<00:00, 525.99it/s]
3-echo monoexponential: 69%|██████▉ | 753/1092 [00:01<00:00, 509.07it/s]
3-echo monoexponential: 74%|███████▎ | 805/1092 [00:01<00:00, 510.01it/s]
3-echo monoexponential: 78%|███████▊ | 857/1092 [00:01<00:00, 512.41it/s]
3-echo monoexponential: 84%|████████▎ | 912/1092 [00:01<00:00, 522.75it/s]
3-echo monoexponential: 89%|████████▊ | 967/1092 [00:01<00:00, 528.69it/s]
3-echo monoexponential: 93%|█████████▎| 1021/1092 [00:01<00:00, 530.02it/s]
3-echo monoexponential: 98%|█████████▊| 1075/1092 [00:02<00:00, 524.46it/s]
3-echo monoexponential: 100%|██████████| 1092/1092 [00:02<00:00, 523.13it/s]
4-echo monoexponential: 0%| | 0/20176 [00:00<?, ?it/s]
4-echo monoexponential: 0%| | 53/20176 [00:00<00:38, 527.81it/s]
4-echo monoexponential: 1%| | 109/20176 [00:00<00:36, 544.15it/s]
4-echo monoexponential: 1%| | 170/20176 [00:00<00:35, 571.42it/s]
4-echo monoexponential: 1%| | 231/20176 [00:00<00:34, 585.58it/s]
4-echo monoexponential: 1%|▏ | 290/20176 [00:00<00:34, 584.09it/s]
4-echo monoexponential: 2%|▏ | 354/20176 [00:00<00:33, 600.61it/s]
4-echo monoexponential: 2%|▏ | 415/20176 [00:00<00:32, 600.17it/s]
4-echo monoexponential: 2%|▏ | 477/20176 [00:00<00:32, 604.57it/s]
4-echo monoexponential: 3%|▎ | 540/20176 [00:00<00:32, 610.30it/s]
4-echo monoexponential: 3%|▎ | 602/20176 [00:01<00:32, 604.16it/s]
4-echo monoexponential: 3%|▎ | 663/20176 [00:01<00:32, 596.78it/s]
4-echo monoexponential: 4%|▎ | 724/20176 [00:01<00:32, 597.99it/s]
4-echo monoexponential: 4%|▍ | 786/20176 [00:01<00:32, 602.61it/s]
4-echo monoexponential: 4%|▍ | 847/20176 [00:01<00:32, 600.85it/s]
4-echo monoexponential: 5%|▍ | 910/20176 [00:01<00:31, 609.28it/s]
4-echo monoexponential: 5%|▍ | 971/20176 [00:01<00:31, 606.32it/s]
4-echo monoexponential: 5%|▌ | 1032/20176 [00:01<00:33, 578.93it/s]
4-echo monoexponential: 5%|▌ | 1092/20176 [00:01<00:32, 582.88it/s]
4-echo monoexponential: 6%|▌ | 1153/20176 [00:01<00:32, 590.56it/s]
4-echo monoexponential: 6%|▌ | 1215/20176 [00:02<00:31, 597.95it/s]
4-echo monoexponential: 6%|▋ | 1278/20176 [00:02<00:31, 607.19it/s]
4-echo monoexponential: 7%|▋ | 1342/20176 [00:02<00:30, 616.56it/s]
4-echo monoexponential: 7%|▋ | 1407/20176 [00:02<00:30, 623.19it/s]
4-echo monoexponential: 7%|▋ | 1470/20176 [00:02<00:31, 600.35it/s]
4-echo monoexponential: 8%|▊ | 1531/20176 [00:02<00:31, 600.95it/s]
4-echo monoexponential: 8%|▊ | 1592/20176 [00:02<00:30, 602.79it/s]
4-echo monoexponential: 8%|▊ | 1655/20176 [00:02<00:30, 607.97it/s]
4-echo monoexponential: 9%|▊ | 1720/20176 [00:02<00:29, 618.45it/s]
4-echo monoexponential: 9%|▉ | 1782/20176 [00:02<00:29, 618.76it/s]
4-echo monoexponential: 9%|▉ | 1846/20176 [00:03<00:29, 624.10it/s]
4-echo monoexponential: 9%|▉ | 1909/20176 [00:03<00:29, 624.03it/s]
4-echo monoexponential: 10%|▉ | 1972/20176 [00:03<00:30, 606.45it/s]
4-echo monoexponential: 10%|█ | 2033/20176 [00:03<00:30, 594.20it/s]
4-echo monoexponential: 10%|█ | 2096/20176 [00:03<00:29, 603.76it/s]
4-echo monoexponential: 11%|█ | 2159/20176 [00:03<00:29, 609.56it/s]
4-echo monoexponential: 11%|█ | 2227/20176 [00:03<00:28, 626.97it/s]
4-echo monoexponential: 11%|█▏ | 2292/20176 [00:03<00:28, 631.46it/s]
4-echo monoexponential: 12%|█▏ | 2358/20176 [00:03<00:27, 637.43it/s]
4-echo monoexponential: 12%|█▏ | 2423/20176 [00:03<00:27, 640.74it/s]
4-echo monoexponential: 12%|█▏ | 2489/20176 [00:04<00:27, 645.99it/s]
4-echo monoexponential: 13%|█▎ | 2554/20176 [00:04<00:27, 634.95it/s]
4-echo monoexponential: 13%|█▎ | 2618/20176 [00:04<00:28, 611.45it/s]
4-echo monoexponential: 13%|█▎ | 2680/20176 [00:04<00:28, 603.75it/s]
4-echo monoexponential: 14%|█▎ | 2743/20176 [00:04<00:28, 610.57it/s]
4-echo monoexponential: 14%|█▍ | 2806/20176 [00:04<00:28, 613.55it/s]
4-echo monoexponential: 14%|█▍ | 2873/20176 [00:04<00:27, 629.31it/s]
4-echo monoexponential: 15%|█▍ | 2940/20176 [00:04<00:27, 638.07it/s]
4-echo monoexponential: 15%|█▍ | 3005/20176 [00:04<00:26, 640.40it/s]
4-echo monoexponential: 15%|█▌ | 3072/20176 [00:05<00:26, 647.20it/s]
4-echo monoexponential: 16%|█▌ | 3138/20176 [00:05<00:26, 648.62it/s]
4-echo monoexponential: 16%|█▌ | 3203/20176 [00:05<00:26, 638.31it/s]
4-echo monoexponential: 16%|█▌ | 3267/20176 [00:05<00:27, 620.76it/s]
4-echo monoexponential: 17%|█▋ | 3332/20176 [00:05<00:26, 627.96it/s]
4-echo monoexponential: 17%|█▋ | 3396/20176 [00:05<00:26, 627.61it/s]
4-echo monoexponential: 17%|█▋ | 3459/20176 [00:05<00:26, 628.30it/s]
4-echo monoexponential: 17%|█▋ | 3526/20176 [00:05<00:26, 638.41it/s]
4-echo monoexponential: 18%|█▊ | 3593/20176 [00:05<00:25, 645.21it/s]
4-echo monoexponential: 18%|█▊ | 3658/20176 [00:05<00:25, 640.59it/s]
4-echo monoexponential: 18%|█▊ | 3723/20176 [00:06<00:25, 641.31it/s]
4-echo monoexponential: 19%|█▉ | 3789/20176 [00:06<00:25, 643.34it/s]
4-echo monoexponential: 19%|█▉ | 3854/20176 [00:06<00:25, 638.52it/s]
4-echo monoexponential: 19%|█▉ | 3918/20176 [00:06<00:25, 628.29it/s]
4-echo monoexponential: 20%|█▉ | 3981/20176 [00:06<00:26, 615.90it/s]
4-echo monoexponential: 20%|██ | 4045/20176 [00:06<00:25, 621.80it/s]
4-echo monoexponential: 20%|██ | 4108/20176 [00:06<00:26, 617.38it/s]
4-echo monoexponential: 21%|██ | 4170/20176 [00:06<00:26, 612.09it/s]
4-echo monoexponential: 21%|██ | 4236/20176 [00:06<00:25, 626.08it/s]
4-echo monoexponential: 21%|██▏ | 4304/20176 [00:06<00:24, 641.89it/s]
4-echo monoexponential: 22%|██▏ | 4369/20176 [00:07<00:24, 634.97it/s]
4-echo monoexponential: 22%|██▏ | 4434/20176 [00:07<00:24, 638.32it/s]
4-echo monoexponential: 22%|██▏ | 4500/20176 [00:07<00:24, 644.60it/s]
4-echo monoexponential: 23%|██▎ | 4565/20176 [00:07<00:24, 644.49it/s]
4-echo monoexponential: 23%|██▎ | 4630/20176 [00:07<00:24, 640.04it/s]
4-echo monoexponential: 23%|██▎ | 4695/20176 [00:07<00:24, 622.56it/s]
4-echo monoexponential: 24%|██▎ | 4760/20176 [00:07<00:24, 628.53it/s]
4-echo monoexponential: 24%|██▍ | 4824/20176 [00:07<00:24, 630.95it/s]
4-echo monoexponential: 24%|██▍ | 4888/20176 [00:07<00:24, 626.58it/s]
4-echo monoexponential: 25%|██▍ | 4951/20176 [00:08<00:24, 626.00it/s]
4-echo monoexponential: 25%|██▍ | 5018/20176 [00:08<00:23, 636.84it/s]
4-echo monoexponential: 25%|██▌ | 5084/20176 [00:08<00:23, 641.08it/s]
4-echo monoexponential: 26%|██▌ | 5152/20176 [00:08<00:23, 652.48it/s]
4-echo monoexponential: 26%|██▌ | 5218/20176 [00:08<00:22, 653.45it/s]
4-echo monoexponential: 26%|██▌ | 5284/20176 [00:08<00:22, 652.25it/s]
4-echo monoexponential: 27%|██▋ | 5350/20176 [00:08<00:22, 651.33it/s]
4-echo monoexponential: 27%|██▋ | 5416/20176 [00:08<00:23, 634.47it/s]
4-echo monoexponential: 27%|██▋ | 5480/20176 [00:08<00:23, 624.90it/s]
4-echo monoexponential: 27%|██▋ | 5543/20176 [00:08<00:23, 621.64it/s]
4-echo monoexponential: 28%|██▊ | 5606/20176 [00:09<00:23, 615.02it/s]
4-echo monoexponential: 28%|██▊ | 5668/20176 [00:09<00:23, 615.42it/s]
4-echo monoexponential: 28%|██▊ | 5736/20176 [00:09<00:22, 632.12it/s]
4-echo monoexponential: 29%|██▉ | 5804/20176 [00:09<00:22, 644.10it/s]
4-echo monoexponential: 29%|██▉ | 5870/20176 [00:09<00:22, 647.33it/s]
4-echo monoexponential: 29%|██▉ | 5935/20176 [00:09<00:22, 645.17it/s]
4-echo monoexponential: 30%|██▉ | 6000/20176 [00:09<00:22, 638.10it/s]
4-echo monoexponential: 30%|███ | 6065/20176 [00:09<00:22, 639.51it/s]
4-echo monoexponential: 30%|███ | 6129/20176 [00:09<00:22, 638.28it/s]
4-echo monoexponential: 31%|███ | 6193/20176 [00:09<00:22, 620.94it/s]
4-echo monoexponential: 31%|███ | 6256/20176 [00:10<00:22, 609.21it/s]
4-echo monoexponential: 31%|███▏ | 6318/20176 [00:10<00:22, 608.67it/s]
4-echo monoexponential: 32%|███▏ | 6379/20176 [00:10<00:22, 606.98it/s]
4-echo monoexponential: 32%|███▏ | 6443/20176 [00:10<00:22, 614.78it/s]
4-echo monoexponential: 32%|███▏ | 6510/20176 [00:10<00:21, 629.18it/s]
4-echo monoexponential: 33%|███▎ | 6577/20176 [00:10<00:21, 639.71it/s]
4-echo monoexponential: 33%|███▎ | 6642/20176 [00:10<00:21, 642.22it/s]
4-echo monoexponential: 33%|███▎ | 6707/20176 [00:10<00:20, 641.88it/s]
4-echo monoexponential: 34%|███▎ | 6772/20176 [00:10<00:20, 643.32it/s]
4-echo monoexponential: 34%|███▍ | 6838/20176 [00:10<00:20, 646.02it/s]
4-echo monoexponential: 34%|███▍ | 6903/20176 [00:11<00:20, 640.70it/s]
4-echo monoexponential: 35%|███▍ | 6968/20176 [00:11<00:21, 620.49it/s]
4-echo monoexponential: 35%|███▍ | 7031/20176 [00:11<00:21, 607.24it/s]
4-echo monoexponential: 35%|███▌ | 7095/20176 [00:11<00:21, 613.88it/s]
4-echo monoexponential: 35%|███▌ | 7158/20176 [00:11<00:21, 617.00it/s]
4-echo monoexponential: 36%|███▌ | 7220/20176 [00:11<00:21, 611.90it/s]
4-echo monoexponential: 36%|███▌ | 7288/20176 [00:11<00:20, 629.32it/s]
4-echo monoexponential: 36%|███▋ | 7355/20176 [00:11<00:20, 639.81it/s]
4-echo monoexponential: 37%|███▋ | 7420/20176 [00:11<00:19, 641.32it/s]
4-echo monoexponential: 37%|███▋ | 7485/20176 [00:12<00:20, 634.17it/s]
4-echo monoexponential: 37%|███▋ | 7550/20176 [00:12<00:19, 637.09it/s]
4-echo monoexponential: 38%|███▊ | 7615/20176 [00:12<00:19, 638.12it/s]
4-echo monoexponential: 38%|███▊ | 7681/20176 [00:12<00:19, 642.92it/s]
4-echo monoexponential: 38%|███▊ | 7746/20176 [00:12<00:19, 624.61it/s]
4-echo monoexponential: 39%|███▊ | 7809/20176 [00:12<00:20, 610.23it/s]
4-echo monoexponential: 39%|███▉ | 7871/20176 [00:12<00:20, 606.36it/s]
4-echo monoexponential: 39%|███▉ | 7935/20176 [00:12<00:19, 614.84it/s]
4-echo monoexponential: 40%|███▉ | 7997/20176 [00:12<00:19, 614.33it/s]
4-echo monoexponential: 40%|███▉ | 8062/20176 [00:12<00:19, 622.79it/s]
4-echo monoexponential: 40%|████ | 8128/20176 [00:13<00:19, 631.01it/s]
4-echo monoexponential: 41%|████ | 8194/20176 [00:13<00:18, 637.39it/s]
4-echo monoexponential: 41%|████ | 8259/20176 [00:13<00:18, 639.30it/s]
4-echo monoexponential: 41%|████▏ | 8324/20176 [00:13<00:18, 639.88it/s]
4-echo monoexponential: 42%|████▏ | 8389/20176 [00:13<00:18, 640.01it/s]
4-echo monoexponential: 42%|████▏ | 8454/20176 [00:13<00:18, 628.93it/s]
4-echo monoexponential: 42%|████▏ | 8518/20176 [00:13<00:18, 631.25it/s]
4-echo monoexponential: 43%|████▎ | 8582/20176 [00:13<00:18, 611.23it/s]
4-echo monoexponential: 43%|████▎ | 8644/20176 [00:13<00:19, 605.06it/s]
4-echo monoexponential: 43%|████▎ | 8705/20176 [00:13<00:19, 602.47it/s]
4-echo monoexponential: 43%|████▎ | 8769/20176 [00:14<00:18, 612.73it/s]
4-echo monoexponential: 44%|████▍ | 8834/20176 [00:14<00:18, 622.63it/s]
4-echo monoexponential: 44%|████▍ | 8897/20176 [00:14<00:18, 621.49it/s]
4-echo monoexponential: 44%|████▍ | 8960/20176 [00:14<00:18, 621.64it/s]
4-echo monoexponential: 45%|████▍ | 9027/20176 [00:14<00:17, 633.33it/s]
4-echo monoexponential: 45%|████▌ | 9091/20176 [00:14<00:17, 629.36it/s]
4-echo monoexponential: 45%|████▌ | 9158/20176 [00:14<00:17, 640.89it/s]
4-echo monoexponential: 46%|████▌ | 9226/20176 [00:14<00:16, 649.94it/s]
4-echo monoexponential: 46%|████▌ | 9292/20176 [00:14<00:16, 649.45it/s]
4-echo monoexponential: 46%|████▋ | 9357/20176 [00:14<00:16, 641.75it/s]
4-echo monoexponential: 47%|████▋ | 9422/20176 [00:15<00:17, 630.64it/s]
4-echo monoexponential: 47%|████▋ | 9486/20176 [00:15<00:17, 623.52it/s]
4-echo monoexponential: 47%|████▋ | 9549/20176 [00:15<00:17, 621.88it/s]
4-echo monoexponential: 48%|████▊ | 9612/20176 [00:15<00:16, 622.58it/s]
4-echo monoexponential: 48%|████▊ | 9675/20176 [00:15<00:16, 622.91it/s]
4-echo monoexponential: 48%|████▊ | 9740/20176 [00:15<00:16, 626.60it/s]
4-echo monoexponential: 49%|████▊ | 9804/20176 [00:15<00:16, 627.26it/s]
4-echo monoexponential: 49%|████▉ | 9867/20176 [00:15<00:16, 625.09it/s]
4-echo monoexponential: 49%|████▉ | 9930/20176 [00:15<00:16, 620.18it/s]
4-echo monoexponential: 50%|████▉ | 9998/20176 [00:16<00:15, 636.79it/s]
4-echo monoexponential: 50%|████▉ | 10064/20176 [00:16<00:15, 641.83it/s]
4-echo monoexponential: 50%|█████ | 10129/20176 [00:16<00:15, 634.88it/s]
4-echo monoexponential: 51%|█████ | 10193/20176 [00:16<00:16, 619.81it/s]
4-echo monoexponential: 51%|█████ | 10256/20176 [00:16<00:16, 617.58it/s]
4-echo monoexponential: 51%|█████ | 10318/20176 [00:16<00:16, 616.09it/s]
4-echo monoexponential: 51%|█████▏ | 10382/20176 [00:16<00:15, 620.44it/s]
4-echo monoexponential: 52%|█████▏ | 10445/20176 [00:16<00:15, 620.48it/s]
4-echo monoexponential: 52%|█████▏ | 10511/20176 [00:16<00:15, 630.71it/s]
4-echo monoexponential: 52%|█████▏ | 10579/20176 [00:16<00:14, 645.01it/s]
4-echo monoexponential: 53%|█████▎ | 10644/20176 [00:17<00:15, 631.51it/s]
4-echo monoexponential: 53%|█████▎ | 10708/20176 [00:17<00:14, 633.66it/s]
4-echo monoexponential: 53%|█████▎ | 10775/20176 [00:17<00:14, 643.02it/s]
4-echo monoexponential: 54%|█████▎ | 10840/20176 [00:17<00:14, 643.07it/s]
4-echo monoexponential: 54%|█████▍ | 10905/20176 [00:17<00:14, 638.32it/s]
4-echo monoexponential: 54%|█████▍ | 10969/20176 [00:17<00:14, 615.94it/s]
4-echo monoexponential: 55%|█████▍ | 11031/20176 [00:17<00:15, 605.82it/s]
4-echo monoexponential: 55%|█████▍ | 11092/20176 [00:17<00:14, 606.90it/s]
4-echo monoexponential: 55%|█████▌ | 11155/20176 [00:17<00:14, 610.77it/s]
4-echo monoexponential: 56%|█████▌ | 11224/20176 [00:17<00:14, 632.45it/s]
4-echo monoexponential: 56%|█████▌ | 11291/20176 [00:18<00:13, 642.70it/s]
4-echo monoexponential: 56%|█████▋ | 11356/20176 [00:18<00:13, 639.56it/s]
4-echo monoexponential: 57%|█████▋ | 11421/20176 [00:18<00:13, 641.09it/s]
4-echo monoexponential: 57%|█████▋ | 11488/20176 [00:18<00:13, 648.16it/s]
4-echo monoexponential: 57%|█████▋ | 11553/20176 [00:18<00:13, 648.62it/s]
4-echo monoexponential: 58%|█████▊ | 11620/20176 [00:18<00:13, 652.97it/s]
4-echo monoexponential: 58%|█████▊ | 11686/20176 [00:18<00:13, 652.98it/s]
4-echo monoexponential: 58%|█████▊ | 11752/20176 [00:18<00:13, 601.82it/s]
4-echo monoexponential: 59%|█████▊ | 11813/20176 [00:18<00:14, 588.27it/s]
4-echo monoexponential: 59%|█████▉ | 11876/20176 [00:19<00:13, 596.31it/s]
4-echo monoexponential: 59%|█████▉ | 11940/20176 [00:19<00:13, 607.02it/s]
4-echo monoexponential: 59%|█████▉ | 12004/20176 [00:19<00:13, 614.56it/s]
4-echo monoexponential: 60%|█████▉ | 12066/20176 [00:19<00:13, 616.07it/s]
4-echo monoexponential: 60%|██████ | 12134/20176 [00:19<00:12, 631.49it/s]
4-echo monoexponential: 60%|██████ | 12199/20176 [00:19<00:12, 635.64it/s]
4-echo monoexponential: 61%|██████ | 12267/20176 [00:19<00:12, 646.32it/s]
4-echo monoexponential: 61%|██████ | 12333/20176 [00:19<00:12, 650.35it/s]
4-echo monoexponential: 61%|██████▏ | 12399/20176 [00:19<00:11, 650.26it/s]
4-echo monoexponential: 62%|██████▏ | 12465/20176 [00:19<00:11, 647.94it/s]
4-echo monoexponential: 62%|██████▏ | 12530/20176 [00:20<00:11, 639.18it/s]
4-echo monoexponential: 62%|██████▏ | 12594/20176 [00:20<00:12, 601.81it/s]
4-echo monoexponential: 63%|██████▎ | 12659/20176 [00:20<00:12, 613.15it/s]
4-echo monoexponential: 63%|██████▎ | 12723/20176 [00:20<00:12, 620.51it/s]
4-echo monoexponential: 63%|██████▎ | 12789/20176 [00:20<00:11, 630.77it/s]
4-echo monoexponential: 64%|██████▎ | 12856/20176 [00:20<00:11, 640.53it/s]
4-echo monoexponential: 64%|██████▍ | 12922/20176 [00:20<00:11, 645.75it/s]
4-echo monoexponential: 64%|██████▍ | 12987/20176 [00:20<00:11, 643.89it/s]
4-echo monoexponential: 65%|██████▍ | 13055/20176 [00:20<00:10, 652.94it/s]
4-echo monoexponential: 65%|██████▌ | 13121/20176 [00:20<00:10, 648.25it/s]
4-echo monoexponential: 65%|██████▌ | 13186/20176 [00:21<00:10, 642.94it/s]
4-echo monoexponential: 66%|██████▌ | 13251/20176 [00:21<00:10, 640.89it/s]
4-echo monoexponential: 66%|██████▌ | 13316/20176 [00:21<00:10, 631.58it/s]
4-echo monoexponential: 66%|██████▋ | 13380/20176 [00:21<00:11, 607.42it/s]
4-echo monoexponential: 67%|██████▋ | 13443/20176 [00:21<00:10, 613.34it/s]
4-echo monoexponential: 67%|██████▋ | 13506/20176 [00:21<00:10, 616.39it/s]
4-echo monoexponential: 67%|██████▋ | 13568/20176 [00:21<00:10, 616.40it/s]
4-echo monoexponential: 68%|██████▊ | 13636/20176 [00:21<00:10, 631.52it/s]
4-echo monoexponential: 68%|██████▊ | 13702/20176 [00:21<00:10, 639.18it/s]
4-echo monoexponential: 68%|██████▊ | 13769/20176 [00:22<00:09, 646.29it/s]
4-echo monoexponential: 69%|██████▊ | 13835/20176 [00:22<00:09, 648.54it/s]
4-echo monoexponential: 69%|██████▉ | 13900/20176 [00:22<00:09, 647.89it/s]
4-echo monoexponential: 69%|██████▉ | 13966/20176 [00:22<00:09, 649.82it/s]
4-echo monoexponential: 70%|██████▉ | 14032/20176 [00:22<00:09, 649.01it/s]
4-echo monoexponential: 70%|██████▉ | 14097/20176 [00:22<00:09, 643.25it/s]
4-echo monoexponential: 70%|███████ | 14162/20176 [00:22<00:09, 612.61it/s]
4-echo monoexponential: 70%|███████ | 14224/20176 [00:22<00:09, 609.19it/s]
4-echo monoexponential: 71%|███████ | 14290/20176 [00:22<00:09, 622.69it/s]
4-echo monoexponential: 71%|███████ | 14353/20176 [00:22<00:09, 623.20it/s]
4-echo monoexponential: 71%|███████▏ | 14421/20176 [00:23<00:09, 637.03it/s]
4-echo monoexponential: 72%|███████▏ | 14491/20176 [00:23<00:08, 654.21it/s]
4-echo monoexponential: 72%|███████▏ | 14557/20176 [00:23<00:08, 652.93it/s]
4-echo monoexponential: 72%|███████▏ | 14623/20176 [00:23<00:08, 645.02it/s]
4-echo monoexponential: 73%|███████▎ | 14688/20176 [00:23<00:08, 642.89it/s]
4-echo monoexponential: 73%|███████▎ | 14753/20176 [00:23<00:08, 630.86it/s]
4-echo monoexponential: 73%|███████▎ | 14817/20176 [00:23<00:08, 629.19it/s]
4-echo monoexponential: 74%|███████▍ | 14880/20176 [00:23<00:08, 607.93it/s]
4-echo monoexponential: 74%|███████▍ | 14946/20176 [00:23<00:08, 620.45it/s]
4-echo monoexponential: 74%|███████▍ | 15009/20176 [00:23<00:08, 622.84it/s]
4-echo monoexponential: 75%|███████▍ | 15072/20176 [00:24<00:08, 623.44it/s]
4-echo monoexponential: 75%|███████▌ | 15139/20176 [00:24<00:07, 636.87it/s]
4-echo monoexponential: 75%|███████▌ | 15203/20176 [00:24<00:07, 634.03it/s]
4-echo monoexponential: 76%|███████▌ | 15269/20176 [00:24<00:07, 639.71it/s]
4-echo monoexponential: 76%|███████▌ | 15336/20176 [00:24<00:07, 647.33it/s]
4-echo monoexponential: 76%|███████▋ | 15401/20176 [00:24<00:07, 645.34it/s]
4-echo monoexponential: 77%|███████▋ | 15467/20176 [00:24<00:07, 647.11it/s]
4-echo monoexponential: 77%|███████▋ | 15532/20176 [00:24<00:07, 642.99it/s]
4-echo monoexponential: 77%|███████▋ | 15597/20176 [00:24<00:07, 620.73it/s]
4-echo monoexponential: 78%|███████▊ | 15661/20176 [00:24<00:07, 625.18it/s]
4-echo monoexponential: 78%|███████▊ | 15725/20176 [00:25<00:07, 629.14it/s]
4-echo monoexponential: 78%|███████▊ | 15789/20176 [00:25<00:07, 620.25it/s]
4-echo monoexponential: 79%|███████▊ | 15852/20176 [00:25<00:07, 615.27it/s]
4-echo monoexponential: 79%|███████▉ | 15918/20176 [00:25<00:06, 626.92it/s]
4-echo monoexponential: 79%|███████▉ | 15984/20176 [00:25<00:06, 636.41it/s]
4-echo monoexponential: 80%|███████▉ | 16051/20176 [00:25<00:06, 645.69it/s]
4-echo monoexponential: 80%|███████▉ | 16116/20176 [00:25<00:06, 646.55it/s]
4-echo monoexponential: 80%|████████ | 16181/20176 [00:25<00:06, 638.33it/s]
4-echo monoexponential: 81%|████████ | 16246/20176 [00:25<00:06, 641.21it/s]
4-echo monoexponential: 81%|████████ | 16311/20176 [00:26<00:06, 616.12it/s]
4-echo monoexponential: 81%|████████ | 16373/20176 [00:26<00:06, 608.08it/s]
4-echo monoexponential: 81%|████████▏ | 16436/20176 [00:26<00:06, 612.87it/s]
4-echo monoexponential: 82%|████████▏ | 16498/20176 [00:26<00:06, 607.31it/s]
4-echo monoexponential: 82%|████████▏ | 16561/20176 [00:26<00:05, 611.65it/s]
4-echo monoexponential: 82%|████████▏ | 16625/20176 [00:26<00:05, 619.19it/s]
4-echo monoexponential: 83%|████████▎ | 16692/20176 [00:26<00:05, 631.38it/s]
4-echo monoexponential: 83%|████████▎ | 16760/20176 [00:26<00:05, 643.73it/s]
4-echo monoexponential: 83%|████████▎ | 16825/20176 [00:26<00:05, 642.10it/s]
4-echo monoexponential: 84%|████████▎ | 16890/20176 [00:26<00:05, 639.20it/s]
4-echo monoexponential: 84%|████████▍ | 16954/20176 [00:27<00:05, 639.06it/s]
4-echo monoexponential: 84%|████████▍ | 17018/20176 [00:27<00:05, 602.52it/s]
4-echo monoexponential: 85%|████████▍ | 17082/20176 [00:27<00:05, 612.28it/s]
4-echo monoexponential: 85%|████████▍ | 17144/20176 [00:27<00:04, 613.86it/s]
4-echo monoexponential: 85%|████████▌ | 17206/20176 [00:27<00:04, 604.17it/s]
4-echo monoexponential: 86%|████████▌ | 17269/20176 [00:27<00:04, 611.61it/s]
4-echo monoexponential: 86%|████████▌ | 17331/20176 [00:27<00:04, 607.21it/s]
4-echo monoexponential: 86%|████████▌ | 17398/20176 [00:27<00:04, 624.29it/s]
4-echo monoexponential: 87%|████████▋ | 17463/20176 [00:27<00:04, 629.56it/s]
4-echo monoexponential: 87%|████████▋ | 17527/20176 [00:27<00:04, 623.08it/s]
4-echo monoexponential: 87%|████████▋ | 17591/20176 [00:28<00:04, 627.04it/s]
4-echo monoexponential: 88%|████████▊ | 17654/20176 [00:28<00:04, 596.70it/s]
4-echo monoexponential: 88%|████████▊ | 17717/20176 [00:28<00:04, 605.32it/s]
4-echo monoexponential: 88%|████████▊ | 17778/20176 [00:28<00:04, 597.30it/s]
4-echo monoexponential: 88%|████████▊ | 17841/20176 [00:28<00:03, 604.58it/s]
4-echo monoexponential: 89%|████████▊ | 17903/20176 [00:28<00:03, 607.70it/s]
4-echo monoexponential: 89%|████████▉ | 17970/20176 [00:28<00:03, 624.38it/s]
4-echo monoexponential: 89%|████████▉ | 18039/20176 [00:28<00:03, 642.45it/s]
4-echo monoexponential: 90%|████████▉ | 18104/20176 [00:28<00:03, 639.89it/s]
4-echo monoexponential: 90%|█████████ | 18169/20176 [00:29<00:03, 626.76it/s]
4-echo monoexponential: 90%|█████████ | 18232/20176 [00:29<00:03, 610.80it/s]
4-echo monoexponential: 91%|█████████ | 18294/20176 [00:29<00:03, 590.90it/s]
4-echo monoexponential: 91%|█████████ | 18355/20176 [00:29<00:03, 595.25it/s]
4-echo monoexponential: 91%|█████████▏| 18415/20176 [00:29<00:02, 590.56it/s]
4-echo monoexponential: 92%|█████████▏| 18478/20176 [00:29<00:02, 600.01it/s]
4-echo monoexponential: 92%|█████████▏| 18542/20176 [00:29<00:02, 608.78it/s]
4-echo monoexponential: 92%|█████████▏| 18606/20176 [00:29<00:02, 617.90it/s]
4-echo monoexponential: 93%|█████████▎| 18670/20176 [00:29<00:02, 621.12it/s]
4-echo monoexponential: 93%|█████████▎| 18733/20176 [00:29<00:02, 606.28it/s]
4-echo monoexponential: 93%|█████████▎| 18794/20176 [00:30<00:02, 593.45it/s]
4-echo monoexponential: 93%|█████████▎| 18854/20176 [00:30<00:02, 552.57it/s]
4-echo monoexponential: 94%|█████████▎| 18913/20176 [00:30<00:02, 562.36it/s]
4-echo monoexponential: 94%|█████████▍| 18978/20176 [00:30<00:02, 584.36it/s]
4-echo monoexponential: 94%|█████████▍| 19045/20176 [00:30<00:01, 606.68it/s]
4-echo monoexponential: 95%|█████████▍| 19111/20176 [00:30<00:01, 620.88it/s]
4-echo monoexponential: 95%|█████████▌| 19174/20176 [00:30<00:01, 610.59it/s]
4-echo monoexponential: 95%|█████████▌| 19236/20176 [00:30<00:01, 597.36it/s]
4-echo monoexponential: 96%|█████████▌| 19296/20176 [00:30<00:01, 594.49it/s]
4-echo monoexponential: 96%|█████████▌| 19356/20176 [00:31<00:01, 590.06it/s]
4-echo monoexponential: 96%|█████████▌| 19416/20176 [00:31<00:01, 590.49it/s]
4-echo monoexponential: 97%|█████████▋| 19479/20176 [00:31<00:01, 600.35it/s]
4-echo monoexponential: 97%|█████████▋| 19541/20176 [00:31<00:01, 604.50it/s]
4-echo monoexponential: 97%|█████████▋| 19602/20176 [00:31<00:00, 605.52it/s]
4-echo monoexponential: 97%|█████████▋| 19663/20176 [00:31<00:00, 605.61it/s]
4-echo monoexponential: 98%|█████████▊| 19729/20176 [00:31<00:00, 619.76it/s]
4-echo monoexponential: 98%|█████████▊| 19797/20176 [00:31<00:00, 634.96it/s]
4-echo monoexponential: 98%|█████████▊| 19861/20176 [00:31<00:00, 617.54it/s]
4-echo monoexponential: 99%|█████████▊| 19923/20176 [00:31<00:00, 603.86it/s]
4-echo monoexponential: 99%|█████████▉| 19984/20176 [00:32<00:00, 598.83it/s]
4-echo monoexponential: 99%|█████████▉| 20044/20176 [00:32<00:00, 597.61it/s]
4-echo monoexponential: 100%|█████████▉| 20104/20176 [00:32<00:00, 594.84it/s]
4-echo monoexponential: 100%|█████████▉| 20164/20176 [00:32<00:00, 593.53it/s]
4-echo monoexponential: 100%|██████████| 20176/20176 [00:32<00:00, 623.07it/s]
INFO t2smap:t2smap_workflow:370 Calculating model fit quality metrics
/opt/hostedtoolcache/Python/3.10.18/x64/lib/python3.10/site-packages/tedana/decay.py:541: RuntimeWarning: Mean of empty slice
rmse_map = np.nanmean(rmse, axis=1)
INFO t2smap:t2smap_workflow:382 Computing optimal combination
INFO combine:make_optcom:192 Optimally combining data with voxel-wise T2* estimates
INFO t2smap:t2smap_workflow:440 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.18/x64/lib/python3.10/site-packages/nilearn/plotting/img_plotting.py:1317: UserWarning: Non-finite values detected. These values will be replaced with zeros.
safe_get_data(stat_map_img, ensure_finite=True),
<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.#