Back to the main page.
Bug 555 - ft_plot_mesh on reference channels
Status |
CLOSED FIXED |
Reported |
2011-03-30 11:48:00 +0200 |
Modified |
2011-03-30 13:46:15 +0200 |
Product: |
FieldTrip |
Component: |
forward |
Version: |
unspecified |
Hardware: |
PC |
Operating System: |
Linux |
Importance: |
P1 normal |
Assigned to: |
Johanna |
URL: |
|
Tags: |
|
Depends on: |
|
Blocks: |
|
See also: |
|
Johanna - 2011-03-30 11:48:51 +0200
I got an error when I follow the example on the wiki:
http://fieldtrip.fcdonders.nl/example/make_leadfields_using_different_headmodels?s[]=localspheres#local_spheres_model_from_fieldtrip_using_the_ctf_headshape
hdr=ft_read_header('/data/johzum/delange2008data/dataset02.ds');
cfg=[];
cfg.grad=hdr.grad;
cfg.headshape='/data/johzum/delange2008data/dataset02.shape';
ft_headshape=ft_prepare_localspheres(cfg);
ft_prepare_localspheres runs fine on the 151 MEG sensors, but then crashes when it reaches channel 152 which is a reference channel. Error is:
??? Undefined function or variable "hs".
Error in ==> ft_plot_mesh at 148
set(hs, 'FaceAlpha', facealpha);
Error in ==> ft_prepare_localspheres at 190
ft_plot_mesh(headshape.pnt(shapesel,:), 'vertexcolor', 'g');
'hs' doesn't exist because 'pnt' is empty.
After a quick chat with JM, I have fixed this by adding to ft_plot_mesh, line 147:
elseif ~isempty(pnt) && numel(facealpha)==1
It now works fine, and simply doesn't plot for channels which are outside the default radius.