GIfTI format IO
giftiio | |
gifti |
GiftiCoordSystem([dataspace, xformspace, xform]) | |
GiftiDataArray([data]) | |
GiftiImage([meta, labeltable, darrays, version]) | |
GiftiLabel([key, label, red, green, blue, alpha]) | |
GiftiLabelTable() | |
GiftiMetaData([nvpair]) | A list of GiftiNVPairs in stored in |
GiftiNVPairs([name, value]) | |
data_tag(dataarray, encoding, datatype, ordering) | Creates the data tag depending on the required encoding |
read(filename) | Load a Gifti image from a file |
write(image, filename) | Save the current image to a new file |
Outputter() | |
parse_gifti_file(fname[, buffer_size]) | Parse gifti file named fname, return image |
read_data_block(encoding, endian, ordering, ...) | Tries to unzip, decode, parse the funny string data |
Bases: object
alias of GiftiCoordSystem
alias of ndarray
alias of int
alias of list
alias of int
alias of int
alias of str
alias of str
Creates a new Gifti data array
Parameters: | darray : ndarray
intent : string
datatype : None or string, optional
encoding : string, optionaal
endian : string, optional
coordsys : GiftiCoordSystem, optional
ordering : string, optional
meta : None or dict, optional
|
---|---|
Returns: | da : instance of our own class |
Returns metadata as dictionary
alias of int
alias of int
alias of GiftiMetaData
alias of int
Bases: object
Adds a data array to the GiftiImage
Parameters: | dataarr : GiftiDataArray |
---|
alias of str
Returns a a list of GiftiDataArray elements matching the given intent
alias of int
Removes the ith data array element from the GiftiImage
Removes all the data arrays with the given intent type
Set the labeltable for this GiftiImage
Parameters: | labeltable : GiftiLabelTable |
---|
Set the metadata for this GiftiImage
Parameters: | meta : GiftiMetaData |
---|---|
Returns: | None : |
Return XML corresponding to image content
alias of str
Bases: object
alias of float
alias of float
Returns RGBA as tuple
alias of float
alias of int
alias of str
alias of float
Creates the data tag depending on the required encoding
Load a Gifti image from a file
Parameters: | filename : string
|
---|---|
Returns: | img : GiftiImage
|
Save the current image to a new file
Parameters: | image : GiftiImage
filename : string
|
---|---|
Returns: | None : |
Notes
We write all files with utf-8 encoding, and specify this at the top of the XML file with the encoding attribute.
The Gifti spec suggests using the following suffixes to your filename when saving each specific type of data:
The Gifti file is stored in endian convention of the current machine.
Bases: object
Collect character data chunks pending collation
The parser breaks the data up into chunks of size depending on the buffer_size of the parser. A large bit of character data, with standard parser buffer_size (such as 8K) can easily span many calls to this function. We thus collect the chunks and process them when we hit start or end tags.
Collate and process collected character data
Initialize outputter
True if there is character data pending for processing
Parse gifti file named fname, return image
Parameters: | fname : str
buffer_size: None or int, optional :
|
---|---|
Returns: | img : gifti image |