0001 function vb_check_sphere(brainfile,megfile,Vradius)
0002
0003
0004
0005
0006
0007
0008 if ~exist('Vradius','var') || isempty(Vradius)
0009 Vradius = 0.08;
0010 else
0011 Vradius = Vradius;
0012 end
0013
0014
0015 [pick,Qpick,Wsensor,Vcenter] = vb_load_sensor(megfile);
0016
0017
0018 [V,F] = vb_load_cortex(brainfile, 'subj');
0019 if ~isempty(F)
0020 F = F.F3;
0021 end
0022
0023
0024 NY = 2;
0025 NX = 2;
0026
0027
0028 fclr = [0.72 0.59 0.45];
0029
0030
0031 vangle = [ 0 90; 90 0 ; 180 0 ; 0 0 ];
0032 NV = size(vangle,1);
0033
0034 [sx,sy,sz]=sphere;
0035 sdim = size(sx);
0036 sx = sx*Vradius + repmat(Vcenter(1),sdim);
0037 sy = sy*Vradius + repmat(Vcenter(2),sdim);
0038 sz = sz*Vradius + repmat(Vcenter(3),sdim);
0039
0040 figure;
0041
0042 for n=1:NV
0043 subplot(NY,NX,n);
0044
0045
0046 plot3(V(:, 1), V(:, 2), V(:, 3), '.', 'Color', fclr);
0047 hold on;
0048 surf(sx,sy,sz);
0049 view( vangle(n,:) );
0050 xlabel('X')
0051 ylabel('Y')
0052 zlabel('Z')
0053 alpha(0.2);
0054 axis equal;
0055 axis tight;
0056 end
0057
0058 subplot(NY,NX,1);
0059 title('Sphere model overlapped on brain model')
0060