Home > bioelectromagnetism > eeg_interp_sph_spline_test.m

eeg_interp_sph_spline_test

PURPOSE ^

eeg_interp_sph_sline_test - script to test eeg_interp_sph_spline

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 eeg_interp_sph_sline_test - script to test eeg_interp_sph_spline

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % eeg_interp_sph_sline_test - script to test eeg_interp_sph_spline
0002 %
0003 
0004 clear
0005 
0006 p = eeg_toolbox_defaults;
0007 
0008 p.volt.path = 'e:\matlab\eeg_toolbox\eeg_example_data\';
0009 p.volt.file = 'eeg_124ch_simulatedEMSE.txt'; % (400 rows x 125 columns)
0010 p.volt.type = 'ascii';
0011 
0012 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0013 % load electrode co-ordinates
0014 
0015 p = elec_open(p);
0016 p.elec.plot = 1;
0017 
0018 x = p.elec.data.x;
0019 y = p.elec.data.y;
0020 z = p.elec.data.z;
0021 
0022 % % create spherical electrode positions
0023 % r = 10
0024 % fprintf('...generating spherical interpolation points\n');
0025 % [x,y,z] = elec_sphere_points(16,24,r);
0026 %
0027 % p.elec.data.x = x;
0028 % p.elec.data.y = y;
0029 % p.elec.data.z = z;
0030 %
0031 % p.elec.data.Xsp = x;
0032 % p.elec.data.Ysp = y;
0033 % p.elec.data.Zsp = z;
0034 % p.elec.data.Rsp = [r r r];
0035 %
0036 % p.elec.n = 337;
0037 %elec_plot(p)
0038 
0039 
0040 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0041 % create simulated potential data
0042 
0043 p.volt.sampleHz = 1000;
0044 p.volt.sampleMsec = 1;
0045 p.volt.sampleTime = 1 * p.volt.sampleMsec;
0046 p.volt.samplePoint = 1;
0047 p.volt.epochStart = 0;
0048 p.volt.epochEnd = 1;
0049 
0050 p.volt.var = [];
0051 p.volt.timeArray = 0:1:10;
0052 p.volt.points = 10;
0053 p.volt.channels = length(x);
0054 p.volt.epochStart = 0;
0055 p.volt.epochEnd = 10;
0056 p.volt.sweeps = 1;
0057 p.volt.peaks = [];
0058 
0059 p.volt.data = repmat(p.elec.data.x',10,1);
0060 
0061 V = p.volt.data(p.volt.samplePoint,:);
0062 
0063 p.clickTimePoint = 0;
0064 p = eeg_contours_engine(p);
0065 
0066 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0067 % spherical spline interpolation
0068 
0069 FV = eeg_interp_sph_spline(V,[x y z]);
0070 
0071 p.elec.n = length(FV.vertices);
0072 p.elec.data.x = FV.vertices(:,1);
0073 p.elec.data.y = FV.vertices(:,2);
0074 p.elec.data.z = FV.vertices(:,3);
0075 p.elec.data.Xsp = FV.vertices(:,1);
0076 p.elec.data.Ysp = FV.vertices(:,2);
0077 p.elec.data.Zsp = FV.vertices(:,3);
0078 
0079 p.volt.data = repmat(FV.Cdata,10,1);
0080 
0081 p.volt.file = 'spherical spline interpolation';
0082 
0083 p = eeg_contours_engine(p);
0084 
0085 
0086 return
0087 
0088 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0089 % scd interpolation
0090 
0091 FV = eeg_interp_sph_spline_scd(V,[x y z]);
0092 
0093 p.elec.n = length(FV.vertices);
0094 p.elec.data.x = FV.vertices(:,1);
0095 p.elec.data.y = FV.vertices(:,2);
0096 p.elec.data.z = FV.vertices(:,3);
0097 p.elec.data.Xsp = FV.vertices(:,1);
0098 p.elec.data.Ysp = FV.vertices(:,2);
0099 p.elec.data.Zsp = FV.vertices(:,3);
0100 
0101 p.volt.data = repmat(FV.Cdata,10,1);
0102 
0103 p.volt.file = 'spherical spline scd interpolation';
0104 
0105 p = eeg_contours_engine(p);

Generated on Mon 15-Aug-2005 15:36:19 by m2html © 2003