Defines a mapping between sub and linear indices and world coordinate in volumatric fmri datasets
Methods
apply_affine3(mat, v) | Applies an affine transformation matrix. |
as_pickable() | Returns a pickable instance. |
contains_ijk(ijk[, apply_mask]) | Returns whether a set of sub voxel indices are contained within this instance. |
contains_lin(lin[, apply_mask]) | Returns whether a set of linear voxel indices are contained within this instance. |
get_empty_array([nt]) | Returns an empty array with size according to the volume |
get_empty_nifti_image([nt]) | Returns an empty nifti image with size according to the volume |
get_masked_array([nt, dilate]) | Provides a masked numpy array |
get_masked_nifti_image([nt, dilate]) | Provides a masked nifti image |
ijk2lin(ijk) | Converts sub to linear voxel indices. |
ijk2triples(ijk) | Converts sub indices to a list of triples |
ijk2xyz(ijk) | Maps sub voxel indices to world coordinates. |
lin2ijk(lin) | Converts sub to linear voxel indices. |
lin2xyz(lin) | Maps linear voxel indices to world coordinates. |
same_geometry(other) | Compares this geometry with another instance |
same_mask(other) | Compares the mask with another instance |
same_shape(other) | Compares the shape of the spatial dimensions with another instance |
triples2ijk(tuples) | Converts triples to sub indices |
xyz2ijk(xyz) | Maps world coordinates to sub voxel indices. |
xyz2lin(xyz) | Maps world coordinates to linear voxel indices. |
Parameters : | shape: tuple :
affine: numpy.ndarray :
mask: numpy.ndarray (default: None) :
|
---|
Methods
apply_affine3(mat, v) | Applies an affine transformation matrix. |
as_pickable() | Returns a pickable instance. |
contains_ijk(ijk[, apply_mask]) | Returns whether a set of sub voxel indices are contained within this instance. |
contains_lin(lin[, apply_mask]) | Returns whether a set of linear voxel indices are contained within this instance. |
get_empty_array([nt]) | Returns an empty array with size according to the volume |
get_empty_nifti_image([nt]) | Returns an empty nifti image with size according to the volume |
get_masked_array([nt, dilate]) | Provides a masked numpy array |
get_masked_nifti_image([nt, dilate]) | Provides a masked nifti image |
ijk2lin(ijk) | Converts sub to linear voxel indices. |
ijk2triples(ijk) | Converts sub indices to a list of triples |
ijk2xyz(ijk) | Maps sub voxel indices to world coordinates. |
lin2ijk(lin) | Converts sub to linear voxel indices. |
lin2xyz(lin) | Maps linear voxel indices to world coordinates. |
same_geometry(other) | Compares this geometry with another instance |
same_mask(other) | Compares the mask with another instance |
same_shape(other) | Compares the shape of the spatial dimensions with another instance |
triples2ijk(tuples) | Converts triples to sub indices |
xyz2ijk(xyz) | Maps world coordinates to sub voxel indices. |
xyz2lin(xyz) | Maps world coordinates to linear voxel indices. |
Returns the affine transformation matrix.
Returns : | affine : numpy.ndarray
|
---|
Applies an affine transformation matrix.
Parameters : | mat : numpy.ndarray (float)
v : numpy.ndarray (float)
|
---|---|
Returns : | w : numpy.ndarray(float)
|
Returns a pickable instance.
Returns : | dict :
|
---|
Returns whether a set of sub voxel indices are contained within this instance.
Parameters : | ijk : numpy.ndarray
|
---|---|
Returns : | numpy.ndarray (boolean) :
|
Returns whether a set of linear voxel indices are contained within this instance.
Parameters : | lin : numpy.ndarray
|
---|---|
Returns : | numpy.ndarray (boolean) :
|
Returns an empty array with size according to the volume
Parameters : | nt: int or None :
|
---|---|
Returns : | arr: numpy.ndarray :
|
Returns an empty nifti image with size according to the volume
Parameters : | nt: int or None :
|
---|---|
Returns : | arr: nibabel.Nifti1Image :
|
Provides a masked numpy array
Parameters : | nt: int or None :
dilate: callable or int or None :
|
---|---|
Returns : | msk: numpy.ndarray :
|
Provides a masked nifti image
Parameters : | nt: int or None :
dilate: callable or int or None :
|
---|---|
Returns : | msk: Nifti1image :
|
Converts sub to linear voxel indices.
Parameters : | ijk: numpy.ndarray :
|
---|---|
Returns : | lin: Px1 array with linear voxel indices. :
|
Converts sub indices to a list of triples
Parameters : | ijk: np.ndarray (Px3) :
|
---|---|
Returns : | triples: list with P triples :
|
Maps sub voxel indices to world coordinates.
Parameters : | ijk: numpy.ndarray (int) :
|
---|---|
Returns : | xyz : numpy.ndarray (float)
|
Converts sub to linear voxel indices.
Parameters : | Px1 array with linear voxel indices. : |
---|---|
Returns : | ijk: numpy.ndarray :
|
Maps linear voxel indices to world coordinates.
Parameters : | ijk: numpy.ndarray (int) :
|
---|---|
Returns : | xyz : np.ndarray (float)
|
Returns the mask as a vector
Returns : | mask: np.ndarray (vector with P values) :
|
---|
Returns the mask.
Returns : | mask: np.ndarray :
|
---|
Returns the number of voxels.
Returns : | nv: int :
|
---|
Returns : | nv: int :
|
---|
Compares this geometry with another instance
Parameters : | other: VolGeom :
|
---|---|
Returns : | same: boolean :
|
Compares the mask with another instance
Parameters : | other: VolGeom :
|
---|---|
Returns : | same: boolean :
|
Compares the shape of the spatial dimensions with another instance
Parameters : | other: VolGeom :
|
---|---|
Returns : | same: boolean :
|
Returns the shape.
Returns : | sh: tuple of int :
|
---|
Converts triples to sub indices
Parameters : | triples: list with P triples : |
---|---|
Returns : | ijk: np.ndarray(Px3) :
|
Maps world coordinates to sub voxel indices.
Parameters : | xyz : numpy.ndarray (float)
|
---|---|
Returns : | ijk: numpy.ndarray (int) :
|
Maps world coordinates to linear voxel indices.
Parameters : | xyz : numpy.ndarray (float)
|
---|---|
Returns : | ijk: numpy.ndarray (int) :
|