Inheritance diagram for nipy.neurospin.spatial_models.parcellation:
Generic Parcellation class: Contains all the items that define a multi-subject parcellation
Author : Bertrand Thirion, 2005-2008
TODO : add a method ‘global field’, i.e. non-subject-specific info
Bases: object
This is the basic Parcellation class: It is defined discretely , i.e. the parcellation is an explicit function on the set of voxels (or equivalently a labelling) we explictly handle the case of multiple subjects, where the labelling varies with the subjects
k is the number of parcels/classes ijk: array of shape(nbvoxels,anatomical_dimension)
that represents the grid of voxels to be parcelled (the same for all subjects) typically anatomical_dimension=3
group_labels is a labelling of the template subjects=none is a list of ids of the subjects
by default, is is set as range(self.nb_subj)
Methods
PRFX | |
add_subjects | |
average_feature | |
boxplot_feature | |
check | |
copy | Generic (shallow and deep) copying operations. |
empty_parcels | |
get_feature | |
isfield | |
make_feature | |
make_feature_from_info | |
population | |
remove_feature | |
set_feature | |
set_group_labels | |
set_info | |
set_labels | |
set_subjects | |
var_feature_intra | |
variance_inter | |
variance_intra |
Constructor
Compute the Random effects of the feature on the parcels across subjects
Parameters : | fid : str
zstat : int
DMtx : None
|
---|---|
Returns : | RFX: array with shape (self.k,fdim) :
|
self.add_subjects(label,subj_id) Add some subjects to the structure Not implemented yet.
compute parcel-based fetaure bu averaging voxel-based quantities
Parameters : | Feature is a list of length self.nb_subj, :
subj = -1: subject in which this is performed :
|
---|---|
Returns : | PF: array of shape (self.nb_subj,self.k,fdim) if subj==-1 :
|
self.show_feature(pid,fids) This function makes a boxplot of the feature distribution in a given parcel across subjects
Parameters : | pid = parcel identifier an integer within the [0..self.K] range : fids = list of features of inetegers : |
---|
Some sanity check on the arguments of the class
Pa = self.copy() copy method
q = self.empty_parcels() returns the ids of all parcels that are empty
Get feature to the feature list of the structure
Parameters : | fid, string, the feature id : |
---|---|
Returns : | feature: array of shape(self.nb_subj,self.k,fdim), :
|
tests whether fid is known as a field
Compute and Add a feature to the feature list of the structure
Parameters : | data: a list of arrays of shape(nbvoxels,fdim), :
fid, string, the feature id : subj = -1: subject in which this is performed :
method = ‘average’, the way to compute the feature : |
---|
pop = self.population() the population of parcellation is the number of voxels included in each parcel this function simply returns an array of shape (number of parcels, number of subjects) that contains the parcel population
Remove feature from the feature list of the structure
Parameters : | fid, string, the feature id : |
---|
self.set_feature(feature,fid): Add a feature to the feature list of the structure
Parameters : | feature: array of shape(self.nb_subj,self.k,fdim), :
fid, string, the feature id : |
---|
self.reset_group_labels(glabels) reset the group labels
self.set_info(data,fid): Add some non-subject specific feature information defined on a voxel-by voxel basis
Parameters : | feature: an array of shape(self.nbvox,dim), :
fid : an identifier of the information |
---|
resets the label array of the class
Parameters : | label = array of shape(self.k,self.nb_subj) : |
---|
self.reset_subjects(subjects) reset the list of subjects name
Parameters : | subjects = a list of subjects id with length self.nb_subj : |
---|
compute the feature variance in each subject and each parcel
Compute the variance of the feature at each parcel across subjects
Parameters : | fid, string, the feature identifier : |
---|---|
Returns : | HI, array of shape (self.k) (?) :
|
Vintra = self.variance_intra(fid) Compute the variance of the feature at each parcel within each subject
Parameters : | data is the data on which the variance is estimated: :
bweight=0: flag for the relative weighting of the parcels :
|
---|---|
Returns : | VA : array of shape (self.k) of the variance |