The Computational Neuroimaging Toolbox is a MATLAB toolbox for estimating input-referred models. Specifically, the toolbox contains tools for Fourier analyses of phase-encoded stimuli, population receptive field mapping, estimating parameters of generic (user-defined) input-referred models as well as performing ridge regression.
This code is hosted at https://github.com/ccnmaastricht/CNI_toolbox The latest version may always be found here.
This software was developed with MATLAB R2017a and access to the full suite of MATLAB add-on packages. Some of these packages may be required to run the software.
There are two options for installing the toolbox. Either download the toolbox file Computational Neuroimaging Toolbox.mltbx, navigate to the downloaded file within MATLAB and then execute the following command:
matlab.addons.toolbox.installToolbox('Computational Neuroimaging Toolbox.mltbx');
Alternatively, download the compressed toolbox Computational Neuroimaging Toolbox.zip and extract it into Documents/MATLAB/Add-Ons/Toolboxes.
This repository contains four files.
- PEA.m: a MATLAB class implementation of Fourier analysis of phase-encoded stimuli.
- pRF.m: a MATLAB class implementation of population receptive field mapping.
- IRM.m: a MATLAB class implementation of input-referred model estimation.
- RRT.m: a MATLAB class implementation of voxel-wise ridge regression.
pea = PEA(params) creates an instance of the PEA class. params is a structure with 7 required fields
- f_sampling: sampling frequency (1/TR)
- f_stim : stimulation frequency
- n_samples : number of samples (volumes)
- n_rows : number of rows (in-plane resolution)
- n_cols : number of columns (in-plance resolution)
- n_slices : number of slices
This class has the following functions
- delay = PEA.get_delay();
- direction = PEA.get_direction();
- PEA.set_delay(delay);
- PEA.set_direction(direction);
- results = PEA.fitting(data);
Use help PEA.function to get more detailed help on any specific function (e.g. help PEA.fitting)
typical workflow:
- pea = PEA(params);
- pea.set_delay(delay);
- pea.set_direction(direction);
- results = pea.fitting(data);
prf = pRF(params) creates an instance of the pRF class. params is a structure with 7 required fields
- f_sampling: sampling frequency (1/TR)
- n_samples : number of samples (volumes)
- n_rows : number of rows (in-plane resolution)
- n_cols : number of columns (in-plance resolution)
- n_slices : number of slices
- w_stimulus: width of stimulus images in pixels
- h_stimulus: height of stimulus images in pixels
optional inputs are
- hrf : either a column vector containing a single hemodynamic response used for every voxel; or a matrix with a unique hemodynamic response along its columns for each voxel. By default the canonical two-gamma hemodynamic response function is generated internally based on the scan parameters.
This class has the following functions
- hrf = pRF.get_hrf();
- stimulus = pRF.get_stimulus();
- tc = pRF.get_timecourses();
- pRF.set_hrf(hrf);
- pRF.set_stimulus(stimulus);
- pRF.import_stimulus();
- pRF.create_timecourses();
- results = pRF.mapping(data);
Use help pRF.function to get more detailed help on any specific function (e.g. help pRF.mapping)
typical workflow:
- prf = pRF(params);
- prf.import_stimulus();
- prf.create_timecourses();
- results = prf.mapping(data);
irm = IRM(params) creates an instance of the IRM class. params is a structure with 5 required fields
- f_sampling: sampling frequency (1/TR)
- n_samples : number of samples (volumes)
- n_rows : number of rows (in-plane resolution)
- n_cols : number of columns (in-plance resolution)
- n_slices : number of slices
optional inputs are
- hrf : either a column vector containing a single hemodynamic response used for every voxel; or a matrix with a unique hemodynamic response along its columns for each voxel. By default the canonical two-gamma hemodynamic response function is generated internally based on the scan parameters.
This class has the following functions
- hrf = IRM.get_hrf();
- stimulus = IRM.get_stimulus();
- tc = IRM.get_timecourses();
- IRM.set_hrf(hrf);
- IRM.set_stimulus(stimulus);
- IRM.create_timecourses();
- results = IRM.mapping(data);
Use help IRM.function to get more detailed help on any specific function (e.g. help IRM.mapping)
typical workflow:
- irm = IRM(params);
- irm.set_stimulus();
- irm.create_timecourse(FUN,xdata);
- results = irm.mapping(data);
rrt = RRT(params) creates an instance of the RRT class. params is a structure with 5 required fields
- f_sampling: sampling frequency (1/TR)
- n_samples : number of samples (volumes)
- n_rows : number of rows (in-plane resolution)
- n_cols : number of columns (in-plance resolution)
- n_slices : number of slices
optional inputs are
- hrf : either a column vector containing a single hemodynamic response used for every voxel; or a matrix with a unique hemodynamic response along its columns for each voxel. By default the canonical two-gamma hemodynamic response function is generated internally based on the scan parameters.
This class has the following functions
- hrf = RRT.get_hrf();
- X = RRT.get_design();
- RRT.set_hrf(hrf);
- RRT.set_design(X);
- RRT.optimize_lambda(data,range);
- results = RRT.perform_ridge(data);
Use help RRT.function to get more detailed help on any specific function (e.g. help RRT.perform_ridge)
typical workflow:
- rrt = RRT(params);
- rrt.set_design(X);
- rrt.optimize_lambda(data,range);
- results = rrt.perform_ridge(data);