-
Notifications
You must be signed in to change notification settings - Fork 2
B: Get started.
A lot of scripts use our Matlab toolbox. Here are some useful information.
Download the most recent version of the toolbox. Add the toolbox to your Matlab path.
>> addpath(PATH_OF_DOWNLOADED_TOOLBOX);
Alternatively, you can add this to your startup.m file, which is read automatically every time Matlab starts.
The STC file format is a convenient tool for 2D data representation. In neuroimaging, we have been using this file format to represent the time series of brain activity over the cortical surface. STC file is essentially a two-dimensional matrix, which typically use rows to represent time series at different locations (vertices) and columns to represent the spatial distributions at different time points.
-
[data,vertex,onset_latency, sample_period]=inverse_read_stc(file_name): the Matlab function to read a STC file.
-
inverse_write_stc(data,vertex,onset_latency, sample_period, file_name): the Matlab function to write a STC file.
data is a 2D matrix.
vertex is a one-dimensional vector denoting the locations. This has been typically associated with the 0-based cortical vertex indices in FreeSurfer.
onset_latency is a scalar used for representing the onset of the time series (typically in milliseconds).
sample_period is a scalar used for representing the sampling period of the time series (typically in milliseconds).
NOTE In cases of using STC files to represent spatial distributions across different frequencies, the onset_latency and sample_period may not mean anything as the frequency step can be different between distributions, such as in a log-scale grid.
You must have FreeSurfer installed. You should set the environment variable SUBJECTS_DIR to the FreeSurfer reconstruction folder containing not only the subject of your interest but also the fsaverage subject.
Read a STC file and show the results
[stc,v]=inverse_read_stc(stc_file); %the variable stc_file contains the path and the file name of an STC file
etc_render_fsbrain('hemi','lh','overlay_vertex',v,'overlay_stc',stc); %for left hemisphere rendering
etc_render_fsbrain('hemi','rh','overlay_vertex',v,'overlay_stc',stc); %for right hemisphere rendering