API

tedana.workflows: Common workflows

Command line interfaces and workflows.

tedana_workflow(data, tes[, out_dir, mask, ...])

Run the "canonical" TE-Dependent ANAlysis workflow.

ica_reclassify_workflow(registry[, accept, ...])

Run the post-tedana manual classification workflow.

t2smap_workflow(data, tes[, ...])

Estimate T2 and S0, and optimally combine data across TEs.

parser_utils.check_tedpca_value(value[, ...])

Check tedpca argument.

parser_utils.check_n_robust_runs_value(string)

Check n_robust_runs argument.

parser_utils.is_valid_file(parser, arg)

Check if argument is existing file.

parser_utils.parse_manual_list_int(manual_list)

Parse the list of components to accept or reject into a list of integers.

parser_utils.parse_manual_list_str(manual_list)

Parse the list of components tags into a comma delimited list of strings.

tedana.decay: Modeling signal decay across echoes

Functions to estimate S0 and T2* from multi-echo data.

fit_decay(data, tes, adaptive_mask, fittype)

Fit voxel-wise monoexponential decay models to data.

fit_decay_ts(data, tes, adaptive_mask, fittype)

Fit voxel- and timepoint-wise monoexponential decay models to data.

monoexponential(tes, s0, t2star)

Specify a monoexponential model for use with scipy curve fitting.

fit_monoexponential(data_cat, echo_times, ...)

Fit monoexponential decay model with nonlinear curve-fitting.

fit_loglinear(data_cat, echo_times, ...[, ...])

Fit monoexponential decay model with log-linear regression.

modify_t2s_s0_maps(t2s, s0, adaptive_mask, tes)

Modify T2* and S0 maps to include estimates for voxels with adaptive mask == 1.

rmse_of_fit_decay_ts(*, data, tes, ...)

Estimate model fit of voxel- and timepoint-wise monoexponential decay models to data.

tedana.combine: Combining time series across echoes

Functions to optimally combine data across echoes.

make_optcom(data, tes, adaptive_mask[, t2s, ...])

Optimally combine BOLD data across TEs.

tedana.decomposition: Data decomposition

Functions for decomposing BOLD signals.

tedpca(data_cat, data_optcom, mask, ...[, ...])

Use principal components analysis (PCA) to identify and remove thermal noise from data.

tedica(data, n_components, fixed_seed[, ...])

Perform ICA on data with the user selected ica method and returns mixing matrix.

ica.r_ica(data, n_components, fixed_seed, ...)

Perform robustica on data and returns mixing matrix.

ica.f_ica(data, n_components, fixed_seed, ...)

Perform FastICA on data and returns mixing matrix.

tedana.metrics: Computing TE-dependence metrics

TE-dependence and TE-independence metrics.

collect

Tools to collect and generate metrics.

dependence

Metrics evaluating component TE-dependence or -independence.

external

Metrics based on fits of component time series to external time series.

tedana.selection: Component selection

TEDANA selection methods.

component_selector.ComponentSelector(tree[, ...])

Load and classify components based on a specified tree.

component_selector.TreeError

Passes errors that are raised when validate_tree fails.

component_selector.load_config(tree[, out_dir])

Load the json file with the decision tree and validate the fields in the decision tree.

component_selector.validate_tree(tree)

Confirm that provided tree is a valid decision tree.

selection_nodes

Functions that will be used as steps in a decision tree.

selection_utils

Utility functions for tedana.selection.

tedica

Functions to identify TE-dependent and TE-independent components.

tedpca

Functions to identify TE-dependent and TE-independent components.

tedana.gscontrol: Global signal control

Global signal control methods.

gscontrol_raw(*, data_cat, data_optcom, ...)

Remove global signal from individual echo data_cat and data_optcom time series.

minimum_image_regression(*, data_optcom, ...)

Perform minimum image regression (MIR) to remove T1-like effects from BOLD-like components.

tedana.io: Reading and writing data

Handle most file input and output in the tedana workflow.

Other functions in the module help write outputs which require multiple data sources, assist in writing per-echo verbose outputs, or act as helper functions for any of the above.

OutputGenerator(reference_img[, convention, ...])

A class for managing tedana outputs.

InputHarvester(path)

Class for turning a registry file into a lookup table to get previous data.

CustomEncoder(*[, skipkeys, ensure_ascii, ...])

Class for converting some types because of JSON serialization and numpy incompatibilities.

load_data_nilearn(data, mask_img, n_echos[, ...])

Load multi-echo data as a masked array.

load_json(path)

Load a json file from path.

get_fields(name)

Identify all fields in an unformatted string.

prep_data_for_json(d)

Attempt to create a JSON serializable dictionary from a data dictionary.

add_decomp_prefix(comp_num, prefix, max_value)

Create component name with leading zeros matching number of components.

denoise_ts(data, mixing, mask, component_table)

Apply component classifications to data for denoising.

split_ts(data, mixing, component_table)

Split data time series into accepted component time series and remainder.

write_split_ts(data, mixing, mask, ...[, echo])

Split data into denoised / noise / ignored time series and save to disk.

writeresults(data_optcom, mask, ...)

Denoise ts and save all resulting files to disk.

writeresults_echoes(data_cat, mixing, mask, ...)

Save individually denoised echos to disk.

download_json(tree, out_dir)

Download a json file from figshare unless the file already exists.

load_ref_img(data, n_echos)

Load data using nibabel's load function and convert to NIfTI1 format.

versiontuple(v)

Convert a version string into a tuple of ints.

str_to_component_list(s)

Convert a string to a list of component indices.

fname_to_component_list(fname)

Read a file of component indices.

tedana.reporting: Reporting functions

Reporting code for tedana.

html_report.generate_report(io_generator, ...)

Generate an HTML report.

quality_metrics.calculate_rejected_components_impact(...)

Calculate the % variance explained by the rejected components for accepted components.

static_figures.comp_figures(ts, ...)

Create static figures that highlight certain aspects of tedana processing.

static_figures.pca_results(criteria, ...)

Plot the PCA optimization curve for each criteria, and the variance explained curve.

static_figures.plot_t2star_and_s0(*, ...)

Create T2* and S0 maps and histograms.

static_figures.plot_rmse(*, io_generator)

Plot the residual mean squared error map and time series for the monoexponential model fit.

static_figures.plot_adaptive_mask(*, optcom, ...)

Create a figure to show the adaptive mask.

static_figures.carpet_plot(optcom_ts, ...[, ...])

Generate a set of carpet plots for the combined and denoised data.

static_figures.plot_component(*, stat_img, ...)

Create a figure with a component's spatial map, time series, and power spectrum.

static_figures.plot_gscontrol(*, ...)

Plot the results of the gscontrol steps.

static_figures.plot_heatmap(*, ...)

Plot a heatmap of correlations between external regressors and ICA components.

static_figures.plot_decay_variance(*, ...)

Plot the variance of the T2* and S0 estimates.

tedana.stats: Statistical functions

Statistical functions.

get_coeffs(data, x[, add_const])

Perform least-squares fit of x against data.

voxelwise_univariate_zstats(data, mixing)

Compute univariate voxelwise z-statistics using correlations.

getfbounds(n_independent_sources)

Get F-statistic boundaries based on number of echos.

fit_model(x, y[, output_residual])

Linear regression for a model y = betas * x + error.

t_to_z(t_values, dof)

Convert t-values to z-values.

tedana.bibtex: Tools for working with BibTeX files

Utilities for managing the tedana bibliography.

find_braces(string)

Search a string for matched braces.

reduce_idx(idx_list)

Identify outermost brace indices in list of indices.

index_bibtex_identifiers(string, idx_list)

Identify the BibTeX entry identifier before each entry.

find_citations(description)

Find citations in a text description.

reduce_references(citations, reference_list)

Reduce the list of references to only include ones associated with requested citations.

get_description_references(description)

Find BibTeX references for citations in a methods description.

tedana.utils: Utility functions

Utilities for tedana package.

andb(arrs)

Sum arrays in arrs.

dice(arr1, arr2[, axis])

Compute Dice's similarity index between two numpy arrays.

get_spectrum(data[, tr])

Return the power spectrum and corresponding frequencies.

make_adaptive_mask(data[, ...])

Make map of data specifying longest echo a voxel can be sampled with.

threshold_map(img, min_cluster_size[, ...])

Cluster-extent threshold and binarize image.

unmask(data, mask)

Unmasks data using non-zero entries of mask.

sec2millisec(arr)

Convert seconds to milliseconds.

millisec2sec(arr)

Convert milliseconds to seconds.

load_mask(ref_img[, mask, t2smap])

Load mask from user-defined mask or T2* map.

create_legendre_polynomial_basis_set(n_vols)

Create Legendre polynomial basis set for detrending time series.

parse_volume_indices(indices_str)

Parse volume indices string into a list of integers.

check_t2s_values(t2s_map)

Check and convert T2* map values to milliseconds.

check_te_values(te_values)

Check and convert TE values to milliseconds for internal use.

setup_loggers([logname, repname, quiet, debug])

Set up loggers for tedana.

teardown_loggers()

Close loggers.

get_resource_path()

Return the path to general resources, terminated with separator.

get_system_version_info()

Return information about the system tedana is being run on.

log_newsletter_info()

Log information about the tedana newsletter.