Home > eeg > egis > scripts > run_ns_edit.m

run_ns_edit

PURPOSE ^

status = run_ns_edit(Epoch,Max_microv,Min_Chan,rawfname,Lo_Pass,Hi_Pass);

SYNOPSIS ^

function status = run_ns_edit(Epoch,Max_microv,Min_Chan,rawfname,Lo_Pass,Hi_Pass);

DESCRIPTION ^

 status = run_ns_edit(Epoch,Max_microv,Min_Chan,rawfname,Lo_Pass,Hi_Pass);

 Epoch = epoch length in seconds for artifact editing and spectral analysis
 Max_microv = maximum value in microvolts at a channel
 Min_Chan = minimum number of channelsin a good trial
 rawfname (optional) = NS Fragger filename
 Lo_Pass (optional) = Lo_Pass filtering frequency
 Hi_Pass (optional) = Hi_Pass filtering frequency

 Note: this code was developed for use in this lab
       please do not redistribute without my permission

 Version 1.0 R.S. 2/10/97

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function status = run_ns_edit(Epoch,Max_microv,Min_Chan,rawfname,Lo_Pass,Hi_Pass);
0002 % status = run_ns_edit(Epoch,Max_microv,Min_Chan,rawfname,Lo_Pass,Hi_Pass);
0003 %
0004 % Epoch = epoch length in seconds for artifact editing and spectral analysis
0005 % Max_microv = maximum value in microvolts at a channel
0006 % Min_Chan = minimum number of channelsin a good trial
0007 % rawfname (optional) = NS Fragger filename
0008 % Lo_Pass (optional) = Lo_Pass filtering frequency
0009 % Hi_Pass (optional) = Hi_Pass filtering frequency
0010 %
0011 % Note: this code was developed for use in this lab
0012 %       please do not redistribute without my permission
0013 %
0014 % Version 1.0 R.S. 2/10/97
0015 
0016 if nargin < 3
0017     error('not enough input arguments');
0018 end;
0019 if nargin == 3;
0020     [infid, rawfname] = get_fid('rb');
0021     fclose(infid);
0022 end
0023 if rawfname == [];
0024     [infid, rawfname] = get_fid('rb');
0025     fclose(infid);
0026     infid = fopen(rawfname,'rb','b');
0027 else
0028     infid = fopen(rawfname,'rb','b');
0029 end;
0030 if infid < 1
0031     error('invalid filename')
0032 end
0033 outfname = [rawfname '.mask'];
0034 outfid = fopen(outfname,'wb');
0035 fid = infid;
0036 [header_array, EventCodes,Samp_Rate, NChan, scale, NSamp, NEvent] = rd_fragger_hdr(infid);
0037 if nargin == 6
0038     [Epoch, NEpoch,Max_microv,Min_Chan,NBad_chan,bad_chan,mask] = ns_artifact_edit(fid,Samp_Rate,NChan, NSamp, NEvent,scale,Epoch,Max_microv,Min_Chan,Lo_Pass,Hi_Pass);
0039 elseif nargin == 5
0040     [Epoch, NEpoch,Max_microv,Min_Chan,NBad_chan,bad_chan,mask] = ns_artifact_edit(fid,Samp_Rate,NChan, NSamp, NEvent,scale,Epoch,Max_microv,Min_Chan,Lo_Pass);
0041 else
0042     [Epoch, NEpoch,Max_microv,Min_Chan,NBad_chan,bad_chan,mask] = ns_artifact_edit(fid,Samp_Rate,NChan, NSamp, NEvent,scale,Epoch,Max_microv,Min_Chan);
0043 end;
0044 
0045 
0046 status = write_mask(outfid,Epoch,NEpoch,NChan,Max_microv,Min_Chan,NBad_chan,bad_chan,mask);
0047 
0048 disp('BAD CHANNELS ARE')
0049 bad_chan
0050 
0051 disp('NUMBER OF AVAILABLE TRIALS')
0052 sum(mask(:,NChan+1))
0053 
0054 
0055 
0056 
0057 
0058 
0059 
0060 
0061 
0062

Generated on Wed 20-Sep-2023 04:00:50 by m2html © 2003