These are several functions for computing reproducibility measures. A use script should be appended soon on the repository.
In general thuis proceeds as follows: The dataset is subject to jacknife subampling (‘splitting’), each subsample being analysed independently. A reproducibility measure is then derived;
All is used to produce the work described in Analysis of a large fMRI cohort: Statistical and methodological issues for group analyses. Thirion B, Pinel P, Meriaux S, Roche A, Dehaene S, Poline JB. Neuroimage. 2007 Mar;35(1):105-20.
Bertrand Thirion, 2009-2010
Split the proposed group into redundant subgroups by bootstrap
Parameters : | nsubj (int) the number of subjects in the population : ngroups(int) Number of subbgroups to be drawn : |
---|---|
Returns : | samples: a list of ngroups arrays containing :
|
Returns a measure of cluster-level reproducibility of activation patterns (i.e. how far clusters are from each other)
Parameters : | data: array of shape (nvox,nsubj) :
vardata: array of shape (nvox,nsubj) :
domain: referential- and domain- defining image instance : ngroups (int), :
sigma (float): parameter that encodes how far far is : threshold (float): :
method=’crfx’, string to be chosen among ‘crfx’, ‘cmfx’ or ‘cffx’ :
swap = False: if True, a random sign swap of the data is performed :
verbose=0 : verbosity mode |
---|---|
Returns : | score (float): the desired cluster-level reproducibility index : |
Perform a thresholding of a map at the cluster-level
Parameters : | stat_map: array of shape(nbvox) :
domain: Nifti1Image instance, :
th (float): cluster-forming threshold : cisze (int>0): cluster size threshold : |
---|---|
Returns : | binary array of shape (nvox): the binarized thresholded map : |
Notes
Should be replaced by a more standard function in the future
Returns a conjunction statistic as the sum of the k lowest t-values
Parameters : | x: array of shape(nrows, ncols), :
vx: array of shape(nrows, ncols), :
k: int, :
|
---|---|
Returns : | t array of shape(nrows): conjunction statistic : |
main function for performing bsa on a dataset where bsa = nipy.labs.spatial_models.bayesian_structural_analysis
Parameters : | domain: image instance, :
betas: array of shape (nbnodes, subjects), :
theta: float, optional :
dmax: float>0, optional :
ths: int, >=0), optional :
thq: float, optional, :
smin: int, optional, :
afname: string, optional :
|
---|---|
Returns : | afcoord array of shape(number_of_regions,3): :
|
Draw randomly ngroups sets of samples from [0..nsubj-1]
Parameters : | nsubj, int, the total number of items : ngroups, int, the number of desired groups : split_method: string, optional, :
|
---|---|
Returns : | samples, a list of ngroups array that represent the subsets. : fixme : this should allow variable bootstrap, i.e. draw ngroups of groupsize among nsubj : |
Assuming that x and vx represent a effect and variance estimates, returns a cumulated (‘fixed effects’) t-test of the data over each row
Parameters : | x: array of shape(nrows, ncols): effect matrix : vx: array of shape(nrows, ncols): variance matrix : |
---|---|
Returns : | t array of shape(nrows): fixed effect statistics array : |
the clusters above thr of size greater than csize in 18-connectivity are computed
Parameters : | stat_map : array of shape (nbvox),
mask: Nifti1Image instance, :
thr: float, optional, :
cisze=10: int :
|
---|---|
Returns : | positions array of shape(k,anat_dim): :
|
The peaks above thr in 18-connectivity are computed
Parameters : | stat_map: array of shape (nbvox): map to threshold : deomain: referential- and domain-defining image : thr, float: cluster-forming threshold : |
---|---|
Returns : | positions array of shape(k,anat_dim): :
|
Main function to perform reproducibility analysis, including nifti1 io
Parameters : | threshold: list or 1-d array, :
|
---|---|
Returns : | cluster_rep_results: dictionary, :
voxel_rep_results: dictionary, :
peak_rep_results: dictionary, :
|
Given the histogram h, compute a standardized reproducibility measure
Parameters : | h array of shape(xmax+1), the histogram values : |
---|---|
Returns : | hr, float: the measure : |
Return a reproducibility map for the given method
Parameters : | data: array of shape (nvox,nsubj) :
vardata: array of the same size :
domain: referential- and domain-defining image : ngroups (int): the size of each subrgoup to be studied : threshold (float): binarization threshold :
method=’crfx’, string to be chosen among ‘crfx’, ‘cmfx’, ‘cffx’ :
verbose=0 : verbosity mode |
---|---|
Returns : | rmap: array of shape(nvox) :
|
Idem fttest, but returns a mixed-effects statistic
Parameters : | x: array of shape(nrows, ncols): effect matrix : vx: array of shape(nrows, ncols): variance matrix : |
---|---|
Returns : | t array of shape(nrows): mixed effect statistics array : |
Return a measure of cluster-level reproducibility of activation patterns (i.e. how far clusters are from each other)
Parameters : | data: array of shape (nvox,nsubj) :
vardata: array of shape (nvox,nsubj) :
domain: refenrtial- and domain-defining image : ngroups (int), :
sigma: float, parameter that encodes how far far is : threshold: float, binarization threshold : method: string to be chosen among ‘crfx’, ‘cmfx’ or ‘cffx’, :
swap = False: if True, a random sign swap of the data is performed :
verbose=0 : verbosity mode |
---|---|
Returns : | score (float): the desired cluster-level reproducibility index : |
Split the proposed group into random disjoint subgroups
Parameters : | nsubj (int) the number of subjects to be split : ngroups(int) Number of subbgroups to be drawn : |
---|---|
Returns : | samples: a list of ngroups arrays containing :
|
Return a number characterizing how close data is from target using a kernel-based statistic
Parameters : | target: array of shape(nt,anat_dim) or None :
data: array of shape(nd,anat_dim) or None :
sigma=1.0 (float), kernel parameter :
|
---|---|
Returns : | sensitivity (float): how well the targets are fitted :
|
Returns the t-test for each row of the data x
return a measure of voxel-level reproducibility of activation patterns
Parameters : | data: array of shape (nvox,nsubj) :
vardata: array of shape (nvox,nsubj) :
domain: referential- and domain-defining image : ngourps: int, :
method: string, to be chosen among ‘crfx’, ‘cmfx’, ‘cffx’ :
verbose: bool, verbosity mode : |
---|---|
Returns : | kappa (float): the desired reproducibility index : |
Returns a binary map of the ttest>threshold