Inheritance diagram for nipy.neurospin.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
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), :
rid: string, optional, :
referential: string, optional, :
|
---|
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: nipy.neurospin.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
get_coord | |
get_feature | |
get_volume | |
integrate | |
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 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 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 an image, and returns it
Bases: nipy.neurospin.spatial_models.discrete_domain.DiscreteDomain
Besides DiscreteDomain attributed, StructuredDomain has a topology, which allows many operations (morphology etc.)
Methods
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 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
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 StructuredDomain 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, :
|