labs.statistical_mapping

Module: labs.statistical_mapping

Inheritance diagram for nipy.labs.statistical_mapping:

Inheritance diagram of nipy.labs.statistical_mapping

Class

LinearModel

class nipy.labs.statistical_mapping.LinearModel(data, design_matrix, mask=None, formula=None, model='spherical', method=None, niter=2)

Bases: object

__init__(data, design_matrix, mask=None, formula=None, model='spherical', method=None, niter=2)
contrast(vector)

Compute images of contrast and contrast variance.

def_model = 'spherical'
def_niter = 2
dump(filename)

Dump GLM fit as npz file.

Functions

nipy.labs.statistical_mapping.bonferroni(p, n)
nipy.labs.statistical_mapping.cluster_stats(zimg, mask, height_th, height_control='fpr', cluster_th=0, nulls={})

Return a list of clusters, each cluster being represented by a dictionary. Clusters are sorted by descending size order. Within each cluster, local maxima are sorted by descending depth order.

Parameters:
zimg: z-score image
mask: mask image
height_th: cluster forming threshold
height_control: string

false positive control meaning of cluster forming threshold: ‘fpr’|’fdr’|’bonferroni’|’none’

cluster_th: cluster size threshold
null_scluster-level calibration method: None|’rft’|array

Notes

This works only with three dimensional data

nipy.labs.statistical_mapping.get_3d_peaks(image, mask=None, threshold=0.0, nn=18, order_th=0)

returns all the peaks of image that are with the mask and above the provided threshold

Parameters:
image, (3d) test image
mask=None, (3d) mask image

By default no masking is performed

threshold=0., float, threshold value above which peaks are considered
nn=18, int, number of neighbours of the topological spatial model
order_th=0, int, threshold on topological order to validate the peaks
Returns:
peaks, a list of dictionaries, where each dict has the fields:
vals, map value at the peak
order, topological order of the peak
ijk, array of shape (1,3) grid coordinate of the peak
pos, array of shape (n_maxima,3) mm coordinates (mapped by affine)

of the peaks

nipy.labs.statistical_mapping.linear_model_fit(data_images, mask_images, design_matrix, vector)

Helper function for group data analysis using arbitrary design matrix

nipy.labs.statistical_mapping.onesample_test(data_images, vardata_images, mask_images, stat_id, permutations=0, cluster_forming_th=0.01)

Helper function for permutation-based mass univariate onesample group analysis.

nipy.labs.statistical_mapping.prepare_arrays(data_images, vardata_images, mask_images)
nipy.labs.statistical_mapping.simulated_pvalue(t, simu_t)
nipy.labs.statistical_mapping.twosample_test(data_images, vardata_images, mask_images, labels, stat_id, permutations=0, cluster_forming_th=0.01)

Helper function for permutation-based mass univariate twosample group analysis. Labels is a binary vector (1-2). Regions more active for group 1 than group 2 are inferred.