Table Of Contents

Previous topic

neurospin.graph.graph

Next topic

neurospin.group.displacement_field

This Page

neurospin.graph.hroi

Module: neurospin.graph.hroi

Inheritance diagram for nipy.neurospin.graph.hroi:

Classes

HROI

class nipy.neurospin.graph.hroi.HROI(parents=None, header=None, id=None)

Tentative alternative definition of multiple ROI class

__init__(parents=None, header=None, id=None)

NROI

class nipy.neurospin.graph.hroi.NROI(parents=None, header=None, id=None)

Bases: nipy.neurospin.utils.roi.MultipleROI, nipy.neurospin.graph.graph.Forest

Class for ntested ROIs. This inherits from both the Forest and MultipleROI

__init__(parents=None, header=None, id=None)
clean(valid)
make_forest()
output an fff.forest structure to represent the ROI hierarchy
make_graph()
output an fff.graph stracture to represent the ROI hierarchy
merge_ascending(valid, methods=None)
self.merge_ascending(valid) Remove the non-valid items by including them in their parents when it exists methods indicates the way possible features are dealt with

ROI_Hierarchy

class nipy.neurospin.graph.hroi.ROI_Hierarchy(k=1, seed=None, parents=None, label=None)

Class for the modelling of hierarchical ROIs main attributes: k : number of regions in the graph parents : parents in the tree sense of an ROI seed : reference item(voxel) for a given ROI Label : associated labelling of a certain dataset ROI_features : list of arrays that are ROI-related features ROI_feature_ids : identifiers of the ROI-related features

__init__(k=1, seed=None, parents=None, label=None)
argmax(dmap)
idx = self.argmax(dmap) INPUT: - dmap: array of shape(np.size(self.label)) OUTPUT: - idx: array of indices with shape (self.k) for each label i in [0..k-1], argmax_{label==i}(map) is computed and the result is returned in idx
check()
check that all the informations are compatible...
clean(valid)
remove the non-valid compnents and reorder the ROI list
compute_size()
copy()
get_ROI_feature(feature_id)
give the feature associated with a given id, if it ecists
get_k()
get_label()
get_leaf_label()
return self.labels, but with -1 instead of the label when the label does not correpond to a leaf
get_parents()
get_seed()
isfield(id)
tests whether a given id is among the current list of ROI_features
isleaf()
Returns a boolean vector of size self.k ==1 iff the item is the parents of nobody
make_feature(data, id, method='mean')
self.make_feature(data,id,method=’mean’) given a dataset, compute a ROI-based feature through averaging, min or max or cumulative mean INPUT: data = array of shape np.size((self.label)) id = (string) id of the feature method = ‘min’,’mean’,’max’ or ‘cumulative_mean’
make_forest()
output an fff.forest structure to represent the ROI hierarchy
make_graph()
output an fff.graph stracture to represent the ROI hierarchy
maxdepth()
depth = self.maxdepth() return a labelling of the nodes so that leaves are labelled by 0 and depth[i] = max_{j in ch[i]} depth[j] + 1 recursively
merge_ascending(valid, methods=None)
self.merge_ascending(valid) Remove the non-valid items by including them in their parents when it exists methods indicates the way possible features are dealt with
merge_descending(methods=None)
self.merge_descending() Remove the items with only one son by including them in their son methods indicates the way possible features are dealt with
propagate_AND_to_root(prop) propagates some binary property in the tree that is defined in the leaves so that prop[, parents], = AND(prop[, children])
propagate_upward(label)
label = self.propagate_upward(label) Assuming that label is a certain positive integer field (i.e. labels) that is defined at the leaves of the tree and can be compared, this propagates these labels to the parents whenever the children nodes have coherent propserties otherwise the parent value is unchanged
reduce_to_leaves()
h2 = reduce_to_leaves(self) create a new set of rois which are only the leaves of self
remove_feature(feature_id)
removes the feature associated with a given id, if it exists
set_ROI_feature(feature, feature_id)
add a new feature to the class
set_label(label)
set_parents(parents)
set_seed(seed)
subtree(k)
l = self.subtree(k) returns an array of the nodes included in the subtree rooted in k
tree_depth()
td = self.tree_depth() return the maximal depth of any node in the tree

Function

nipy.neurospin.graph.hroi.test_nroi(verbose=0)