Table Of Contents

Previous topic

neurospin.spatial_models.parcellation

Next topic

neurospin.utils.emp_null

This Page

neurospin.spatial_models.structural_bfls

Module: neurospin.spatial_models.structural_bfls

Inheritance diagram for nipy.neurospin.spatial_models.structural_bfls:

The main routine of this package that aims at performing the extraction of ROIs from multisubject dataset using the localization. This has been puclished in Thirion et al. Structural Analysis of fMRI Data Revisited: Improving the Sensitivity and Reliability of fMRI Group Studies. IEEE TMI 2007

Author : Bertrand Thirion, 2006-2008

Class

Amers

class nipy.neurospin.spatial_models.structural_bfls.Amers(k, subj=None, idx=None, coord=None)

This class is intended to represent inter-subject regions its members are: - k: (int) the number of regions involved - subj: array of int of size k, an identifier from where (‘the subjects’) the regions come from - idx : array of int of size k, an index related to each region, typically a seed voxel of the region in a certain representation - coord: array of double of size k*p, where p is a certain space dimension representing coordinates of the regions in a certain unspecified, but common system

__init__(k, subj=None, idx=None, coord=None)
center()
c = self.center() returns the average of the coordinates
confidence_region(cs, dmax=10, pval=0.94999999999999996)
i = self.confidence_region(cs,dmax = 10,pval = 0.95) Sample the pval-confidence region of AF on the proposed coordiante set cs, assuming a Gaussian shape INPUT: - cs: an array of size(n*p) a set of input coordinates - dmax=10 : an upper bound for the spatial variance to avoid degenerate variance - pval=0.95 cutoff for the CR OUPUT: i = set of entries of the coordinates that are within the cr
homogeneity()
d = self.homogeneity() OUTPUT: d (float) returns the mean distance between the coordinates of the regions

Functions

nipy.neurospin.spatial_models.structural_bfls.Build_Amers(BF, u, ths=0)
Given a list of hierarchical ROIs, and an associated labelling, this creates an Amer structure wuch groups ROIs with the same label. INPUT: - BF is the list of hierarchical ROIs. it is assumd that each list corresponds to one subject - u is a labelling array of size the total number of ROIs - ths=0 defines the condition (c): A label should be present in ths subjects in order to be valid OUTPUT: - AF : a list of Amers, each of which describing a cross-subject set of ROIs - newlabel : a relabelling of the individual ROIs, similar to u, which discards labels that do not fulfill the condition (c)
nipy.neurospin.spatial_models.structural_bfls.Compute_Amers(Fbeta, Beta, tal, dmax=10.0, thr=3.0, ths=0, pval=0.20000000000000001)
This is the main function for contrsucting the BFLs INPUT - Fbeta : field structure that contains the spatial nodes of the dataset - Beta: functional data matrix of size (nbnodes,nbsubj) - tal: spatial coordinates of the nodes (e.g. MNI coords) - dmax=10.: spatial relaxation allowed in the preocedure - thr = 3.0: thrshold at the first-level - ths = 0, number of subjects to validate a BFL - pval = 0.2 : significance p-value for the spatial inference OUPUT - crmap: the map of CR of the activated clusters in the common space - AF : group level BFLs - BFLs: list of first-level nested ROIs - Newlabel: labelling of the individual ROIs
nipy.neurospin.spatial_models.structural_bfls.RD_cliques(Gc, bstochastic=1)
Replicator dynamics graph segmentation: python implementation INPUT : - Gc graph to be segmented - bstochastic=1 stochastic initialization of the graph OUPUT: - labels : array of size V, the number of vertices of Gc the labelling of the vertices that represent the segmentation
nipy.neurospin.spatial_models.structural_bfls.clean_density(BFLs, dmax, xyz, pval=0.050000000000000003, verbose=0, dev=0, nrec=5, nsamples=10)
Computation of the positions where there is a significant spatial accumulation of pointwise ROIs. The significance is taken with respect to a uniform distribution of the ROIs. INPUT: - BFLs : a list of ROIs hierarchies, putatively describing ROIs from different subjects CAVEAT 1: The ROI_Hierarchy must have a ‘position’ feature defined beforehand CAVEAT 2: the structure is edited and modified by this function - dmax : the kernel width (std) for the spatial density estimator - xyz : a set of coordinates on which the test is perfomed it should be written as (nbitems,dimension) array - pval=0.05: corrected p-value for the significance of the test Importantly, the p-value is corrected only for the number of ROIs per subject - verbose=0: verbosity mode - dev=0. If dev=1, a different technique is used for density estimation (WIP) - nrec=5: number of recursions in the test: When some regions fail to be significant at one step, the density is recomputed, and the test is performed again and so on
nipy.neurospin.spatial_models.structural_bfls.clean_density_redraw(BFLs, dmax, xyz, pval=0.050000000000000003, verbose=0, dev=0, nrec=5, nsamples=10)
Computation of the positions where there is a significant spatial accumulation of pointwise ROIs. The significance is taken with respect to a uniform distribution of the ROIs. INPUT: - BFLs : a list of ROIs hierarchies, putatively describing ROIs from different subjects CAVEAT 1: The ROI_Hierarchy must have a ‘position’ feature defined beforehand CAVEAT 2: the structure is edited and modified by this function - dmax : the kernel width (std) for the spatial density estimator - xyz : a set of coordinates on which the test is perfomed it should be written as (nbitems,dimension) array - pval=0.05: corrected p-value for the significance of the test Importantly, the p-value is corrected only for the number of ROIs per subject - verbose=0: verbosity mode - dev=0. If dev=1, a different technique is used for density estimation (WIP) - nrec=5: number of recursions in the test: When some regions fail to be significant at one step, the density is recomputed, and the test is performed again and so on 19/02/07: new version without the monotonic exclusion heuristic
nipy.neurospin.spatial_models.structural_bfls.compute_density(BFLs, xyz, dmax)
Computation of the density of the BFLs points in the xyz volume dmax is a scale parameter
nipy.neurospin.spatial_models.structural_bfls.compute_density_dev(BFLs, xyz, dmax)
Computation of the density of the BFLs points in the xyz volume dmax is a scale parameter
nipy.neurospin.spatial_models.structural_bfls.compute_surrogate_density(BFLs, xyz, dmax, nsamples=1)
Cross-validated estimation of random samples of the uniform distributions INPUT: - BFLs : a list of sets of ROIs the list length, nsubj, is taken as the number of subjects - xyz (gs,3) array: a sampling grid to estimate spatial distribution - dmax kernel width of the density estimator - nsamples=1: number of surrogate smaples returned OUTPUT: - surweight: a (gs*nsamples,nsubj) array of samples
nipy.neurospin.spatial_models.structural_bfls.compute_surrogate_density_dev(BFLs, xyz, dmax, nsamples=1)
caveat: does not work for nsamples>1 This function computes a surrogate density using graph diffusion techniques
nipy.neurospin.spatial_models.structural_bfls.fig_density(sweight, surweight, pval, nlm)
Plot the histogram of sweight across the image and the thresholds implied by the surrogate model (surweight)
nipy.neurospin.spatial_models.structural_bfls.hierarchical_asso(BF, dmax)
Compting an association graph of the ROIs defined across different subjects INPUT: - BF a list of ROI hierarchies, one for each subject - dmax : spatial scale used xhen building associtations OUPUT: - G a graph that represent probabilistic associations between all cross-subject pairs of regions. Note that the probabilities are normalized on a within-subject basis.
nipy.neurospin.spatial_models.structural_bfls.merge(Gc, labels)
Given a first labelling of the graph Gc, this function builds a reduced graph by merging the vertices according to the labelling INPUT: - Gc the input graph - labels : array of size V, the number of vertices of Gc the labelling of the vertices that represent the segmentation OUTPUT: - labels : the new labelling after further merging - Gr the reduced graph after merging
nipy.neurospin.spatial_models.structural_bfls.segment_graph_rd(Gc, nit=1, verbose=0)
This function prefoms a hard segmentation of the graph Gc using a replicator dynamics approach. The clusters obtained in the first pass are further merged during a second pass, based on a reduced graph INPUT: - Gc : the graph to be segmented OUTPUT: - u : array of size V, the number of vertices of Gc the labelling of the vertices that represent the segmentation