• If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • Whenever you search in PBworks, Dokkio Sidebar (from the makers of PBworks) will run the same search in your Drive, Dropbox, OneDrive, Gmail, and Slack. Now you can find what you're looking for wherever it lives. Try Dokkio Sidebar for free.


Electrode Visualization

Page history last edited by David Groppe 3 years, 6 months ago

The main MATLAB function for visualizing the cortical surface is plotPialSurf.m. Below are some examples of how to use it for electrode visualization. plotPialSurf.m is a very flexible function and for brevity, we will not cover all the options it supports here. To see all options, enter:

>>help plotPialSurf.m


Tutorial Data:

You can download the data used in the tutorial below from here. These data consists of a FreeSurfer folder for PT001. Place the PT001 folder in your FreeSurfer subjects directory and you should be able to run the commands below after you've run the localization tutorial commands.



1. Viewing the anatomical location of electrodes

To simply view ECoG electrode locations on the pial surface, you can do something like this:


>>cfg.title='PT001: DK Atlas'; 



which colors the pial surface according to FreeSurfer's Desikan-Killiany anatomical atlas to produce this image:


Note that you can click on an electrode to see its label. If you click on the label it should disappear.


You can view the brain from other angles or plot multiple views at once. In addition, you can use a somewhat more complex set of anatomical labels from FreeSurfer's Destrieux atlas:

>>cfg.title='PT001: Destrieux Atlas';


which produces the image below:



2. View the location of depth electrodes with semi-transparent pial surface:

Visualizing the location of depth electrodes in 3D is tricky. Currently, plotPialSurf you can make the pial surface transparent to provide some sense of this:






3. Coloring electrodes to reflect iEEG values

You can color the electrodes to reflect iEEG data by using the elecColors and elecNames arguments of plotPialSurf. elecNames is a n-length cell array of electrode names can either be a n-length vector of data values or a nx3 matrix of RGB values. When elecColors contains a vector of values, it is converted to a color map according to the elecColorScale argument. For example:

>>for a=1:8,
>>    elecNames{a}=sprintf('LGd%d',a+16);

>>cfg.title='PT001: Stimulus Correlations';


produces a figure that looks something like this:

Note the use of the cfg.elecShape to render the electrodes as spheres. This can produce somewhat nicer electrode plots.



4. Drawing bars between electrodes to reflect bipolar iEEG values

To visualize bipolar referenced data, plotPialSurf can draw colored lines by using the pairs argument. pairs is a cell array. The first two elements of each row indicate electrode names and the third is the RGB color of the line that will join the electrodes. The fourth element indicates the hemisphere that the pair resides in. Additional optional columns can provide a label that will appear when the line is clicked on or individually specify the thickness of the line.


For example:

>>for a=1:7,
>>  ct=ct+1;
>>  pairs{ct,1}=sprintf('LGd%d',a+8);
>>  pairs{ct,2}=sprintf('LGd%d',a+1+8);
>>  pairs{ct,3}=rand(1,3); % RGB val
>>  pairs{ct,4}='L';
>>cfg.title='PT001: Stimulus Correlations';


will produce an image that looks something like this:

Note that sometimes the bars between electrodes will disappear into the pial surface. When this happens, you can use the pullOut option of plotPialSurf to fix this by moving the electrodes away from the pial surface towards the viewer.



5. Plotting both hemispheres on the same axis

For bilateral implants, if you want to visualized both hemispheres on the same axis you can call plotPialSurf twice with the cfg.axis option set to the same axis:


>>figure(1); clf;
>>% Plot left hem
>>cfg.axis=gca(); % axis handle (in this case the current axis)
>>% Plot right hem

You can then rotate the resulting plot to a desired view:


Comments (0)

You don't have permission to comment on this page.