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 :
|
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) :
mask: referential- and mask- 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 : | map: array of shape(nbvox) :
mask: Nifti1Image instance, :
th (float): cluster-forming threshold : cisze (int>0): cluster size threshold : |
---|---|
Returns : | binary array of shape (nvox): the binarized thresholded map : |
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.neurospin.spatial_models.bayesian_structural_analysis
Parameters : | mask: brifti image instance, :
betas: array of shape (nbnodes, subjects), :
theta: 3.0 (float), :
dmax :5. float>0, :
ths = 0 (int, >=0): :
thq = 0.5 (float): :
smin = 0 (int): :
afname = ‘/tmp/af.pic’: :
|
---|---|
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 : | smap : array of shape (nbvox),
mask: Nifti1Image instance, :
thr=3.0 float :
cisze=10: int :
|
---|---|
Returns : | positions array of shape(k,anat_dim): :
|
the peaks above thr in 18-connectivity are computed
Parameters : | smap : array of shape (nbvox): map to threshold mask: referential- and mask-defining image : thr=3.0 (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 :
mask: refenrtial- and mask-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) :
mask: refenrtial- and mask-defining image : 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 : |
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) :
threshold (float): :
method=’crfx’, string, to be chosen among ‘crfx’, ‘cmfx’, ‘cffx’ :
verbose=0 : verbosity mode |
---|---|
Returns : | kappa (float): the desired reproducibility index : |
returns a binary map of the ttest>threshold