Inheritance diagram for nipy.labs.spatial_models.discrete_domain:
This module defines the StructuredDomain class, that represents a generic neuroimaging kind of domain This is meant to provide a unified API to deal with n-d imaged and meshes.
Author: Bertrand Thirion, 2010
Bases: object
Descriptor of a certain domain that consists of discrete elements that are characterized by a coordinate system and a topology: the coordinate system is specified through a coordinate array the topology encodes the neighboring system
Methods
connected_components() | returns a labelling of the domain into connected components |
copy() | Returns a copy of self |
get_coord() | Returns self.coord |
get_feature(fid) | Return self.features[fid] |
get_volume() | Returns self.local_volume |
integrate(fid) | Integrate certain feature over the domain and returns the result |
mask(bmask[, id]) | Returns an DiscreteDomain instance that has been further masked |
representative_feature(fid, method) | Compute a statistical representative of the within-Foain feature |
set_feature(fid, data[, override]) | Append a feature ‘fid’ |
Initialize discrete domain instance
Parameters: | dim: int, :
coord: array of shape(size, em_dim), :
local_volume: array of shape(size), :
id: string, optional, :
referential: string, optional, :
|
---|
returns a labelling of the domain into connected components
Returns a copy of self
Returns self.coord
Return self.features[fid]
Returns self.local_volume
Integrate certain feature over the domain and returns the result
Parameters: | fid : string, feature identifier,
|
---|---|
Returns: | lsum = array of shape (self.feature[fid].shape[1]), :
|
Returns an DiscreteDomain instance that has been further masked
Compute a statistical representative of the within-Foain feature
Parameters: | fid: string, feature id : method: string, method used to compute a representative :
|
---|
Append a feature ‘fid’
Parameters: | fid: string, :
data: array of shape(self.size, p) or self.size :
|
---|
Bases: object
temporary class to handle meshes
Methods
area() | Return array of areas for each node |
topology() | Returns a sparse matrix that represents the connectivity in self |
Initialize mesh domain instance
Parameters: | coord: array of shape (n_vertices, 3), :
triangles: array of shape(n_triables, 3), :
|
---|
Return array of areas for each node
Returns: | area: array of shape self.V, :
|
---|
Returns a sparse matrix that represents the connectivity in self
Bases: nipy.labs.spatial_models.discrete_domain.StructuredDomain
Particular instance of StructuredDomain, that receives 3 additional variables: affine: array of shape (dim+1, dim+1),
affine transform that maps points to a coordinate system
This is to allow easy conversion to images when dim==3, and for compatibility with previous classes
Methods
connected_components() | returns a labelling of the domain into connected components |
copy() | Returns a copy of self |
get_coord() | Returns self.coord |
get_feature(fid) | Return self.features[fid] |
get_volume() | Returns self.local_volume |
integrate(fid) | Integrate certain feature over the domain and returns the result |
make_feature_from_image(path[, fid]) | Extract the information from an image to make it a domain a feature |
mask(bmask) | Returns an instance of self that has been further masked |
representative_feature(fid, method) | Compute a statistical representative of the within-Foain feature |
set_feature(fid, data[, override]) | Append a feature ‘fid’ |
to_image([path, data]) | Write itself as a binary image, and returns it |
Initialize ndgrid domain instance
Parameters: | dim: int, :
ijk: array of shape(size, dim), int :
shape: dim-tuple, :
affine: array of shape (dim+1, dim+1), :
local_volume: array of shape(size), :
topology: sparse binary coo_matrix of shape (size, size), :
referential: string, optional, :
|
---|
returns a labelling of the domain into connected components
Returns a copy of self
Returns self.coord
Return self.features[fid]
Returns self.local_volume
Integrate certain feature over the domain and returns the result
Parameters: | fid : string, feature identifier,
|
---|---|
Returns: | lsum = array of shape (self.feature[fid].shape[1]), :
|
Extract the information from an image to make it a domain a feature
Parameters: | path: string or Nifti1Image instance, :
fid: string, optional :
|
---|---|
Returns: | the correponding set of values : |
Returns an instance of self that has been further masked
Compute a statistical representative of the within-Foain feature
Parameters: | fid: string, feature id : method: string, method used to compute a representative :
|
---|
Append a feature ‘fid’
Parameters: | fid: string, :
data: array of shape(self.size, p) or self.size :
|
---|
Write itself as a binary image, and returns it
Parameters: | path: string, path of the output image, if any : data: array of shape self.size, :
|
---|
Bases: nipy.labs.spatial_models.discrete_domain.DiscreteDomain
Besides DiscreteDomain attributed, StructuredDomain has a topology, which allows many operations (morphology etc.)
Methods
connected_components() | returns a labelling of the domain into connected components |
copy() | Returns a copy of self |
get_coord() | Returns self.coord |
get_feature(fid) | Return self.features[fid] |
get_volume() | Returns self.local_volume |
integrate(fid) | Integrate certain feature over the domain and returns the result |
mask(bmask[, did]) | Returns a StructuredDomain instance that has been further masked |
representative_feature(fid, method) | Compute a statistical representative of the within-Foain feature |
set_feature(fid, data[, override]) | Append a feature ‘fid’ |
Initialize structured domain instance
Parameters: | dim: int, :
coord: array of shape(size, em_dim), :
local_volume: array of shape(size), :
topology: sparse binary coo_matrix of shape (size, size), :
did: string, optional, :
referential: string, optional, :
|
---|
returns a labelling of the domain into connected components
Returns a copy of self
Returns self.coord
Return self.features[fid]
Returns self.local_volume
Integrate certain feature over the domain and returns the result
Parameters: | fid : string, feature identifier,
|
---|---|
Returns: | lsum = array of shape (self.feature[fid].shape[1]), :
|
Returns a StructuredDomain instance that has been further masked
Compute a statistical representative of the within-Foain feature
Parameters: | fid: string, feature id : method: string, method used to compute a representative :
|
---|
Append a feature ‘fid’
Parameters: | fid: string, :
data: array of shape(self.size, p) or self.size :
|
---|
Compute coordinates from a boolean array and an affine transform
Parameters: | mask: nd array, :
affine: (n+1, n+1) matrix, :
|
---|---|
Returns: | coords: array of shape(sum(mask>0), n), :
|
Return a StructuredDomain from an n-d array
Parameters: | mask: np.array instance :
affine: np.array, optional :
nn: neighboring system considered :
|
---|
Return a StructuredDomain instance from the input mask image
Parameters: | mim: NiftiIImage instance, or string path toward such an image :
nn: int, optional :
|
---|---|
Returns: | The corresponding StructuredDomain instance : |
Instantiate a StructuredDomain from a gifti mesh
Parameters: | mesh: nibabel gifti mesh instance, or path to such a mesh : |
---|
Return a NDGridDomain from an n-d array
Parameters: | mask: np.array instance :
affine: np.array, optional :
nn: neighboring system considered :
|
---|
Return a NDGridDomain instance from the input mask image
Parameters: | mim: NiftiIImage instance, or string path toward such an image :
nn: int, optional :
|
---|---|
Returns: | The corresponding NDGridDomain instance : |
Return a NDGridDomain from an n-d array
Parameters: | shape: tuple :
affine: np.array, optional :
|
---|
Compute coordinates from a set of indexes and an affine transform
Parameters: | idx:array of shape (n_samples, dim), type int :
affine: (n+1, n+1) matrix, :
|
---|---|
Returns: | coords: array of shape(sum(mask>0), n), :
|
Reduce a supposedly coo_matrix to the vertices in the mask
Parameters: | mat: sparse coo_matrix, :
mask: boolean array of shape mat.shape[0], :
|
---|
Create a sparse adjacency matrix from an array
Parameters: | mask : 3d array,
nn: int, optional :
|
---|---|
Returns: | coo_mat: a sparse coo matrix, :
|
Create a sparse adjacency matrix from 3d index system
Parameters: | idx:array of shape (n_samples, 3), type int :
nn: int, optional :
|
---|---|
Returns: | coo_mat: a sparse coo matrix, :
|
Create a sparse adjacency matrix from an arbitrary nd array
Parameters: | mask : nd array,
nn: int, optional :
|
---|---|
Returns: | coo_mat: a sparse coo matrix, :
|
Create a sparse adjacency matrix from nd index system
Parameters: | idx:array of shape (n_samples, dim), type int :
nn: int, optional :
|
---|---|
Returns: | coo_mat: a sparse coo matrix, :
|