CoSMoMVPA functions

Dataset input/output

cosmo check dataset

Check consistency of a dataset.

cosmo fmri dataset

load an fmri volumetric dataset

cosmo map2fmri

maps a dataset structure to a NIFTI, AFNI, or BV structure or file

cosmo map2meeg

maps a dataset to a FieldTrip or EEGlab structure or file

cosmo map2surface

maps a dataset structure to AFNI/SUMA NIML dset or BV SMP file

cosmo meeg dataset

Returns a dataset structure based on MEEG data

cosmo surface dataset

Returns a dataset structure based on surface mesh data

cosmo synthetic dataset

generate synthetic dataset

Dataset operations

cosmo dim insert

insert a dataset dimension

cosmo dim prune

prune dataset dimension values that are not used after slicing

cosmo dim remove

remove a dataset dimension

cosmo dim rename

rename dimension attribute name

cosmo dim transpose

move a dataset dimension from samples to features or vice versa

cosmo slice

Slice a dataset by samples (the default) or features

cosmo split

splits a dataset by unique values in (a) sample or feature attribute(s).

cosmo stack

stacks multiple datasets to yield a single dataset

Dataset processing

cosmo average samples

average subsets of samples by unique combinations of sample attributes

cosmo fx

apply a function to unique combinations of .sa or .fa values

cosmo meeg baseline correct

correct baseline of MEEG dataset

cosmo normalize

normalize dataset either by estimating or applying estimated parameters

cosmo randomize targets

provides randomized target labels

cosmo remove useless data

remove ‘useless’ (constant and/or non-finite) samples or features

MEEG related functions

cosmo meeg chan neighborhood

determine neighborhood of channels in MEEG dataset

cosmo meeg chan neighbors

find neighbors of MEEG channels

cosmo meeg chantype

return channel types and optionally a feature mask matching a type

cosmo meeg find layout

finds an MEEG channel layout associated with a dataset

cosmo meeg layout collection

return supported MEEG channel layouts

cosmo meeg read layout

Read FieldTrip layout

cosmo meeg senstype2layout mapping

return mapping from MEEG sensor types to sensor layouts

cosmo meeg senstype collection

return supported MEEG acquisition systems and their channel labels

fMRI related functions

cosmo fmri convert xform

convert xform code between numeric and string in fmri dataset

cosmo fmri deoblique

de-oblique a dataset

cosmo fmri orientation

get orientation of a dataset

cosmo fmri reorient

Change the orientation of an fmri dataset

cosmo vol coordinates

convert to and from spatial (x,y,z) coordinates

cosmo vol grid convert

convert between volumetric (fmri) and grid-based (meeg source) dataset

Data visualization

cosmo disp

display the input as a string representation

cosmo plot slices

Plots a set of slices from a dataset, nifti image, or 3D data array


cosmo corr

Computes correlation - faster than than matlab’s “corr” for Pearson.

cosmo correlation measure

Computes a split-half correlation measure

Classification and cross-validation

cosmo classify knn

k-nearest neighbor classifier

cosmo classify lda

linear discriminant analysis classifier - without prior

cosmo classify libsvm

libsvm-based SVM classifier

cosmo classify matlabsvm

SVM multi-classifier using matlab’s SVM implementation

cosmo classify matlabsvm 2class

svm classifier wrapper (around svmtrain/svmclassify)

cosmo classify meta feature selection

meta classifier that uses feature selection on the training data

cosmo classify naive bayes

naive bayes classifier

cosmo classify nn

nearest neighbor classifier

cosmo classify svm

classifier wrapper that uses either matlab’s or libsvm’s SVM.

cosmo confusion matrix

Returns a confusion matrix

cosmo crossvalidate

performs cross-validation using a classifier

cosmo crossvalidation measure

performs cross-validation using a classifier

cosmo winner indices

Given multiple predictions, get indices that were predicted most often.

Representational similarity analysis

cosmo dim generalization measure

measure generalization across pairwise combinations over time (or any other dimension)

cosmo dissimilarity matrix measure

Compute a dissimilarity matrix measure

cosmo distatis

apply DISTATIS measure to each feature

cosmo pdist

compute pair-wise distance between samples in a matrix

cosmo squareform

converts pair-wise distances between matrix and vector form

cosmo target dsm corr measure

measure correlation with target dissimilarity matrix

Partitioning (for cross-validation)

cosmo balance partitions

balances a partition so that each target occurs equally often in each training and test chunk

cosmo check partitions

check whether partitions are balanced and not double-dippy

cosmo check partitions

check whether partitions are balanced and not double-dippy

cosmo chunkize

assigns chunks that are as balanced as possible based on targets.

cosmo independent samples partitioner

Compute partitioning scheme based on dataset with independent samples

cosmo nchoosek partitioner

partitions for into nchoosek(n,k) parititions with optional grouping schemas.

cosmo nfold partitioner

generates an n-fold partition scheme

cosmo oddeven partitioner

generates an odd-even partition scheme

Neighborhoods and searchlight

cosmo cross neighborhood

cross neighborhoods along dataset dimensions

cosmo interval neighborhood

compute neighborhoods stretching intervals

cosmo meeg chan neighborhood

determine neighborhood of channels in MEEG dataset

cosmo naive bayes classifier searchlight

Run (fast) Naive Bayes classifier searchlight with crossvalidation

cosmo neighborhood split

partitions a neighborhood in a cell with (smaller) neigborhoods

cosmo searchlight

Generic searchlight function returns a map of results computed at each searchlight location

cosmo sphere offsets

computes sub index offsets for voxels in a sphere

cosmo spherical neighborhood

computes neighbors for a spherical searchlight

cosmo surficial neighborhood

neighborhood definition for surface-based searchlight

Feature-based clustering

cosmo check neighborhood

check that a neighborhood is kosher

cosmo cluster neighborhood

define neighborhood suitable for cluster-based analysis

cosmo clusterize

fast depth-first clustering based on equal values of neighbors

cosmo convert neighborhood

Converts between cell, matrix and struct representations of neighborhoods

cosmo find local extrema

find local extrema in a dataset using a neighborhood

cosmo measure clusters

General cluster measure

cosmo montecarlo cluster stat

compute random-effect cluster statistics corrected for multiple comparisons

Univariate statistics

cosmo anova feature selector

find the features that show the most variance between classes

cosmo stat

compute t-test or F-test (ANOVA) statistic

cosmo statcode

Convert statcode for different analysis packages

Utility functions

cosmo align

find permutation so that values in two inputs are matched

cosmo cartprod

returns the cartesian product with all combinations of the input

cosmo dim find

find dimension attribute in dataset

cosmo dim match

return a mask indicating match of dataset dimensions with values

cosmo index unique

index unique (combinations of) elements

cosmo isequaln

compares two input for equality with NaNs considered being equal

cosmo isfield

checks the presence of (possibly nested) fieldnames in a struct

cosmo map pca

normalize dataset either by estimating or applying estimated parameters

cosmo mask dim intersect

find intersection mask across a set of datasets

cosmo match

returns a mask indicating matching occurences in two arrays or cells relative to the second array

cosmo overlap

compute overlap between vectors or cellstrings in two cells

cosmo pca

Principal Component Analysis

cosmo rand

generate uniform pseudo-random numbers, optionally using a seed value

cosmo randperm

generate random permutation of integers

cosmo sample unique

sample without replacement from subsets of integers in balanced manner

cosmo strjoin

joins strings using a delimeter string

cosmo strsplit

splits a string based on another delimeter string

cosmo structjoin

joins values in structs or key-value pairs

cosmo tail

find values in left or right tail of a vector or string

Misceleanous helper functions

cosmo check external

Checks whether a certain external toolbox exists, or list citation info

cosmo config

return a struc with configuration settings, or store such settings

cosmo config

return a struc with configuration settings, or store such settings

cosmo dir

list files recursively in a directory

cosmo flatten

flattens an arbitrary array to a dataset structure

cosmo parallel get nproc available

get number of processes available from Matlab parallel processing pool

cosmo parcellfun

applies a function to elements in a cell in parallel

cosmo set path

set the matlab path for CoSMoMVPA

cosmo show progress

Shows a progress bar, and time elapsed and expected to complete.

cosmo type

print or return ASCII contents of a file

cosmo unflatten

unflattens a dataset from 2 to (1+K) dimensions.

cosmo warning

show a warning message; by default just once for each message

cosmo wizard set config

GUI-based ‘wizard’ to set CoSMoMVPA configuration file

Developer functions

cosmo make temp filename

give temporary filename that does not exist when this function is called

cosmo notify test skipped

notify that a test in the test suite is skipped

cosmo publish run scripts

helper function to publish example scripts (for developers)

cosmo run tests

run unit and documentation tests

cosmo skip test if no external

Notify that test in the test suite is skipped if no external is present

cosmo wtf

return system, toolbox and externals information

Deprecated - to be removed in the future

cosmo dataset slice fa

Slice a dataset by features (columns) [deprecated]

cosmo dataset slice sa

Slice a dataset by samples (rows) [deprecated]

cosmo dim slice

slice and prune a dataset with dimension attributes [deprecated]

cosmo meta feature selection classifier

meta classifier that uses feature selection on the training data [deprecated]

Other functions (possibly experimental)

cosmo montecarlo phase stat

compute phase statistics based on Monte Carlo simulation

cosmo norminv

compute inverse normal cumulative distribution function

cosmo phase itc

compute phase inter trial coherence

cosmo tiedrank

Compute ranks for the input along the specified dimension

cosmo classify matlabcsvm

svm classifier wrapper (around fitcsvm)

cosmo balance dataset

sub-sample a dataset to have an equal number of samples for each target

cosmo singleton neighborhood

return neighborhood where each feature is only neighbor of itself

cosmo phase stat

Compute phase perturbation, or opposition sum or product phase statistic