Multivariate Pattern Analysis in Python |
Inheritance diagram for mvpa.misc.support:
Support function – little helpers in everyday life
Bases: dict
Simple class to define properties of an event.
The class is basically a dictionary. Any properties can be passed as keyword arguments to the constructor, e.g.:
>>> ev = Event(onset=12, duration=2.45)
Conventions for keys:
Convert onset and duration information into descrete timepoints.
Parameters: |
|
---|---|
Return : | A copy of the original Event with onset and optionally duration replaced by their corresponding descrete timepoint. The new onset will correspond to the timepoint just before or exactly at the original onset. The new duration will be the number of timepoints covering the event from the computed onset timepoint till the timepoint exactly at the end, or just after the event. Note again, that the new values are expressed as #timepoint and not in their original unit! |
Bases: object
World domination helper: do whatever it is asked and accumulate results
Initialize
Parameters: |
|
---|
Bases: object
Initialize
Parameters: |
|
---|
Call which gets called in the harvester.
Bases: object
Compute some overlap stats from a sequence of binary maps.
When called with a sequence of binary maps (e.g. lists or arrays) the fraction of mask elements that are non-zero in a customizable proportion of the maps is returned. By default this threshold is set to 1.0, i.e. such an element has to be non-zero in all maps.
Three additional maps (same size as original) are computed:
overlap_map: binary map which is non-zero for each overlapping element.
- spread_map: binary map which is non-zero for each element that is
non-zero in any map, but does not exceed the overlap threshold.
ovstats_map: map of float with the raw elementwise fraction of overlap.
All maps are available via class members.
Nothing to be seen here.
Bases: distutils.version.Version
A bit evolved comparison of versions
The reason for not using python’s distutil.version is that it seems to have no clue about somewhat common conventions of using ‘-dev’ or ‘dev’ or ‘rc’ suffixes for upcoming releases (so major version does contain upcoming release already).
So here is an ad-hoc and not as nice implementation
Convert history generated by RFE into the array of binary maps
Return a list of break points.
Parameters: |
|
---|---|
Raises : | ValueError |
Returns: | list of indexes for every new set of items |
Find all subsets of data
Parameters: |
|
---|
TODO: work out single stable implementation – probably just by fixing _getUniqueLengthNCombinations_lt3
Craft unique id+hash for an object
Given a value returns a string where each line is indented
Needed for a cleaner __repr__ output v - arbitrary
For given coord check if it is within a specified volume size.
Returns True/False. Assumes that volume coordinates start at 0. No more generalization (arbitrary minimal coord) is done to save on performance
Check if listed items are in sorted order.
Parameters: | items (iterable container) – |
---|---|
Returns: | True if were sorted. Otherwise False + Warning |
Use path to file1 as the path to file2 is no absolute path is given for file2
Parameters: | force (bool) – if True, force it even if the file2 starts with / |
---|
This function extracts boxcar windows from an array. Such a boxcar is defined by a starting point and the size of the window along the first axis of the array (boxlength). Afterwards a customizable function is applied to each boxcar individually (Default: averaging).
Parameters: |
|
---|---|
Return type: | array (len(startpoints) x data.shape[1:]) |
Convert literal string into a tuple, if possible of ints
Tuple of integers constructed by splitting at ‘.’ or interleaves of numerics and alpha numbers
Generator of unique combinations form a list L of objects in groups of size n.
# XXX EO: I guess they are already sorted. # XXX EO: It seems to work well for n>20 :)
Parameters: |
|
---|
Adopted from Li Daobing http://code.activestate.com/recipes/190465/ (MIT license, according to activestate.com’s policy)