Multivariate Pattern Analysis in Python |
Inheritance diagram for mvpa.misc.io.base:
Some little helper for reading (and writing) common formats from and to disk.
Bases: dict
Read data that is stored in columns of text files.
All read data is available via a dictionary-like interface. If column headers are available, the column names serve as dictionary keys. If no header exists an articfical key is generated: str(number_of_column).
Splitting of text file lines is performed by the standard split() function (which gets passed the sep argument as separator string) and each element is converted into the desired datatype.
Because data is read into a dictionary no two columns can have the same name in the header! Each column is stored as a list in the dictionary.
Read data from file into a dictionary.
Parameters: |
|
---|
Returns the number of columns.
Returns the number of rows.
Returns the number of columns.
Returns the number of rows.
Return new ColumnData with selected samples
Write column data to a text file.
Parameters: |
|
---|
Bases: object
Base class for data readers.
Every subclass has to put all information into to variable:
This class provides two methods (and associated properties) to retrieve this information.
Cheap init.
Data array
Return the data array.
Return the dictionary with the data properties.
Property dict
Bases: mvpa.misc.io.base.ColumnData
Read and write PyMVPA sample attribute definitions from and to text files.
Read PyMVPA sample attributes from disk.
Parameters: |
|
---|
Returns the number of samples in the file.
Returns the number of samples in the file.
Convert into a list of Event instances.
Each change in the label or chunks value is taken as a new event onset. The length of an event is determined by the number of identical consecutive label-chunk combinations. Since the attributes list has no sense of absolute timing, both onset and duration are determined and stored in #samples units.
Parameters: | kwargs – Any keyword arugment provided would be replicated, through all the entries. |
---|
Write sample attributes to a text file.
Bases: mvpa.misc.io.base.ColumnData
Base class for sensor location readers.
Each subclass should provide x, y, z coordinates via the pos_x, pos_y, and pos_z attrbibutes.
Axes should follow the following convention:
x-axis: left -> right y-axis: anterior -> posterior z-axis: superior -> inferior
Pass arguments to ColumnData.
Get the sensor locations as an array.
Return type: | (nchannels x 3) array with coordinates in (x, y, z) |
---|
Bases: mvpa.misc.io.base.SensorLocations
Read sensor location definitions from a specific text file format.
File layout is assumed to be 7 columns:
1: sensor name 2: position on y-axis 3: position on x-axis 4: position on z-axis 5-7: same as 2-4, but for some outer surface thingie.
Note that x and y seem to be swapped, ie. y as defined by SensorLocations conventions seems to be first axis and followed by x.
Only inner surface coordinates are reported by locations().
Read sensor locations from file.
Parameters: | source (filename of an attribute file) – |
---|
Bases: mvpa.misc.io.base.SensorLocations
Read sensor location definitions from a specific text file format.
File layout is assumed to be 5 columns:
- sensor name
- some useless integer
- position on x-axis
- position on y-axis
- position on z-axis
Read sensor locations from file.
Parameters: | source (filename of an attribute file) – |
---|
Helper to convert design matrix into a list of labels
Given a design, assign a single label to any given sample
TODO: fix description/naming
Parameters: |
|
---|---|
Output : | list of labels which are taken from column names in ColumnData and baseline_label |