NIPY logo

Site Navigation

NIPY Community

Table Of Contents

Previous topic

neurospin.spatial_models.hierarchical_parcellation

Next topic

neurospin.spatial_models.mroi

This Page

neurospin.spatial_models.hroi

Module: neurospin.spatial_models.hroi

Inheritance diagram for nipy.neurospin.spatial_models.hroi:

This module contains the specification of ‘heierarchical ROI’ object, Which is used in spatial models of the library such as structural analysis

The connection with other classes is not completely satisfactory at the moment: there should be some intermediate classes between ‘Fields’ and ‘hroi’

Author : Bertrand Thirion, 2009

Class

HierarchicalROI

class nipy.neurospin.spatial_models.hroi.HierarchicalROI(domain, label, parents, id='')

Bases: nipy.neurospin.spatial_models.mroi.SubDomains

__init__(domain, label, parents, id='')

Building the HierarchicalROI

argmax_feature(fid)

Return the list of roi-level argmax of feature called fid

check_features()
copy(id='')

returns a copy of self. self.domain is not copied.

get_coord(k)

returns self.coord[k]

get_feature(fid, k=None)

return self.features[fid]

get_k()
get_parents()
get_roi_feature(fid)

roi_features accessor

get_size()

returns size, k-length array

get_volume(k)

returns self.local_volume[k]

integrate(fid=None)

Integrate certain feature on each ROI and return the k results

Parameters :

fid : string, feature identifier,

by default, the 1 function is integrataed, yielding ROI volumes

Returns :

lsum = array of shape (self.k, self.feature[fid].shape[1]), :

the results

isleaf()
make_feature(fid, data, override=True)

Extract a set of ffeatures from a domain map

Parameters :

fid: string, :

feature identifier

data: array of shape(deomain.size) or (domain, size, dim), :

domain map from which ROI features are axtracted

override: bool, optional, :

Allow feature overriding

make_forest()

output an fff.forest structure to represent the ROI hierarchy

make_graph()

output an fff.graph structure to represent the ROI hierarchy

merge_ascending(valid)

Remove the non-valid ROIs by including them in their parents when it exists

Parameters :valid array of shape(self.k) :
merge_descending(methods=None)

self.merge_descending() Remove the items with only one son by including them in their son

Parameters :

methods indicates the way possible features are dealt with :

(not implemented yet) :

plot_feature(fid, ax=None)

boxplot the distribution of features within ROIs Note that this assumes 1-d features

Parameters :

fid: string, :

the feature identifier

ax: axis handle, optional :

reduce_to_leaves(id='')

create a new set of rois which are only the leaves of self

remove_feature(fid)

Remove a certain feature

representative_feature(fid, method='mean')

Compute an ROI-level feature given the discrete features

Parameters :

fid(string) the discrete feature under consideration :

method=’average’ the assessment method :

Returns :

the computed roi-feature is returned :

select(valid, id='', no_empty_label=True)

Remove the rois for which valid==0 and update the hierarchy accordingly Note that auto=True automatically

set_feature(fid, data, override=True)

Append a feature ‘fid’

Parameters :

fid: string, :

feature identifier

data: list of self.k arrays of shape(self.size[k], p) or self.size[k] :

the feature data

override: bool, optional, :

Allow feature overriding

set_roi_feature(fid, data)
Parameters :

fid: string, feature identifier :

data: array of shape(self.k, p), with p>0 :

to_image(path=None)

Generates and possiblly writes a label image that represents self.

Functions

nipy.neurospin.spatial_models.hroi.HROI_as_discrete_domain_blobs(dom, data, threshold=-inf, smin=0, id='')
nipy.neurospin.spatial_models.hroi.HROI_from_watershed(domain, data, threshold=-inf, id='')

Instantiate an HierarchicalROI as the watershed of a certain dataset

Parameters :

domain: discrete_domain.StructuredDomain instance, :

definition of the spatial context

data: array of shape (domain.size), :

the corresponding data field

threshold: float optional, :

thresholding level

Returns :

the HierachicalROI instance :

nipy.neurospin.spatial_models.hroi.make_hroi_from_subdomain(sub_domain, parents)

Instantiate an HROi from a SubDomain instance and parents