-
Notifications
You must be signed in to change notification settings - Fork 7
Render brain
These are Matlab codes to show a 3D brain model reconstructed by FreeSurfer. Here we assume that all files were organized in folders specified by FreeSurfer. To make this work, you need to set the environment variable SUBJECTS_DIR
correctly.
setenv('SUBJECTS_DIR','/my/path/to/freesurfer/subjects');
This simple line in Matlab shows the brain surface. The default values are set to show the inflated left hemisphere surface of the subject "fsaverage".
etc_render_fsbrain;
You can use the default edit toolbar in the Matlab figure to zoom in/out and rotate the brain model for your visualization purpose.
Setting the variable 'subject' allows you to display the brain surface of a specific subject. Here is the example showing the inflated left hemisphere of the subject 'lf' on my computer.
etc_render_fsbrain('subject','lf');
By setting 'hemi' to either 'lh' or 'rh', you can specify to show left or right hemisphere brain.
etc_render_fsbrain('hemi','rh');
By setting 'surf' to either 'inflated', pial', or 'white', you can specify to show the inflated, pial, or gray-white matter boundary brain surface.
etc_render_fsbrain('surf','pial');
By default we use dark and light gray to indicate sulsi and gyri. However, you can cancel this setting to show a plain color by setting the 'flag_curv' to 0. The following example shows the pial surface with the same yellowish color.
''' etc_render_fsbrain('surf','pial','flag_curv',0); '''
Setting the values to 'curv_pos_color' and 'curv_neg_color' allows you to define the color (a 1x3 vector with values between 0 and 1 to indicate the color for R, G, and B) for positive and negative curvature, respectively. The following example shows the pial surface with positive curvature in gray and negative curvature in red.
etc_render_fsbrain('surf','pial','curv_pos_color',[180 180 180]./255,'curv_neg_color',[200, 0 0]./255);