Inheritance diagram for nipy.labs.spatial_models.discrete_domain:
This module define 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 | |
| copy | Generic (shallow and deep) copying operations. |
| get_coord | |
| get_feature | |
| get_volume | |
| integrate | |
| mask | |
| representative_feature | |
| set_feature |
| 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 | |
| topology |
| Parameters : | coord: array of shape (n_vertices, 3), :
triangles: array of shape(n_triables, 3), :
|
|---|
| 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 | |
| copy | Generic (shallow and deep) copying operations. |
| get_coord | |
| get_feature | |
| get_volume | |
| integrate | |
| make_feature_from_image | |
| mask | |
| representative_feature | |
| set_feature | |
| to_image |
| 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 | |
| copy | Generic (shallow and deep) copying operations. |
| get_coord | |
| get_feature | |
| get_volume | |
| integrate | |
| mask | |
| representative_feature | |
| set_feature |
| 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 : |
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, :
|