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 nibabel as nb
import pandas as pd
from IPython.display import HTML, display
from book_utils import load_pafin
from tedana import workflows

data_path = os.path.abspath('../data')
/home/tsalo/micromamba/envs/meda/lib/python3.12/site-packages/requests/__init__.py:113: RequestsDependencyWarning: urllib3 (2.6.3) or chardet (7.2.0)/charset_normalizer (3.4.6) doesn't match a supported version!
  warnings.warn(
/home/tsalo/micromamba/envs/meda/lib/python3.12/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
data = load_pafin(data_path)
out_dir = os.path.join(data_path, "tedana")
workflows.tedana_workflow(
    data['echo_files'],
    data['echo_times'],
    out_dir=out_dir,
    mask=data['mask'],
    prefix="sub-24053_ses-1_task-rat_dir-PA_run-01",
    fittype="loglin",
    tedpca="mdl",
    verbose=True,
    gscontrol=["mir"],
    overwrite=True,
)

Hide code cell output

INFO     tedana:tedana_workflow:636 Using output directory: /mnt/c/Users/tsalo/Documents/ME-ICA/multi-echo-data-analysis/data/tedana
INFO     utils:check_te_values:792 TE values appear to be in seconds. Converting to milliseconds for internal use.
INFO     tedana:tedana_workflow:655 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__:345 Performing component selection with tedana_orig_decision_tree
INFO     component_selector:__init__:346 Very similar to the decision tree designed by Prantik Kundu
INFO     utils:load_mask:916 Using user-defined mask
INFO     tedana:tedana_workflow:690 Loading input data: ['/mnt/c/Users/tsalo/Documents/ME-ICA/multi-echo-data-analysis/data/ds006185/sub-24053/ses-1/func/sub-24053_ses-1_task-rat_dir-PA_run-01_echo-1_part-mag_desc-preproc_bold.nii.gz', '/mnt/c/Users/tsalo/Documents/ME-ICA/multi-echo-data-analysis/data/ds006185/sub-24053/ses-1/func/sub-24053_ses-1_task-rat_dir-PA_run-01_echo-2_part-mag_desc-preproc_bold.nii.gz', '/mnt/c/Users/tsalo/Documents/ME-ICA/multi-echo-data-analysis/data/ds006185/sub-24053/ses-1/func/sub-24053_ses-1_task-rat_dir-PA_run-01_echo-3_part-mag_desc-preproc_bold.nii.gz', '/mnt/c/Users/tsalo/Documents/ME-ICA/multi-echo-data-analysis/data/ds006185/sub-24053/ses-1/func/sub-24053_ses-1_task-rat_dir-PA_run-01_echo-4_part-mag_desc-preproc_bold.nii.gz', '/mnt/c/Users/tsalo/Documents/ME-ICA/multi-echo-data-analysis/data/ds006185/sub-24053/ses-1/func/sub-24053_ses-1_task-rat_dir-PA_run-01_echo-5_part-mag_desc-preproc_bold.nii.gz']
INFO     utils:make_adaptive_mask:167 Echo-wise intensity thresholds for adaptive mask: [5390.2476 3376.5105 1811.7682 1076.2314  610.8774]
WARNING  utils:make_adaptive_mask:195 9757 voxels in user-defined mask do not have good signal. Removing voxels from mask.
INFO     tedana:tedana_workflow:777 Computing T2* map
INFO     combine:make_optcom:202 Optimally combining data with voxel-wise T2* estimates
INFO     tedana:tedana_workflow:856 Writing optimally combined data set: /mnt/c/Users/tsalo/Documents/ME-ICA/multi-echo-data-analysis/data/tedana/sub-24053_ses-1_task-rat_dir-PA_run-01_desc-optcom_bold.nii.gz
INFO     pca:tedpca:212 Computing PCA of optimally combined multi-echo data with selection criteria: mdl
INFO     pca:tedpca:254 Optimal number of components based on different criteria:
INFO     pca:tedpca:255 AIC: 132 | KIC: 115 | MDL: 73 | 90% varexp: 209 | 95% varexp: 281
INFO     pca:tedpca:260 Explained variance based on different criteria:
INFO     pca:tedpca:261 AIC: 83.7% | KIC: 82.0% | MDL: 77.1% | 90% varexp: 90.0% | 95% varexp: 95.1%
INFO     pca:tedpca:281 Plotting maPCA optimization curves
INFO     collect:generate_metrics:153 Calculating standardized parameter estimate maps for optimally combined data
INFO     collect:generate_metrics:171 Calculating unstandardized parameter estimate maps for optimally combined data
INFO     collect:generate_metrics:203 Calculating F-statistic maps
INFO     collect:generate_metrics:229 Thresholding standardized parameter estimate maps
INFO     collect:generate_metrics:237 Thresholding T2* F-statistic maps
INFO     collect:generate_metrics:245 Thresholding S0 F-statistic maps
INFO     collect:generate_metrics:254 Counting significant voxels in T2* F-statistic maps
INFO     collect:generate_metrics:260 Counting significant voxels in S0 F-statistic maps
INFO     collect:generate_metrics:267 Thresholding optimal combination beta maps to match T2* F-statistic maps
INFO     collect:generate_metrics:275 Thresholding optimal combination beta maps to match S0 F-statistic maps
INFO     collect:generate_metrics:284 Calculating kappa and rho
INFO     collect:generate_metrics:293 Calculating variance explained
INFO     collect:generate_metrics:299 Calculating normalized variance explained
INFO     collect:generate_metrics:328 Calculating DSI between thresholded T2* F-statistic and optimal combination beta maps
INFO     collect:generate_metrics:338 Calculating DSI between thresholded S0 F-statistic and optimal combination beta maps
INFO     collect:generate_metrics:349 Calculating signal-noise t-statistics
/home/tsalo/micromamba/envs/meda/lib/python3.12/site-packages/tedana/metrics/dependence.py:779: SmallSampleWarning: One or more sample arguments is too small; all returned values will be NaN. See documentation for sample size requirements.
  signal_minus_noise_t[i_comp], signal_minus_noise_p[i_comp] = stats.ttest_ind(
INFO     collect:generate_metrics:385 Counting significant noise voxels from z-statistic maps
INFO     collect:generate_metrics:398 Calculating decision table score
INFO     pca:tedpca:425 Selected 73 components with 77.13% normalized variance explained using mdl dimensionality estimate
INFO     ica:f_ica:360 ICA with random seed 42 converged in 87 iterations
INFO     collect:generate_metrics:153 Calculating standardized parameter estimate maps for optimally combined data
INFO     collect:generate_metrics:171 Calculating unstandardized parameter estimate maps for optimally combined data
INFO     collect:generate_metrics:203 Calculating F-statistic maps
INFO     collect:generate_metrics:229 Thresholding standardized parameter estimate maps
INFO     collect:generate_metrics:237 Thresholding T2* F-statistic maps
INFO     collect:generate_metrics:245 Thresholding S0 F-statistic maps
INFO     collect:generate_metrics:254 Counting significant voxels in T2* F-statistic maps
INFO     collect:generate_metrics:260 Counting significant voxels in S0 F-statistic maps
INFO     collect:generate_metrics:267 Thresholding optimal combination beta maps to match T2* F-statistic maps
INFO     collect:generate_metrics:275 Thresholding optimal combination beta maps to match S0 F-statistic maps
INFO     collect:generate_metrics:284 Calculating kappa and rho
INFO     collect:generate_metrics:293 Calculating variance explained
INFO     collect:generate_metrics:299 Calculating normalized variance explained
INFO     collect:generate_metrics:328 Calculating DSI between thresholded T2* F-statistic and optimal combination beta maps
WARNING  utils:dice:317 1 of 73 components have empty maps, resulting in Dice values of 0. Please check your component table for dice columns with 0-values.
INFO     collect:generate_metrics:338 Calculating DSI between thresholded S0 F-statistic and optimal combination beta maps
INFO     collect:generate_metrics:349 Calculating signal-noise t-statistics
/home/tsalo/micromamba/envs/meda/lib/python3.12/site-packages/tedana/metrics/dependence.py:779: SmallSampleWarning: One or more sample arguments is too small; all returned values will be NaN. See documentation for sample size requirements.
  signal_minus_noise_t[i_comp], signal_minus_noise_p[i_comp] = stats.ttest_ind(
INFO     collect:generate_metrics:385 Counting significant noise voxels from z-statistic maps
INFO     collect:generate_metrics:398 Calculating decision table score
INFO     tedana:tedana_workflow:930 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 73 components. 73 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: 73 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 73 components. 27 True -> rejected. 46 False -> nochange.
INFO     selection_utils:log_classification_counts:492 Step 1: Total component classifications: 27 rejected, 46 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 73 components. 17 True -> rejected. 56 False -> nochange.
INFO     selection_utils:log_classification_counts:492 Step 2: Total component classifications: 31 rejected, 42 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.47028899176846983
INFO     selection_utils:log_classification_counts:492 Step 3: Total component classifications: 31 rejected, 42 unclassified
INFO     selection_nodes:dec_left_op_right:389 Step 4: left_op_right: rejected if ['dice_FS0>dice_FT2 & variance explained>0.47'], else nochange
INFO     selection_utils:log_decision_tree_step:447 Step 4: left_op_right applied to 73 components. 11 True -> rejected. 62 False -> nochange.
INFO     selection_utils:log_classification_counts:492 Step 4: Total component classifications: 35 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.47'], else nochange
INFO     selection_utils:log_decision_tree_step:447 Step 5: left_op_right applied to 73 components. 1 True -> rejected. 72 False -> nochange.
INFO     selection_utils:log_classification_counts:492 Step 5: Total component classifications: 36 rejected, 37 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=11.310666581421028, kappa_allcomps_elbow=16.702084005282682, kappa_nonsig_elbow=11.310666581421028, varex_upper_p=0.5872752143921612
INFO     selection_utils:log_classification_counts:492 Step 6: Total component classifications: 36 rejected, 37 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 37 components. 6 True -> unclass_highvar. 31 False -> nochange.
INFO     selection_utils:log_classification_counts:492 Step 7: Total component classifications: 36 rejected, 6 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=9.802458887175664, rho_allcomps_elbow=13.617278428853632, rho_unclassified_elbow=8.081450810496575, elbow_f05=7.708647422176786
INFO     selection_utils:log_classification_counts:492 Step 8: Total component classifications: 36 rejected, 6 unclass_highvar, 31 unclassified
INFO     selection_nodes:dec_left_op_right:389 Step 9: left_op_right: provisionalaccept if kappa>=11.31, else nochange
INFO     selection_utils:log_decision_tree_step:447 Step 9: left_op_right applied to 31 components. 23 True -> provisionalaccept. 8 False -> nochange.
INFO     selection_utils:log_classification_counts:492 Step 9: Total component classifications: 23 provisionalaccept, 36 rejected, 6 unclass_highvar, 8 unclassified
INFO     selection_nodes:dec_left_op_right:389 Step 10: left_op_right: unclassified if rho>9.8, else nochange
INFO     selection_utils:log_decision_tree_step:447 Step 10: left_op_right applied to 23 components. 1 True -> unclassified. 22 False -> nochange.
INFO     selection_utils:log_classification_counts:492 Step 10: Total component classifications: 22 provisionalaccept, 36 rejected, 6 unclass_highvar, 9 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 37 components. None True -> 0. None False -> 37.
INFO     selection_utils:log_classification_counts:492 Step 11: Total component classifications: 22 provisionalaccept, 36 rejected, 6 unclass_highvar, 9 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=0.6990443797250097, upper_perc=90
INFO     selection_utils:log_classification_counts:492 Step 12: Total component classifications: 22 provisionalaccept, 36 rejected, 6 unclass_highvar, 9 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.2990793988325716, lower_perc=25
INFO     selection_utils:log_classification_counts:492 Step 13: Total component classifications: 22 provisionalaccept, 36 rejected, 6 unclass_highvar, 9 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: 22 provisionalaccept, 36 rejected, 6 unclass_highvar, 9 unclassified
INFO     selection_utils:log_decision_tree_step:459 Step 15: calc_max_good_meanmetricrank calculated: max_good_meanmetricrank=44.0
INFO     selection_utils:log_classification_counts:492 Step 15: Total component classifications: 22 provisionalaccept, 36 rejected, 6 unclass_highvar, 9 unclassified
INFO     selection_utils:log_decision_tree_step:459 Step 16: calc_varex_kappa_ratio calculated: kappa_rate=53.61661004956319
INFO     selection_utils:log_classification_counts:492 Step 16: Total component classifications: 22 provisionalaccept, 36 rejected, 6 unclass_highvar, 9 unclassified
INFO     selection_nodes:dec_left_op_right:389 Step 17: left_op_right: rejected if ['d_table_score>44.0 & variance explained>2.0*0.7'], 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 37 components. 0 True -> rejected. 37 False -> nochange.
INFO     selection_utils:log_classification_counts:492 Step 17: Total component classifications: 22 provisionalaccept, 36 rejected, 6 unclass_highvar, 9 unclassified
INFO     selection_nodes:dec_left_op_right:389 Step 18: left_op_right: accepted if ['d_table_score>44.0 & variance explained<=0.3 & kappa<=11.31'], 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 37 components. 6 True -> accepted. 31 False -> nochange.
INFO     selection_utils:log_classification_counts:492 Step 18: Total component classifications: 6 accepted, 21 provisionalaccept, 36 rejected, 6 unclass_highvar, 4 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 31 components. None True -> 0. None False -> 31.
INFO     selection_utils:log_classification_counts:492 Step 19: Total component classifications: 6 accepted, 21 provisionalaccept, 36 rejected, 6 unclass_highvar, 4 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=25, conservative_guess=12.5, restrict_factor=2
INFO     selection_utils:log_classification_counts:492 Step 20: Total component classifications: 6 accepted, 21 provisionalaccept, 36 rejected, 6 unclass_highvar, 4 unclassified
INFO     selection_nodes:dec_left_op_right:389 Step 21: left_op_right: rejected if ['d_table_score_node20>12.5 & varex kappa ratio>2*2.0 & variance explained>2.0*0.7'], else nochange
INFO     selection_nodes:dec_left_op_right:391 Step 21: left_op_right Reject if a combination of kappa, variance, and other factors are ranked worse than others
INFO     selection_utils:log_decision_tree_step:447 Step 21: left_op_right applied to 31 components. 6 True -> rejected. 25 False -> nochange.
INFO     selection_utils:log_classification_counts:492 Step 21: Total component classifications: 6 accepted, 21 provisionalaccept, 42 rejected, 4 unclassified
INFO     selection_nodes:dec_left_op_right:389 Step 22: left_op_right: rejected if ['d_table_score_node20>0.9*25 & variance explained>2.0*0.3'], else nochange
INFO     selection_nodes:dec_left_op_right:391 Step 22: left_op_right Reject if a combination of variance and ranks of other metrics are worse than others
INFO     selection_utils:log_decision_tree_step:447 Step 22: left_op_right applied to 25 components. 1 True -> rejected. 24 False -> nochange.
INFO     selection_utils:log_classification_counts:492 Step 22: Total component classifications: 6 accepted, 20 provisionalaccept, 43 rejected, 4 unclassified
INFO     selection_nodes:calc_varex_thresh:1328 Step 23: calc_varex_thresh: Calc varex_new_lower_thresh, 25th percentile threshold
INFO     selection_nodes:calc_varex_thresh:1352 Step 23: calc_varex_thresh: num_highest_var_comps (25) > len(comps2use) (24). Setting to equal len(comps2use) since selection should not use more components than exist
INFO     selection_utils:log_decision_tree_step:459 Step 23: calc_varex_thresh calculated: varex_new_lower_thresh=0.3160662661721715, new_lower_perc=25
INFO     selection_utils:log_classification_counts:492 Step 23: Total component classifications: 6 accepted, 20 provisionalaccept, 43 rejected, 4 unclassified
INFO     selection_nodes:dec_left_op_right:389 Step 24: left_op_right: accepted if ['d_table_score_node20>25 & variance explained>0.32'], 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 24 components. 2 True -> accepted. 22 False -> nochange.
INFO     selection_utils:log_classification_counts:492 Step 24: Total component classifications: 8 accepted, 20 provisionalaccept, 43 rejected, 2 unclassified
INFO     selection_nodes:dec_left_op_right:389 Step 25: left_op_right: accepted if ['kappa<=11.31 & variance explained>0.32'], 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 22 components. 0 True -> accepted. 22 False -> nochange.
INFO     selection_utils:log_classification_counts:492 Step 25: Total component classifications: 8 accepted, 20 provisionalaccept, 43 rejected, 2 unclassified
INFO     selection_nodes:manual_classify:104 Step 26: manual_classify: Set ['provisionalaccept', 'unclassified', 'unclass_highvar'] to accepted 
INFO     selection_nodes:manual_classify:106 Step 26: manual_classify Anything still provisional (accepted or rejected) or unclassified should be accepted
INFO     selection_utils:comptable_classification_changer:293 Step 26: No components fit criterion False to change classification
INFO     selection_utils:log_decision_tree_step:447 Step 26: manual_classify applied to 22 components. 22 True -> accepted. 0 False -> nochange.
INFO     selection_utils:log_classification_counts:492 Step 26: Total component classifications: 30 accepted, 43 rejected
INFO     io:denoise_ts:682 Variance explained by decomposition: 84.01%
INFO     io:write_split_ts:754 Writing high-Kappa time series: /mnt/c/Users/tsalo/Documents/ME-ICA/multi-echo-data-analysis/data/tedana/sub-24053_ses-1_task-rat_dir-PA_run-01_desc-optcomAccepted_bold.nii.gz
INFO     io:write_split_ts:762 Writing low-Kappa time series: /mnt/c/Users/tsalo/Documents/ME-ICA/multi-echo-data-analysis/data/tedana/sub-24053_ses-1_task-rat_dir-PA_run-01_desc-optcomRejected_bold.nii.gz
INFO     io:write_split_ts:769 Writing denoised time series: /mnt/c/Users/tsalo/Documents/ME-ICA/multi-echo-data-analysis/data/tedana/sub-24053_ses-1_task-rat_dir-PA_run-01_desc-denoised_bold.nii.gz
INFO     io:writeresults:817 Writing full ICA coefficient feature set: /mnt/c/Users/tsalo/Documents/ME-ICA/multi-echo-data-analysis/data/tedana/sub-24053_ses-1_task-rat_dir-PA_run-01_desc-ICA_components.nii.gz
INFO     io:writeresults:824 Writing Z-normalized spatial component maps: /mnt/c/Users/tsalo/Documents/ME-ICA/multi-echo-data-analysis/data/tedana/sub-24053_ses-1_task-rat_dir-PA_run-01_desc-ICA_stat-z_components.nii.gz
INFO     io:writeresults:828 Writing denoised ICA coefficient feature set: /mnt/c/Users/tsalo/Documents/ME-ICA/multi-echo-data-analysis/data/tedana/sub-24053_ses-1_task-rat_dir-PA_run-01_desc-ICAAccepted_components.nii.gz
INFO     io:writeresults:835 Writing Z-normalized spatial component maps: /mnt/c/Users/tsalo/Documents/ME-ICA/multi-echo-data-analysis/data/tedana/sub-24053_ses-1_task-rat_dir-PA_run-01_desc-ICAAccepted_stat-z_components.nii.gz
INFO     gscontrol:minimum_image_regression:214 Performing minimum image regression to remove spatially-diffuse noise
INFO     gscontrol:minimum_image_regression:274 Variance in optimally combined data explained by T1-like global signal: 2.96%
INFO     io:writeresults_echoes:875 Writing Kappa-filtered echo #1 timeseries
INFO     io:denoise_ts:682 Variance explained by decomposition: 79.32%
INFO     io:write_split_ts:751 Writing high-Kappa time series: /mnt/c/Users/tsalo/Documents/ME-ICA/multi-echo-data-analysis/data/tedana/sub-24053_ses-1_task-rat_dir-PA_run-01_echo-1_desc-Accepted_bold.nii.gz
INFO     io:write_split_ts:759 Writing low-Kappa time series: /mnt/c/Users/tsalo/Documents/ME-ICA/multi-echo-data-analysis/data/tedana/sub-24053_ses-1_task-rat_dir-PA_run-01_echo-1_desc-Rejected_bold.nii.gz
INFO     io:write_split_ts:769 Writing denoised time series: /mnt/c/Users/tsalo/Documents/ME-ICA/multi-echo-data-analysis/data/tedana/sub-24053_ses-1_task-rat_dir-PA_run-01_echo-1_desc-Denoised_bold.nii.gz
INFO     io:writeresults_echoes:875 Writing Kappa-filtered echo #2 timeseries
INFO     io:denoise_ts:682 Variance explained by decomposition: 76.89%
INFO     io:write_split_ts:751 Writing high-Kappa time series: /mnt/c/Users/tsalo/Documents/ME-ICA/multi-echo-data-analysis/data/tedana/sub-24053_ses-1_task-rat_dir-PA_run-01_echo-2_desc-Accepted_bold.nii.gz
INFO     io:write_split_ts:759 Writing low-Kappa time series: /mnt/c/Users/tsalo/Documents/ME-ICA/multi-echo-data-analysis/data/tedana/sub-24053_ses-1_task-rat_dir-PA_run-01_echo-2_desc-Rejected_bold.nii.gz
INFO     io:write_split_ts:769 Writing denoised time series: /mnt/c/Users/tsalo/Documents/ME-ICA/multi-echo-data-analysis/data/tedana/sub-24053_ses-1_task-rat_dir-PA_run-01_echo-2_desc-Denoised_bold.nii.gz
INFO     io:writeresults_echoes:875 Writing Kappa-filtered echo #3 timeseries
INFO     io:denoise_ts:682 Variance explained by decomposition: 75.74%
INFO     io:write_split_ts:751 Writing high-Kappa time series: /mnt/c/Users/tsalo/Documents/ME-ICA/multi-echo-data-analysis/data/tedana/sub-24053_ses-1_task-rat_dir-PA_run-01_echo-3_desc-Accepted_bold.nii.gz
INFO     io:write_split_ts:759 Writing low-Kappa time series: /mnt/c/Users/tsalo/Documents/ME-ICA/multi-echo-data-analysis/data/tedana/sub-24053_ses-1_task-rat_dir-PA_run-01_echo-3_desc-Rejected_bold.nii.gz
INFO     io:write_split_ts:769 Writing denoised time series: /mnt/c/Users/tsalo/Documents/ME-ICA/multi-echo-data-analysis/data/tedana/sub-24053_ses-1_task-rat_dir-PA_run-01_echo-3_desc-Denoised_bold.nii.gz
INFO     io:writeresults_echoes:875 Writing Kappa-filtered echo #4 timeseries
INFO     io:denoise_ts:682 Variance explained by decomposition: 74.61%
INFO     io:write_split_ts:751 Writing high-Kappa time series: /mnt/c/Users/tsalo/Documents/ME-ICA/multi-echo-data-analysis/data/tedana/sub-24053_ses-1_task-rat_dir-PA_run-01_echo-4_desc-Accepted_bold.nii.gz
INFO     io:write_split_ts:759 Writing low-Kappa time series: /mnt/c/Users/tsalo/Documents/ME-ICA/multi-echo-data-analysis/data/tedana/sub-24053_ses-1_task-rat_dir-PA_run-01_echo-4_desc-Rejected_bold.nii.gz
INFO     io:write_split_ts:769 Writing denoised time series: /mnt/c/Users/tsalo/Documents/ME-ICA/multi-echo-data-analysis/data/tedana/sub-24053_ses-1_task-rat_dir-PA_run-01_echo-4_desc-Denoised_bold.nii.gz
INFO     io:writeresults_echoes:875 Writing Kappa-filtered echo #5 timeseries
INFO     io:denoise_ts:682 Variance explained by decomposition: 74.01%
INFO     io:write_split_ts:751 Writing high-Kappa time series: /mnt/c/Users/tsalo/Documents/ME-ICA/multi-echo-data-analysis/data/tedana/sub-24053_ses-1_task-rat_dir-PA_run-01_echo-5_desc-Accepted_bold.nii.gz
INFO     io:write_split_ts:759 Writing low-Kappa time series: /mnt/c/Users/tsalo/Documents/ME-ICA/multi-echo-data-analysis/data/tedana/sub-24053_ses-1_task-rat_dir-PA_run-01_echo-5_desc-Rejected_bold.nii.gz
INFO     io:write_split_ts:769 Writing denoised time series: /mnt/c/Users/tsalo/Documents/ME-ICA/multi-echo-data-analysis/data/tedana/sub-24053_ses-1_task-rat_dir-PA_run-01_echo-5_desc-Denoised_bold.nii.gz
INFO     tedana:tedana_workflow:1150 Making figures folder with static component maps and timecourse plots.
INFO     io:denoise_ts:682 Variance explained by decomposition: 84.01%
/home/tsalo/micromamba/envs/meda/lib/python3.12/site-packages/tedana/reporting/static_figures.py:734: UserWarning: Non-finite values detected. These values will be replaced with zeros.
  plotting.plot_stat_map(
INFO     tedana:tedana_workflow:1233 Generating dynamic report
INFO     html_report:_update_template_bokeh:164 Checking for adaptive mask: sub-24053_ses-1_task-rat_dir-PA_run-01_adaptive_mask.svg, exists: True
INFO     html_report:_update_template_bokeh:208 T2* files exist: True
INFO     html_report:_update_template_bokeh:209 S0 files exist: True
INFO     html_report:_update_template_bokeh:210 RMSE files exist: True
INFO     html_report:_update_template_bokeh:217 Variance files exist: False
INFO     html_report:_update_template_bokeh:223 External regressors exist: False
INFO     rica:setup_rica_report:787 Rica launcher created. Run 'python /mnt/c/Users/tsalo/Documents/ME-ICA/multi-echo-data-analysis/data/tedana/open_rica_report.py' to visualize results.
INFO     tedana:tedana_workflow:1239 Workflow completed
INFO     utils:log_newsletter_info:812 Don't forget to subscribe to the tedana newsletter for updates! This is a very low volume email list.
INFO     utils:log_newsletter_info:816 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
open_rica_report.py
sub-24053_ses-1_task-rat_dir-PA_run-01_S0map.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_T2starmap.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_dataset_description.json
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-ICAAcceptedMIRDenoised_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-ICAAccepted_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-ICAAccepted_stat-z_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-ICAAveragingWeights_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-ICACrossComponent_metrics.json
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-ICAMIRDenoised_mixing.tsv
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-ICAS0_stat-F_statmap.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-ICAT2_stat-F_statmap.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-ICA_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-ICA_decision_tree.json
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-ICA_decomposition.json
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-ICA_mixing.tsv
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-ICA_stat-z_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-ICA_status_table.tsv
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-PCAAveragingWeights_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-PCACrossComponent_metrics.json
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-PCAS0_stat-F_statmap.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-PCAT2_stat-F_statmap.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-PCA_decomposition.json
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-PCA_metrics.json
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-PCA_metrics.tsv
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-PCA_mixing.tsv
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-PCA_stat-z_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-T1likeEffect_min.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-adaptiveGoodSignal_mask.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-confounds_timeseries.tsv
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-denoised_bold.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-limited_S0map.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-limited_T2starmap.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-optcomAcceptedMIRDenoised_bold.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-optcomAccepted_bold.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-optcomMIRDenoised_bold.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-optcomRejected_bold.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-optcom_bold.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-optcom_whitened_bold.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-rmse_statmap.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-tedana_metrics.json
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-tedana_metrics.tsv
sub-24053_ses-1_task-rat_dir-PA_run-01_desc-tedana_registry.json
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-1_desc-Accepted_bold.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-1_desc-Denoised_bold.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-1_desc-ICAS0ModelPredictions_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-1_desc-ICAT2ModelPredictions_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-1_desc-ICA_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-1_desc-PCAS0ModelPredictions_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-1_desc-PCAT2ModelPredictions_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-1_desc-PCA_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-1_desc-Rejected_bold.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-2_desc-Accepted_bold.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-2_desc-Denoised_bold.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-2_desc-ICAS0ModelPredictions_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-2_desc-ICAT2ModelPredictions_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-2_desc-ICA_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-2_desc-PCAS0ModelPredictions_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-2_desc-PCAT2ModelPredictions_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-2_desc-PCA_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-2_desc-Rejected_bold.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-3_desc-Accepted_bold.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-3_desc-Denoised_bold.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-3_desc-ICAS0ModelPredictions_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-3_desc-ICAT2ModelPredictions_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-3_desc-ICA_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-3_desc-PCAS0ModelPredictions_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-3_desc-PCAT2ModelPredictions_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-3_desc-PCA_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-3_desc-Rejected_bold.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-4_desc-Accepted_bold.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-4_desc-Denoised_bold.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-4_desc-ICAS0ModelPredictions_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-4_desc-ICAT2ModelPredictions_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-4_desc-ICA_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-4_desc-PCAS0ModelPredictions_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-4_desc-PCAT2ModelPredictions_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-4_desc-PCA_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-4_desc-Rejected_bold.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-5_desc-Accepted_bold.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-5_desc-Denoised_bold.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-5_desc-ICAS0ModelPredictions_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-5_desc-ICAT2ModelPredictions_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-5_desc-ICA_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-5_desc-PCAS0ModelPredictions_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-5_desc-PCAT2ModelPredictions_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-5_desc-PCA_components.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_echo-5_desc-Rejected_bold.nii.gz
sub-24053_ses-1_task-rat_dir-PA_run-01_references.bib
sub-24053_ses-1_task-rat_dir-PA_run-01_report.txt
sub-24053_ses-1_task-rat_dir-PA_run-01_report_old.txt
sub-24053_ses-1_task-rat_dir-PA_run-01_report_old_old.txt
sub-24053_ses-1_task-rat_dir-PA_run-01_report_old_old_old.txt
sub-24053_ses-1_task-rat_dir-PA_run-01_report_old_old_old_old.txt
sub-24053_ses-1_task-rat_dir-PA_run-01_report_old_old_old_old_old.txt
sub-24053_ses-1_task-rat_dir-PA_run-01_report_old_old_old_old_old_old.txt
sub-24053_ses-1_task-rat_dir-PA_run-01_report_old_old_old_old_old_old_old.txt
sub-24053_ses-1_task-rat_dir-PA_run-01_tedana_report.html
tedana_2026-03-31T165757.tsv
tedana_2026-04-01T084254.tsv
tedana_2026-04-01T091505.tsv
tedana_2026-04-01T102303.tsv
tedana_2026-04-01T124349.tsv
tedana_2026-04-01T134517.tsv
tedana_2026-04-01T144638.tsv
tedana_2026-04-01T151230.tsv
metrics = pd.read_table(
    os.path.join(out_dir, "sub-24053_ses-1_task-rat_dir-PA_run-01_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 9.592609 12.063096 0.768602 0.340238 770 1170 0.691406 0.629500 9852 0.000000 0.000000 41.800000 -1 4.296001 nan nan rejected Unlikely BOLD
1 ICA_01 26.398791 17.053341 2.558903 3.086440 14470 6965 0.390140 0.206592 9852 0.000000 0.000000 30.600000 -1 5.197196 17.000000 nan rejected Less likely BOLD
2 ICA_02 11.104476 12.893428 2.889234 1.126994 1297 784 0.551347 0.504054 9852 0.000000 0.000000 39.800000 1 13.950314 nan nan rejected Unlikely BOLD
3 ICA_03 10.618871 12.667075 1.825249 0.882938 1416 979 0.554336 0.377637 9852 0.000000 0.000000 39.400000 -1 9.216014 nan nan rejected Unlikely BOLD
4 ICA_04 8.335777 12.095820 0.760621 0.518241 410 1044 0.000000 0.498519 9852 0.000000 0.000000 59.100000 -1 4.892398 nan nan rejected Unlikely BOLD
5 ICA_05 14.959501 9.525499 0.672167 1.120608 5916 1344 0.108682 0.334950 9852 0.000000 0.000000 42.800000 1 2.409127 nan nan rejected Unlikely BOLD
6 ICA_06 8.879025 10.414320 0.752265 0.535569 604 565 0.563123 0.536723 9852 0.000000 0.000000 44.600000 1 4.542607 nan nan rejected Unlikely BOLD
7 ICA_07 19.044173 6.569479 0.358500 0.561763 7445 520 0.345060 0.000000 7881 25.923906 0.000000 20.200000 1 1.009314 15.400000 19.663344 accepted Likely BOLD
8 ICA_08 13.769305 7.204780 0.361807 0.452721 3695 732 0.137645 0.735254 9149 15.224036 0.000000 31.400000 1 1.408848 22.200000 14.778735 accepted Likely BOLD
9 ICA_09 16.702084 7.964866 0.621647 1.320624 3686 652 0.139483 0.000000 9852 0.000000 0.000000 41.800000 1 1.995597 24.800000 nan rejected Less likely BOLD
10 ICA_10 8.882325 12.101781 0.802865 0.514214 919 1421 0.472155 0.398669 9852 0.000000 0.000000 46.400000 1 4.846356 nan nan rejected Unlikely BOLD
11 ICA_11 24.884186 6.453645 0.239327 0.373056 4338 446 0.342588 0.000000 8444 33.039840 0.000000 20.200000 1 0.515664 15.000000 8.589155 accepted Likely BOLD
12 ICA_12 12.246319 12.347034 2.827091 1.056610 1257 782 0.560479 0.541100 9852 0.000000 0.000000 38.800000 -1 12.377517 nan nan rejected Unlikely BOLD
13 ICA_13 7.443414 8.569363 0.319339 0.354397 0 232 0.000000 0.000000 9852 0.000000 0.000000 61.700000 1 2.300275 nan nan rejected Unlikely BOLD
14 ICA_14 7.688928 6.570974 0.331542 0.316073 277 336 0.000000 0.000000 9852 0.000000 0.000000 60.900000 1 2.311913 nan nan rejected Unlikely BOLD
15 ICA_15 11.269102 13.237924 3.388805 1.197162 1313 1644 0.438857 0.374923 9852 0.000000 0.000000 42.600000 -1 16.123401 nan nan rejected Unlikely BOLD
16 ICA_16 36.778410 7.012462 0.728235 1.274882 16243 756 0.472632 0.000000 5173 23.078721 0.000000 8.000000 1 1.061642 5.200000 25.274542 accepted Likely BOLD
17 ICA_17 11.184613 7.462585 0.324831 0.681980 1205 113 0.000000 0.000000 9852 0.000000 0.000000 51.500000 1 1.557171 27.400000 32.827127 accepted Accept borderline
18 ICA_18 9.691719 12.266797 0.499090 0.320409 1323 1152 0.322311 0.652705 9852 0.000000 0.000000 46.200000 1 2.761070 nan nan rejected Unlikely BOLD
19 ICA_19 15.222631 18.848327 0.345116 0.695708 8092 6329 0.129887 0.198692 9517 -4.949054 0.000001 40.000000 -1 1.215555 nan nan rejected Unlikely BOLD
20 ICA_20 32.495626 6.382252 0.352883 0.687084 11697 643 0.416279 0.000000 5763 29.377390 0.000000 11.600000 -1 0.582245 8.000000 15.428320 accepted Likely BOLD
21 ICA_21 27.508820 6.627727 0.342477 0.562767 12059 607 0.448727 0.549505 6726 31.502445 0.000000 12.200000 -1 0.667512 9.000000 16.610066 accepted Likely BOLD
22 ICA_22 8.132508 11.150534 1.103184 0.561793 491 558 0.629328 0.609099 9852 0.000000 0.000000 45.800000 1 7.273154 nan nan rejected Unlikely BOLD
23 ICA_23 15.049997 6.260331 0.192144 0.380042 4428 333 0.164177 0.000000 9481 15.439914 0.000000 29.800000 1 0.684527 20.800000 11.491067 accepted Likely BOLD
24 ICA_24 26.866325 10.726354 7.298831 11.929208 28809 3951 0.455153 0.000000 9852 0.000000 0.000000 27.000000 -1 14.566138 14.200000 nan rejected Less likely BOLD
25 ICA_25 45.459733 7.650466 0.701304 0.951707 9413 1192 0.518515 0.187389 4212 32.087624 0.000000 7.000000 -1 0.827140 4.400000 11.289813 accepted Likely BOLD
26 ICA_26 12.545157 12.995376 4.408561 1.483780 1982 1044 0.515079 0.374877 9852 0.000000 0.000000 37.800000 -1 18.841701 nan nan rejected Unlikely BOLD
27 ICA_27 21.087185 13.270027 9.029004 14.079296 19979 5422 0.292056 0.107893 9726 -9.984459 0.000000 32.600000 -1 22.957288 nan nan rejected Unlikely BOLD
28 ICA_28 28.924123 18.768205 0.905946 1.576603 8506 3924 0.250839 0.221769 9852 0.000000 0.000000 34.200000 -1 1.679351 19.600000 54.813335 accepted Likely BOLD
29 ICA_29 16.315704 6.502467 0.327005 0.514787 6388 447 0.249033 0.000000 8622 18.264301 0.000000 25.200000 1 1.074601 19.000000 19.319017 accepted Likely BOLD
30 ICA_30 26.353257 6.649401 0.367208 0.619529 9740 446 0.393845 0.000000 6338 27.497160 0.000000 15.400000 1 0.747098 11.600000 18.333648 accepted Likely BOLD
31 ICA_31 9.934749 7.744468 0.236713 0.393348 1085 729 0.287431 0.716796 9852 0.000000 0.000000 48.000000 1 1.277510 nan 18.144165 accepted Low variance
32 ICA_32 8.676613 11.313043 0.665164 1.369200 1639 892 0.175514 0.000000 8791 7.495849 0.000000 38.400000 -1 4.110341 nan nan rejected Unlikely BOLD
33 ICA_33 10.176822 34.177145 3.842812 0.751295 2256 2844 0.625511 0.771830 9171 8.092881 0.000000 25.400000 -1 20.245863 nan nan rejected Unlikely BOLD
34 ICA_34 9.795763 7.880940 0.287937 0.313535 1870 730 0.208724 0.768698 9852 0.000000 0.000000 46.600000 -1 1.576011 nan 21.095895 accepted Low variance
35 ICA_35 25.193077 7.247792 1.890731 2.992457 9946 471 0.434139 0.000000 9852 0.000000 0.000000 31.600000 -1 4.023907 18.200000 nan rejected Less likely BOLD
36 ICA_36 12.690184 7.103585 0.289771 0.470755 1287 541 0.148410 0.747681 9852 0.000000 0.000000 47.200000 -1 1.224296 26.200000 21.653767 accepted Likely BOLD
37 ICA_37 9.676477 12.591106 1.666762 0.886729 1136 1117 0.486655 0.411951 9852 0.000000 0.000000 43.800000 1 9.235398 nan nan rejected Unlikely BOLD
38 ICA_38 8.547149 9.526162 0.374753 0.274694 573 830 0.661431 0.632024 9852 0.000000 0.000000 44.400000 -1 2.350842 nan nan rejected Unlikely BOLD
39 ICA_39 10.901330 7.004408 0.268166 0.335234 2468 473 0.106213 0.667391 9852 0.000000 0.000000 47.000000 -1 1.318937 nan 19.929813 accepted Low variance
40 ICA_40 9.689745 26.934865 1.288349 0.321330 1708 2627 0.650667 0.775926 9528 7.350561 0.000000 28.600000 1 7.128870 nan nan rejected Unlikely BOLD
41 ICA_41 22.183679 13.617278 0.495843 0.919115 3430 1924 0.216314 0.296474 9184 6.059253 0.000000 28.800000 -1 1.198422 nan nan rejected Unlikely BOLD
42 ICA_42 33.609802 20.676707 2.616751 2.914722 13753 7444 0.349515 0.261332 9852 0.000000 0.000000 29.400000 1 4.174417 15.800000 nan rejected Less likely BOLD
43 ICA_43 7.544725 8.609963 0.337878 0.289643 379 623 0.000000 0.632107 9852 0.000000 0.000000 60.700000 1 2.401130 nan nan rejected Unlikely BOLD
44 ICA_44 8.093991 8.685063 0.216749 0.287417 1459 586 0.158143 0.669020 9852 0.000000 0.000000 51.800000 1 1.435800 nan nan rejected Unlikely BOLD
45 ICA_45 16.626587 13.458381 0.892116 1.012116 4931 2642 0.141350 0.278281 9852 0.000000 0.000000 41.000000 -1 2.876853 nan nan rejected Unlikely BOLD
46 ICA_46 25.954867 6.795133 0.358038 0.548020 8253 551 0.450277 0.000000 6260 32.365444 0.000000 13.400000 -1 0.739622 10.000000 18.439667 accepted Likely BOLD
47 ICA_47 7.891441 8.899790 0.332700 0.291403 414 604 0.617647 0.623032 9852 0.000000 0.000000 47.400000 -1 2.260456 nan nan rejected Unlikely BOLD
48 ICA_48 7.785682 9.711550 0.389429 0.846807 618 532 0.000000 0.000000 9749 -17.067190 0.000000 58.900000 -1 2.681831 nan nan rejected Unlikely BOLD
49 ICA_49 18.753264 6.065704 0.191439 0.362230 7941 412 0.315796 0.000000 8248 22.639203 0.000000 22.200000 -1 0.547335 17.000000 5.999123 accepted Likely BOLD
50 ICA_50 8.407534 7.294649 0.177430 0.237322 434 502 0.000000 0.743028 9852 0.000000 0.000000 58.500000 -1 1.131508 nan nan rejected Unlikely BOLD
51 ICA_51 31.770896 23.334644 2.643199 2.860010 14378 7118 0.397084 0.239347 9852 0.000000 0.000000 29.200000 -1 4.460667 15.800000 nan rejected Less likely BOLD
52 ICA_52 9.148140 11.181392 0.984194 0.577639 572 765 0.000000 0.512516 9852 0.000000 0.000000 56.700000 -1 5.768294 nan nan rejected Unlikely BOLD
53 ICA_53 13.174544 6.749207 0.278165 0.590490 2035 282 0.151642 0.000000 9852 0.000000 0.000000 44.600000 1 1.132050 25.600000 11.762327 accepted Likely BOLD
54 ICA_54 32.090942 6.426100 0.470289 0.984535 11007 292 0.440908 0.000000 6660 21.552071 0.000000 13.800000 -1 0.785745 10.400000 20.221572 accepted Likely BOLD
55 ICA_55 15.173376 19.499616 12.784448 2.978705 3262 2752 0.540888 0.552815 9233 12.461495 0.000000 23.400000 1 45.175101 nan nan rejected Unlikely BOLD
56 ICA_56 9.199509 6.663263 0.189690 0.278929 864 375 0.311343 0.760375 9852 0.000000 0.000000 50.200000 -1 1.105549 nan 7.632825 accepted Low variance
57 ICA_57 29.442290 9.896503 11.818106 16.140972 29383 1879 0.478931 0.000000 9852 0.000000 0.000000 25.400000 1 21.521654 13.000000 nan rejected Less likely BOLD
58 ICA_58 16.243588 12.317011 1.956652 0.668785 6649 913 0.468556 0.543635 7691 14.541253 0.000000 20.800000 -1 6.458489 nan nan rejected Unlikely BOLD
59 ICA_59 38.333081 6.133155 0.465921 0.911580 14723 413 0.541538 0.000000 4807 30.298007 0.000000 5.200000 -1 0.651685 3.000000 22.521943 accepted Likely BOLD
60 ICA_60 46.207029 6.392247 0.842289 1.348628 13428 972 0.559075 0.020354 4556 24.176760 0.000000 5.600000 -1 0.977355 3.800000 16.383248 accepted Likely BOLD
61 ICA_61 7.895488 6.569722 0.342675 0.336026 334 339 0.000000 0.000000 9852 0.000000 0.000000 60.100000 -1 2.327037 nan nan rejected Unlikely BOLD
62 ICA_62 25.177033 6.438584 0.359714 0.497323 8044 580 0.316062 0.571429 7508 18.062819 0.000000 20.600000 -1 0.766040 16.200000 18.313138 accepted Likely BOLD
63 ICA_63 9.242266 8.081451 0.163273 0.303358 2108 412 0.058894 0.682095 9719 9.236079 0.000000 39.600000 1 0.947184 24.400000 8.406460 accepted Likely BOLD
64 ICA_64 9.450062 7.041295 0.384465 0.703733 475 284 0.182203 0.000000 9852 0.000000 0.000000 52.600000 1 2.181328 26.400000 34.092392 accepted Accept borderline
65 ICA_65 8.547493 9.402827 0.356753 0.317595 1005 811 0.390562 0.765432 9852 0.000000 0.000000 49.000000 -1 2.237835 nan nan rejected Unlikely BOLD
66 ICA_66 9.804710 6.550308 0.232428 0.373470 925 405 0.171365 0.000000 9852 0.000000 0.000000 50.000000 1 1.271025 nan 22.148955 accepted Low variance
67 ICA_67 32.992776 6.582726 0.678708 1.199201 15187 624 0.512719 0.000000 6156 23.770719 0.000000 8.600000 -1 1.102969 6.000000 35.152159 accepted Likely BOLD
68 ICA_68 13.911545 35.972551 0.515928 0.766355 9880 19317 0.441544 0.476750 7965 17.392675 0.000000 20.400000 -1 1.988442 nan nan rejected Unlikely BOLD
69 ICA_69 35.013471 5.976296 0.494372 0.975903 17809 392 0.532860 0.000000 5981 16.565802 0.000000 8.400000 1 0.757038 5.800000 14.558122 accepted Likely BOLD
70 ICA_70 7.121085 7.269320 0.211341 0.256944 220 272 0.000000 0.000000 9852 0.000000 0.000000 61.700000 1 1.591245 nan nan rejected Unlikely BOLD
71 ICA_71 11.310667 6.949636 0.217479 0.454340 2106 321 0.000000 0.000000 9852 0.000000 0.000000 48.300000 1 1.030928 nan 21.109498 accepted Low variance
72 ICA_72 12.544222 11.221088 0.386594 0.580883 1662 2845 0.000000 0.156476 9852 0.000000 0.000000 48.900000 1 1.652385 nan nan rejected Unlikely BOLD
with open(
    os.path.join(out_dir, "sub-24053_ses-1_task-rat_dir-PA_run-01_desc-tedana_metrics.json"),
    "r",
) as fo:
    metrics = json.load(fo)

first_five_keys = list(metrics.keys())[:5]
reduced_metrics = {k: metrics[k] for k in first_five_keys}
pprint(reduced_metrics)
{'Component': {'Description': 'The unique identifier of each component. This '
                              'identifier matches column names in the mixing '
                              'matrix TSV file.',
               'LongName': 'Component identifier'},
 'classification_tags': {'Description': 'A single tag or a comma separated '
                                        'list of tags to describe why a '
                                        'component received its classification',
                         'LongName': 'Component classification tags'},
 'countnoise': {'Description': "Number of 'noise' voxels (voxels highly "
                               'weighted for component, but not from clusters) '
                               'from each component.',
                'LongName': 'Noise voxel count',
                'Units': 'voxel'},
 'countsigFS0': {'Description': 'Number of significant voxels from the '
                                'cluster-extent thresholded S0 model '
                                'F-statistic map for each component.',
                 'LongName': 'S0 model F-statistic map significant voxel count',
                 'Units': 'voxel'},
 'countsigFT2': {'Description': 'Number of significant voxels from the '
                                'cluster-extent thresholded T2 model '
                                'F-statistic map for each component.',
                 'LongName': 'T2 model F-statistic map significant voxel count',
                 'Units': 'voxel'}}
df = pd.DataFrame.from_dict(metrics, orient="index")
df = df.fillna("n/a")
display(HTML(df.to_html()))
Description LongName Units Levels
Component The unique identifier of each component. This identifier matches column names in the mixing matrix TSV file. Component identifier n/a n/a
classification_tags A single tag or a comma separated list of tags to describe why a component received its classification Component classification tags n/a n/a
countnoise Number of 'noise' voxels (voxels highly weighted for component, but not from clusters) from each component. Noise voxel count voxel n/a
countsigFS0 Number of significant voxels from the cluster-extent thresholded S0 model F-statistic map for each component. S0 model F-statistic map significant voxel count voxel n/a
countsigFT2 Number of significant voxels from the cluster-extent thresholded T2 model F-statistic map for each component. T2 model F-statistic map significant voxel count voxel n/a
d_table_score Summary score compiled from five metrics, with smaller values (i.e., higher ranks) indicating more BOLD dependence and less noise. Decision table score arbitrary n/a
dice_FS0 Dice value of cluster-extent thresholded maps of S0-model betas and F-statistics. S0 model beta map-F-statistic map Dice similarity index arbitrary n/a
dice_FT2 Dice value of cluster-extent thresholded maps of T2-model betas and F-statistics. T2 model beta map-F-statistic map Dice similarity index arbitrary n/a
kappa A pseudo-F-statistic indicating TE-dependence of the component. This metric is calculated by computing fit to the TE-dependence model at each voxel, and then performing a weighted average based on the voxel-wise weights of the component. Kappa arbitrary n/a
normalized variance explained 'Normalized' variance explained by each component in the ICA weights maps. This is calculated by z-scoring the mixing matrix and optimally combined data over time, then fitting a GLM to calculate voxel-wise parameter estimates for each component. These parameter estimates are then cropped to values between -0.999 and 0.999, and then the Fisher's z-transform is applied to the parameter estimates. This is then used to calculate the variance explained for each component. On a scale from 0 to 100. Normalized variance explained percent n/a
optimal sign Optimal sign determined based on skew direction of component parameter estimates across the brain. In cases where components were left-skewed (-1), the component time series and map weights are flipped prior to metric calculation. This sign applies to the original mixing matrix and map weights. The outputs produced by tedana are already flipped. Optimal component sign n/a {'-1': 'Component is flipped prior to metric calculation.', '1': 'Component is not flipped prior to metric calculation.'}
rho A pseudo-F-statistic indicating TE-independence of the component. This metric is calculated by computing fit to the TE-independence model at each voxel, and then performing a weighted average based on the voxel-wise weights of the component. Rho arbitrary n/a
signal-noise_p P-value for two-sample t-test of F-statistics from 'signal' voxels (voxels in clusters) against 'noise' voxels (voxels not in clusters) for T2 model. Signal > noise p-value arbitrary n/a
signal-noise_t T-statistic for two-sample t-test of F-statistics from 'signal' voxels (voxels in clusters) against 'noise' voxels (voxels not in clusters) for T2 model. Signal > noise t-statistic arbitrary n/a
variance explained The square of the parameter estimates from the regression of the mean-centered, but not z-scored, optimally combined data against the component time series, divided by the sum of the squares of the parameter estimates. This metric reflects relative participation in the fitted model, not unique or marginal explanatory power. On a scale from 0 to 100. Variance explained percent n/a
report = os.path.join(out_dir, "sub-24053_ses-1_task-rat_dir-PA_run-01_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))
tedana report

ICA components

Carpet plots

Adaptive mask

T2*

S0

T2* and S0 model fit (RMSE). (Scaled between 2nd and 98th percentiles)

Global Signal Control

Minimum Image Regression

Info

Tedana command used:

      
        tedana_workflow(data=['/mnt/c/Users/tsalo/Documents/ME-ICA/multi-echo-data-analysis/data/ds006185/sub-24053/ses-1/func/sub-24053_ses-1_task-rat_dir-PA_run-01_echo-1_part-mag_desc-preproc_bold.nii.gz', '/mnt/c/Users/tsalo/Documents/ME-ICA/multi-echo-data-analysis/data/ds006185/sub-24053/ses-1/func/sub-24053_ses-1_task-rat_dir-PA_run-01_echo-2_part-mag_desc-preproc_bold.nii.gz', '/mnt/c/Users/tsalo/Documents/ME-ICA/multi-echo-data-analysis/data/ds006185/sub-24053/ses-1/func/sub-24053_ses-1_task-rat_dir-PA_run-01_echo-3_part-mag_desc-preproc_bold.nii.gz', '/mnt/c/Users/tsalo/Documents/ME-ICA/multi-echo-data-analysis/data/ds006185/sub-24053/ses-1/func/sub-24053_ses-1_task-rat_dir-PA_run-01_echo-4_part-mag_desc-preproc_bold.nii.gz', '/mnt/c/Users/tsalo/Documents/ME-ICA/multi-echo-data-analysis/data/ds006185/sub-24053/ses-1/func/sub-24053_ses-1_task-rat_dir-PA_run-01_echo-5_part-mag_desc-preproc_bold.nii.gz'], tes=[0.0142, 0.03893, 0.06366, 0.08839, 0.11312], out_dir=/mnt/c/Users/tsalo/Documents/ME-ICA/multi-echo-data-analysis/data/tedana, mask=/mnt/c/Users/tsalo/Documents/ME-ICA/multi-echo-data-analysis/data/ds006185/sub-24053/ses-1/func/sub-24053_ses-1_task-rat_dir-PA_run-01_part-mag_desc-brain_mask.nii.gz, convention=bids, prefix=sub-24053_ses-1_task-rat_dir-PA_run-01_, dummy_scans=0, masktype=['dropout'], fittype=loglin, combmode=t2s, n_independent_echos=None, tree=tedana_orig, external_regressors=None, ica_method=fastica, n_robust_runs=30, tedpca=mdl, fixed_seed=42, maxit=500, maxrestart=10, tedort=False, gscontrol=['mir'], no_reports=False, png_cmap=coolwarm, verbose=True, low_mem=False, debug=False, quiet=False, overwrite=True, t2smap=None, mixing_file=None, n_threads=1)
      
    

System: Linux
Node: TaylorAlienware
Release: 5.15.167.4-microsoft-standard-WSL2
System version: #1 SMP Tue Nov 5 00:21:55 UTC 2024
Machine: x86_64
Processor: x86_64
Python: 3.12.13 | packaged by conda-forge | (main, Mar 5 2026, 16:50:00) [GCC 14.3.0]
Tedana version: 26.0.2
Other library versions: {'bokeh': '3.9.0', 'mapca': '0.0.7', 'matplotlib': '3.10.8', 'nibabel': '5.4.2', 'nilearn': '0.12.1', 'numpy': '2.4.3', 'pandas': '3.0.1', 'robustica': '0.1.4', 'scikit-learn': '1.8.0', 'scipy': '1.17.1', 'threadpoolctl': '3.6.0', 'tqdm': '4.67.3'}

About tedana

This is the tedana_orig tree (tedana community et al. 2024), which is very similar to the criteria of the MEICA v2.5 decision tree (Kundu et al. 2013). For a description of the decision tree steps, with the rationale for each step, see (Olafsson et al. 2015). TE-dependence analysis was performed on input data using the tedana workflow (DuPre et al. 2021). A user-defined mask was applied to the data. An adaptive mask was then generated using the dropout method(s), in which each voxel's value reflects the number of echoes with 'good' data. An adaptive mask was then generated using the dropout method(s), in which each voxel's value reflects the number of echoes with 'good' data. A two-stage masking procedure was applied, in which a liberal mask (including voxels with good data in at least the first echo) was used for optimal combination, T2*/S0 estimation, and denoising, while a more conservative mask (restricted to voxels with good data in at least the first three echoes) was used for the component classification procedure. A monoexponential model was fit to the data at each voxel using log-linear regression in order to estimate T2* and S0 maps. For each voxel, the value from the adaptive mask was used to determine which echoes would be used to estimate T2* and S0. Multi-echo data were then optimally combined using the T2* combination method (Posse et al. 1999). Principal component analysis based on the PCA component estimation with a Moving Average(stationary Gaussian) process (Li et al. 2007) was applied to the optimally combined data for dimensionality reduction. The following metrics were calculated: kappa, rho, countnoise, countsigFT2, countsigFS0, dice_FT2, dice_FS0, signal-noise_t, variance explained, normalized variance explained, d_table_score. Kappa (kappa) and Rho (rho) were calculated as measures of TE-dependence and TE-independence, respectively. A t-test was performed between the distributions of T2*-model F-statistics associated with clusters (i.e., signal) and non-cluster voxels (i.e., noise) to generate a t-statistic (metric signal-noise_z) and p-value (metric signal-noise_p) measuring relative association of the component to signal over noise. The number of significant voxels not from clusters was calculated for each component. Independent component analysis was then used to decompose the dimensionally reduced dataset. The following metrics were calculated: countnoise, countsigFS0, countsigFT2, d_table_score, dice_FS0, dice_FT2, kappa, normalized variance explained, rho, signal-noise_t, variance explained. Kappa (kappa) and Rho (rho) were calculated as measures of TE-dependence and TE-independence, respectively. A t-test was performed between the distributions of T2*-model F-statistics associated with clusters (i.e., signal) and non-cluster voxels (i.e., noise) to generate a t-statistic (metric signal-noise_z) and p-value (metric signal-noise_p) measuring relative association of the component to signal over noise. The number of significant voxels not from clusters was calculated for each component. Next, component selection was performed to identify BOLD (TE-dependent) and non-BOLD (TE-independent) components using a decision tree. Minimum image regression was then applied to the data in order to remove spatially diffuse noise (Kundu et al. 2013). This workflow used numpy (Van Der Walt et al. 2011), scipy (Virtanen et al. 2020), pandas (McKinney et al. 2010, pandas development team et al. 2020), scikit-learn (Pedregosa et al. 2011), nilearn, bokeh (Team et al. 2018), matplotlib (Hunter et al. 2007), and nibabel (Brett et al. 2019). This workflow also used the Dice similarity index (Dice et al. 1945, Sorensen et al. 1948).

References