Reference API

eigenstrapping - Null models

eigenstrapping.SurfaceEigenstrapping(data[, ...])

Compute the eigenmodes and eigenvalues of the surface in surface and resample the hypersphere bounded by the eigengroups contained within emodes, to reconstruct the data using coefficients conditioned on the original data Based on the degenerate solutions of solving the Laplace-Beltrami operator on the cortex.

eigenstrapping.VolumetricEigenstrapping(...)

Compute the eigenmodes and eigenvalues of the volume in volume and resample the hypersphere bounded by the eigengroups contained within emodes, to reconstruct the data using coefficients conditioned on the original data Based on the degenerate solutions of solving the Laplace-Beltrami operator on the cortex.

eigenstrapping.dataio - Data helpers

eigenstrapping.dataio.dataio(x)

Data I/O for core classes.

eigenstrapping.dataio.load(filename)

Load data contained in a CIFTI2-/GIFTI-format neuroimaging file.

eigenstrapping.dataio.load_surface(filename)

Load data stored in a GIFTI (.gii) neuroimaging file.

eigenstrapping.datasets - Dataset fetchers

eigenstrapping.datasets.load_surface_examples([...])

Downloads all surface files for fsaverage5 space

eigenstrapping.datasets.load_genepc([join])

Download and return the Allen Human Brain Atlas gene PC1 in fsaverage5 space.

eigenstrapping.datasets.load_distmat([...])

Downloads geodesic distance matrices.

eigenstrapping.datasets.load_subcort([...])

Loads all the files for the subcortical structures used in the paper - cortical-subcortical gradients and the subcortical ROIs from the 25% probability Harvard-Oxford atlas.

eigenstrapping.datasets.fetch_data(*[, ...])

Downloads files for brain surfaces and eigenmodes matching requested variables

eigenstrapping.datasets.txt2memmap(...[, ...])

Export distance matrix to memory-mapped array.

eigenstrapping.datasets.load_memmap(filename)

Load a memory-mapped array.

eigenstrapping.fit - Variogram fits

Eigenmode resampling on the cortex. Use fit.surface_fit() to determine how many modes to use to capture the empirical variogram.

eigenstrapping.fit.surface_fit(x[, D, ...])

Evaluate variogram fits for :class: eigenstrapping.SurfaceEigenstrapping to determine how many modes to decompose surface map with. Returns two plots: left - variogram fit middle - surrogate pairwise correlation with original map x right - histogram of surrogate residuals with original map x.

eigenstrapping.fit.volumetric_fit(x, volume)

Evaluate variogram fits for :class: eigenstrapping.VolumetricEigenstrapping to determine how many modes to decompose volumetric map with.

eigenstrapping.geometry - Mesh and eigenmode functions

eigenstrapping.geometry.get_tkrvox2ras(...)

Generate transformation matrix to switch between tetrahedral and volume space.

eigenstrapping.geometry.make_tria_file(...)

Generate triangular mesh of the ROI in the nifti file.

eigenstrapping.geometry.create_temp_surface(...)

Write surface to a new vtk file.

eigenstrapping.geometry.calc_eig(mesh, num_modes)

Calculate the eigenvalues and eigenmodes of a surface.

eigenstrapping.geometry.calc_surface_eigenmodes(...)

Main function to calculate the eigenmodes of a cortical surface with application of a mask (e.g., to remove the medial wall).

eigenstrapping.geometry.load_mesh(mesh)

Mesh loader function.

eigenstrapping.geometry.compute_normals(...)

Compute the normal for each vertex in the mesh.

eigenstrapping.geometry.inflate_mesh(*[, ...])

Inflate the mesh using Connectome Workbench surface-inflation

eigenstrapping.geometry.nearest_neighbor(P, X)

Find the one-nearest neighbors of vertices in points P on another surface X using Delaunay triangulation and KDTree query.

eigenstrapping.geometry.calc_volume(...)

Calculate the physical volume of the ROI in the nifti file.

eigenstrapping.geometry.normalize_vtk(tet, ...)

Normalize tetrahedral surface.

eigenstrapping.geometry.geodesic_distmat(surface)

Compute geodesic distance using the heat diffusion method built into LaPy

eigenstrapping.geometry.euclidean_distmat(mesh)

Calculates Euclidean distance matrix of the mesh in mesh

eigenstrapping.plotting - Plotting functions

Plotting subroutines

eigenstrapping.plotting.vrange(scalars[, pv])

eigenstrapping.plotting.csplot(scalars[, ...])

Automated plotting of cortical surfaces.

eigenstrapping.plotting.flatplot(scalars[, ...])

Automated plotting of cortical surfaces.

eigenstrapping.plotting.meshplot(mesh[, ...])

Automated plotting of surface in mesh.

eigenstrapping.rotations - Random rotation functions

Generate random rotation matrices of arbitrary size and rotate matrices

eigenstrapping.rotations.direct_method(n[, seed])

eigenstrapping.rotations.indirect_method(n)

eigenstrapping.rotations.rotate_matrix(M[, ...])

Rotate an (n/m)-by-n matrix of arbitrary length n by the two methods as outlined in [1].

eigenstrapping.stats - Statistical functions

eigenstrapping.stats.compare_maps(src, trg)

Compares images src and trg.

eigenstrapping.stats.gpd_inference(perms[, ...])

Report the tail-estimated p-value for faster inference using a Generalized Pareto distribution.

eigenstrapping.stats.msle(y_true, y_pred)

Compute the Mean Squared Logarithmic Error.

eigenstrapping.stats.joint_differential_entropy(x, y)

Compute the joint differential entropy of x and y

eigenstrapping.stats.conditional_entropy(x, ...)

Calculates conditional entropy of an empirical array given a set of surrogates

eigenstrapping.stats.kl(x, array[, b, ...])

Computes KL divergence of surrs to empirical array

eigenstrapping.stats.distance_correlation(x, ...)

Distance correlation between empirical and nulls.

eigenstrapping.stats.ks(x, nulls[, flatten])

Measures difference in underlying distribution (or non-Gaussianity) of a surrogate dataset using the Kolmogorov-Smirnov test

eigenstrapping.stats.spearmanr(X, Y)

Multi-dimensional Spearman rank correlation between rows of X and Y.

eigenstrapping.stats.pearsonr(X, Y[, ddof, ...])

Multi-dimensional Pearson correlation between rows of X and Y.

eigenstrapping.stats.pairwise_r(X[, ...])

Compute pairwise Pearson correlations between rows of X.

eigenstrapping.stats.nonparp(stat, dist)

Compute two-sided non-parametric p-value.

eigenstrapping.stats.normalize(x)

Normalize a vector to [0, 1] range.

eigenstrapping.utils - Utility functions

eigenstrapping.utils.is_string_like(obj)

Check whether obj behaves like a string.

eigenstrapping.utils.parcify(annotation[, drop])

Returns an array of parcel labels for every vertex in the surface of annotation

eigenstrapping.utils.get_schaefer([vers, ...])

Returns CSchaefer 2018 atlases as dictionary

eigenstrapping.utils.calc_parcellate(parc, ...)

Calculate parcellated data given (N,) parcellation for every vertex of shape (N,)

eigenstrapping.utils.parcellate_distmat(D, parc)

Parcellate a dense distance matrix

eigenstrapping.utils.reconstruct_data(...)

Reconstruct a dataset of n_vertices given a set of eigenmodes and coeffs conditioned on data using ordinary least squares (OLS)

eigenstrapping.utils.eigen_decomposition(...)

Decompose data using eigenmodes and calculate the coefficient of contribution of each vector

eigenstrapping.utils.calc_surface_connectivity(...)

Calculate surface-based connectivity matrix.

eigenstrapping.utils.compute_axes_ellipsoid(...)

Compute the axes of an ellipsoid given the eigenmodes.

eigenstrapping.utils.transform_to_spheroid(...)

Transform the eigenmodes to a spheroid space

eigenstrapping.utils.transform_to_ellipsoid(...)

Transform the eigenmodes in spheroid space back to ellipsoid by stretching