fsl.data.gifti¶
This class provides classes and functions for working with GIFTI files.
The GIFTI file format specification can be found at http://www.nitrc.org/projects/gifti/
Support is currently very basic - only the following classes/functions are available:
GiftiMeshClass which represents a GIFTI surface image. loadGiftiMeshExtracts surface data from the given nibabel.gifti.GiftiImage.loadGiftiVertexDataLoads vertex data from the given GIFTI file. relatedFilesGiven a GIFTI file, returns a list of other GIFTI files in the same directory which appear to be related with the given one.
-
fsl.data.gifti.ALLOWED_EXTENSIONS= ['.surf.gii']¶ List of file extensions that a file containing Gifti surface data is expected to have.
-
fsl.data.gifti.EXTENSION_DESCRIPTIONS= ['GIFTI surface file']¶ A description for each of the
ALLOWED_EXTENSIONS.
-
class
fsl.data.gifti.GiftiMesh(infile, fixWinding=False, loadAll=False)¶ Bases:
fsl.data.mesh.MeshClass which represents a GIFTI surface image. This is essentially just a 3D model made of triangles.
For each GIFTI surface file that is loaded, the
nibabel.gifti.GiftiImageinstance is stored in theMetastore, with the absolute path to the surface file as the key.-
loadVertices(infile, key=None, *args, **kwargs)¶ Overrides the
Mesh.loadVertices()method.Attempts to load vertices for this
GiftiMeshfrom the giveninfile, which may be a GIFTI file or a plain text file containing vertices.
-
loadVertexData(infile, key=None)¶ Overrides the
Mesh.loadVertexData()method.Attempts to load data associated with each vertex of this
GiftiMeshfrom the giveninfile, which may be a GIFTI file or a plain text file which contains vertex data.
-
-
fsl.data.gifti.loadGiftiMesh(filename)¶ Extracts surface data from the given
nibabel.gifti.GiftiImage.The image is expected to contain the following``<DataArray>`` elements:
- one comprising
NIFTI_INTENT_POINTSETdata (the surface vertices) - one comprising
NIFTI_INTENT_TRIANGLEdata (vertex indices defining the triangles).
A
ValueErrorwill be raised if this is not the case.Parameters: filename – Name of a GIFTI file containing surface data. Returns: A tuple containing these values: - The loaded
nibabel.gifti.GiftiImageinstance - A
(N, 3)array containingNvertices. - A
(M, 3))array containing the vertex indices forMtriangles.
- one comprising
-
fsl.data.gifti.loadGiftiVertexData(filename)¶ Loads vertex data from the given GIFTI file.
It is assumed that the given file does not contain any
NIFTI_INTENT_POINTSETorNIFTI_INTENT_TRIANGLEdata arrays, and which contains either:- One
(M, N)data array containingNdata points forMvertices - One or more
(M, 1)data arrays each containing a single data point forMvertices, and all with the same intent code
Returns a tuple containing:
- The loaded
nibabel.gifti.GiftiImageobject - A
(M, N)numpy array containingNdata points forMvertices
- One
Given a GIFTI file, returns a list of other GIFTI files in the same directory which appear to be related with the given one. Files which share the same prefix are assumed to be related to the given file.
Parameters: - fname – Name of the file to search for related files for
- ftype – If provided, only files with suffixes in this list are searched for. Defaults to files which contain vertex data.
-
class
fsl.data.gifti.GiftiSurface(infile, fixWinding=False)¶ Bases:
fsl.data.mesh.TriangleMeshDeprecated - use GiftiMesh instead.
-
loadVertexData(dataSource, vertexData=None)¶ Deprecated - use GiftiMesh instead.
Deprecated in 1.6.0, to be removed in 2.0.0. Use GiftiMesh instead
-
-
fsl.data.gifti.loadGiftiSurface(filename)¶ Deprecated - use loadGiftiMesh instead.
Deprecated in 1.6.0, to be removed in 2.0.0. Use loadGiftiMesh instead