1 function [HDR]=
fltopen(arg1,arg3,arg4,arg5,arg6)
2 % FLTOPEN opens FLT file
3 % However, it is recommended to use SOPEN instead .
4 % For loading whole data files, use SLOAD.
6 % see also: SOPEN, SREAD, SSEEK, STELL, SCLOSE, SWRITE, SEOF
10 % $Id:
fltopen.m 2663 2011-04-01 15:04:08Z schloegl $
11 % Copyright (c) 2006,2007,2008,2009 by Alois Schloegl <a.schloegl@ieee.org>
12 % This is part of the BIOSIG-toolbox http:
14 % This program is free software; you can redistribute it and/or
15 % modify it under the terms of the GNU General Public License
16 % as published by the Free Software Foundation; either version 3
17 % of the License, or (at your option) any later version.
23 HDR.FileName = FILENAME;
24 [pfad,file,FileExt] = fileparts(HDR.FileName);
27 HDR.FILE.Ext = FileExt(2:length(FileExt));
28 HDR.FILE.PERMISSION =
'r';
34 if any(HDR.FILE.PERMISSION==
'r'),
37 fid = fopen(fullfile(HDR.FILE.Path,[HDR.FILE.Name,
'.hdr']),
'rt');
38 [r,c] = fread(fid,[1,inf],
'uint8');
44 FLAG.BioSig = 0; FLAG.LockBioSig = 0;
45 %HDR.FLT.remark =
'Do Not Modify !!!';
50 while any(r0==
'['); %~strcmp(hdr,
'System'),
51 [t1,r0] = strtok(r0,
'['); % search begin of section
52 [hdr,body] = strtok(t1,
']'); % search end of section header
53 body = strtok(body,
'[]');
57 [tline,body] = strtok(body,[10,13]);
58 [tok1,left1] = strtok(tline,[
'=']);
59 [tok2,left2] = strtok(left1,[10,13,
'=']);
61 elseif strncmp(tok1,
'*',1);
62 elseif ~any(tline==
'='),
63 elseif any(tok2==
'{');
64 [tok,block]=strtok(body,
'{}');
65 b = setfield(b,tok1,tok);
66 body = body(min(find(body==
'}'))+1:end);
70 b = setfield(b,tok1,tok2);
72 b = setfield(b,tok1,num);
76 HDR.FLT = setfield(HDR.FLT,hdr,b);
79 HDR.SPR = HDR.FLT.Dataformat.number_of_samples;
81 HDR.NS = HDR.FLT.System.number_of_channels;
82 [n,v,sa]=
str2double(HDR.FLT.System.parameter_of_sensors);
83 %HDR.FLT.System = rmfield(HDR.FLT.System,
'parameter_of_sensors');
84 HDR.FLT.sensors.id = n(:,1);
85 HDR.FLT.sensors.name = sa(:,2);
86 HDR.FLT.sensors.type = n(:,3);
87 HDR.FLT.sensors.mod = n(:,4);
88 HDR.FLT.sensors.XYZabcArea = n(:,5:11);
90 % HDR.FLT.sensors.id(n(:,1)+1,1) = n(:,1);
91 % HDR.FLT.sensors.name(n(:,1)+1,:) = sa(:,2);
92 % HDR.FLT.sensors.type(n(:,1)+1,:) = n(:,3);
93 % HDR.FLT.sensors.mod(n(:,1)+1,:) = n(:,4);
94 % HDR.FLT.sensors.XYZabcArea(n(:,1)+1,:) = n(:,5:11);
96 [n,v,sa]=
str2double(HDR.FLT.System.parameter_of_groups);
97 % HDR.FLT.System = rmfield(HDR.FLT.System,
'parameter_of_groups');
98 HDR.FLT.groups.id = n(:,1);
99 HDR.FLT.groups.usage = n(:,2);
100 HDR.FLT.groups.name = sa(:,3);
101 HDR.FLT.groups.unit = sa(:,4);
102 HDR.FLT.groups.unit_exp = n(:,5);
103 HDR.FLT.groups.calib = n(:,6);
104 Cal_Group(n(:,1)+1) = n(:,6).*10.^n(:,5);
105 PhysDim_Group(n(:,1)+1) = sa(:,4);
107 [n,v,sa]=
str2double(HDR.FLT.System.parameter_of_modules);
108 HDR.FLT.System = rmfield(HDR.FLT.System,
'parameter_of_modules');
109 HDR.FLT.modules.id = n(:,1);
110 HDR.FLT.modules.name = sa(:,2);
111 HDR.FLT.modules.XYZabc = n(:,3:8);
112 HDR.FLT.modules.unit = n(:,9);
113 HDR.FLT.modules.exp = n(:,10);
114 HDR.FLT.modules.unitname = sa(:,11);
116 [tline,tch] = strtok(HDR.FLT.System.parameter_of_channels,[10,13]);
117 HDR.FLT.System = rmfield(HDR.FLT.System,
'parameter_of_channels');
119 HDR.FLT.channels.num = repmat(NaN,HDR.NS,9);
120 HDR.FLT.channels.seq = repmat(NaN,HDR.NS,1);
121 HDR.FLT.channels.id = repmat(NaN,HDR.NS,1);
122 HDR.FLT.channels.usage = repmat(NaN,HDR.NS,1);
123 HDR.FLT.channels.cal = repmat(NaN,HDR.NS,1);
124 HDR.FLT.channels.Cal = sparse(HDR.NS,HDR.FLT.System.number_of_sensors);
125 HDR.FLT.channels.grd_mode = repmat(NaN,HDR.NS,1);
126 HDR.FLT.channels.grp_id = repmat(NaN,HDR.NS,1);
128 while ~isempty(tline),
131 HDR.FLT.channels.num(K,:)=n;
134 HDR.FLT.channels.seq(ch) = n(1);
135 HDR.FLT.channels.id(ch) = n(2);
136 HDR.FLT.channels.usage(ch) = n(3);
137 HDR.Label{ch} = sa{4};
138 HDR.FLT.channels.cal(ch) = n(5);
139 HDR.FLT.channels.grd_mode(ch) = n(6);
140 HDR.FLT.channels.grd_mode_name{ch} = sa{7};
141 HDR.FLT.channels.grp_id(ch) = n(8);
142 HDR.FLT.channels.no_sensors(ch) = n(9);
145 [tline,tch] = strtok(tch,[10,13]);
148 sen = find(n1(1)==HDR.FLT.sensors.id);
149 HDR.FLT.channels.Cal(ch,sen) = n1(2);
150 if (length(sa)>=4) && ~strcmp(sa{4},HDR.FLT.sensors.name{sen}),
151 fprintf(HDR.FILE.stderr,
'Warning SOPEN(ET-MEG): sensor name does not fit: %s %s. \n Maybe header of file %s is corrupted!\n',sa{4},HDR.FLT.sensors.name{sen}, HDR.FileName);
154 [tline,tch] = strtok(tch,[10,13]);
157 if isfield(HDR.FLT.Header,
'name_of_data_file');
158 if exist(fullfile(HDR.FILE.Path,HDR.FLT.Header.name_of_data_file)),
159 HDR.FLT.datafile = HDR.FLT.Header.name_of_data_file;
162 if HDR.FLT.Dataformat.type(1)<10;
163 HDR.Endianity =
'ieee-be';
165 HDR.Endianity =
'ieee-le';
167 switch mod(HDR.FLT.Dataformat.type(1),10)
179 fprintf(HDR.FILE.stderr,
'Error SOPEN(FLT): type %i not supported',type);
182 [tmp,scale] =
physicalunits(HDR.FLT.Measurement.sampling_unit);
183 HDR.SampleRate = 10.^-HDR.FLT.Measurement.sampling_exponent ./ (HDR.FLT.Measurement.sampling_step.*scale);
184 tmp = [HDR.FLT.Measurement.measurement_day,
' ',HDR.FLT.Measurement.measurement_time];
188 if isfield(HDR.FLT,
'Patient'),
189 HDR.Patient.Sex = 0; % unknown
190 HDR.FLT.Patient.remark =
'Do Not Modify !!!';
191 if isfield(HDR.FLT.Patient,
'sex')
192 tmp = deblank(HDR.FLT.Patient.sex);
194 HDR.Patient.Sex = any(tmp(1)=='mM1') + 2*any(tmp(1)=='fFwW2');
197 if isfield(HDR.FLT.Patient,'birthday')
198 tmp = deblank(HDR.FLT.Patient.birthday);
199 tmp(tmp=='.' | tmp=='-' | tmp=='/')=' ';
201 if length(tmp)==3 & ~any(v),
202 HDR.Patient.Birthday(1:3) = tmp;
206 HDR.PhysDim = PhysDim_Group(HDR.FLT.channels.grp_id+1);
207 HDR.Cal = Cal_Group(HDR.FLT.channels.grp_id+1);
209 ix1 = strmatch('gr1s',HDR.FLT.channels.grd_mode_name,'exact');
210 ix2 = find(any(HDR.FLT.channels.Cal(ix1,:),1));
211 tmp = size(HDR.FLT.channels.Cal);
212 ix1 = 1:tmp(1); ix2 = 1:tmp(2);
213 grad.tra = HDR.FLT.channels.Cal;
214 grad.pnt = HDR.FLT.sensors.XYZabcArea(:,1:3);
215 grad.ori = HDR.FLT.sensors.XYZabcArea(:,4:6);
216 grad.label = HDR.Label;
217 grad.group_id = HDR.FLT.channels.grp_id;
220 %% compute HDR.ELEC.XYZ
221 cal = HDR.FLT.channels.Cal;
222 HDR.ELEC.XYZ = abs(cal)*(HDR.FLT.sensors.XYZabcArea(:,1:3));
224 HDR.Calib = sparse(2:HDR.NS+1,1:HDR.NS,HDR.Cal);
226 FLAG = HDR.FLAG; % backup
227 HDR.FLAG.UCAL = 1; % default: no calibration information
228 % read scaling information
229 ix = strfind([HDR.FILE.Name,'.'],'.');
230 fid = fopen(fullfile(HDR.FILE.Path,[HDR.FILE.Name,'.calib.txt']),'r');
232 fid = fopen(fullfile(HDR.FILE.Path,[HDR.FILE.Name(1:ix(1)-1),'.calib.txt']),'r');
235 c = fread(fid,[1,inf],'uint8=>
char'); fclose(fid);
237 %fid = fopen(fullfile(HDR.FILE.Path,[HDR.FILE.Name(1:ix-1),'.calib2.txt']),'r');
238 %c = fread(fid,[1,inf],'uint8'); fclose(fid);
240 %HDR.Calib = sparse(2:HDR.NS+1,1:HDR.NS,(n2(4:131,5).*n1(4:131,3)./n2(4:131,4))./100);
241 HDR.Calib = sparse(2:HDR.NS+1,1:HDR.NS,n1(4:131,3)*1e-13*(2^-12));
242 HDR.FLAG = FLAG; % restore
245 if ~isfield(HDR,'PhysDim') & ~isfield(HDR,'PhysDimCode')
246 HDR.PhysDimCode = zeros(HDR.NS,1);
251 if isfield(HDR.FLT,'datafile')
252 fn = fullfile(HDR.FILE.Path,HDR.FLT.datafile);
253 HDR.FILE.FID = fopen(fn,'rb',HDR.Endianity);
255 [p,f,e]=fileparts(HDR.FLT.datafile);
256 fn = fullfile(HDR.FILE.Path,f);
257 HDR.FILE.FID = fopen(fn,'rb',HDR.Endianity);
260 fn = fullfile(HDR.FILE.Path,HDR.FILE.Name);
261 HDR.FILE.FID = fopen(fn,'rb',HDR.Endianity);
266 fseek(HDR.FILE.FID,0,'eof');
267 HDR.FILE.size = ftell(HDR.FILE.FID);
268 fseek(HDR.FILE.FID,0,'bof');
270 fprintf(HDR.FILE.stderr,'Warning SOPEN(FLT): Binary data file %s not found!\n',fn);
275 [datatyp,limits,datatypes,numbits,GDFTYP]=
gdfdatatype(HDR.GDFTYP);
276 HDR.AS.bpb = HDR.NS*numbits/8;
277 HDR.AS.endpos = HDR.FILE.size/HDR.AS.bpb;
280 if (HDR.AS.bpb*HDR.NRec*HDR.SPR) ~= HDR.FILE.size,
281 % heuristic: try different data type
283 [datatyp,limits,datatypes,numbits,GDFTYP]=
gdfdatatype(HDR.GDFTYP);
284 HDR.AS.bpb = HDR.NS*numbits/8;
285 HDR.AS.endpos = HDR.FILE.size/HDR.AS.bpb;
287 if (HDR.AS.bpb*HDR.NRec*HDR.SPR) ~= HDR.FILE.size,
288 % heuristic: try different data type
290 [datatyp,limits,datatypes,numbits,GDFTYP]=
gdfdatatype(HDR.GDFTYP);
291 HDR.AS.bpb = HDR.NS*numbits/8;
292 HDR.AS.endpos = HDR.FILE.size/HDR.AS.bpb;
294 if (HDR.AS.bpb*HDR.NRec*HDR.SPR) ~= HDR.FILE.size,
295 fprintf(HDR.FILE.stderr,'Warning SOPEN(ET-MEG): size of file does not fit to header information\n');
296 fprintf(HDR.FILE.stderr,'\tFile:\t%s\n',fullfile(HDR.FILE.Path,HDR.FILE.Name));
297 fprintf(HDR.FILE.stderr,'\tFilesize:\t%i is not %i bytes\n',HDR.FILE.size,HDR.AS.bpb*HDR.NRec*HDR.SPR);
298 fprintf(HDR.FILE.stderr,'\tSamples:\t%i\n',HDR.NRec*HDR.SPR);
299 fprintf(HDR.FILE.stderr,'\tChannels:\t%i\n',HDR.NS);
300 fprintf(HDR.FILE.stderr,'\tDatatype:\t%s\n',datatyp);
301 HDR.SPR = floor(HDR.AS.endpos/HDR.NRec);
304 elseif any(HDR.FILE.PERMISSION=='w'),
305 fid = fopen(fullfile(HDR.FILE.Path,[HDR.FILE.Name,'.hdr']),'wt');
306 if 0, isfield(HDR,'H1')
308 fwrite(fid,HDR.H1,'uint8');
311 %%%%%%%% CHANNEL DATA %%%%%%%%%%%%%%%
312 if ~isfield(HDR,'AS')
313 HDR.AS.SampleRate = repmat(HDR.SampleRate,HDR.NS,1);
315 if ~isfield(HDR.AS,'SampleRate')
316 HDR.AS.SampleRate = repmat(HDR.SampleRate,HDR.NS,1);
318 if ~isfield(HDR,'THRESHOLD')
319 HDR.THRESHOLD = repmat(NaN,HDR.NS,2);
321 if ~isfield(HDR.Filter,'Notch')
322 HDR.Filter.Notch = repmat(NaN,HDR.NS,1);
324 if ~isfield(HDR,'PhysDimCode')
327 if ~isfield(HDR,'LeadIdCode')
330 if ~isfield(HDR,'REC')
331 HDR.REC.Impedance = repmat(NaN,HDR.NS,1);
333 if ~isfield(HDR.REC,'Impedance')
334 HDR.REC.Impedance = repmat(NaN,HDR.NS,1);
336 if ~isfield(HDR,'Off')
337 HDR.Off = zeros(HDR.NS,1);
339 if ~isfield(HDR,'Cal')
340 HDR.Cal = ones(HDR.NS,1);
341 HDR.Cal(HDR.InChanSelect) = diag(HDR.Calib(2:end,:));
343 if length(HDR.Filter.HighPass)==1,
344 HDR.Filter.HighPass = repmat(HDR.Filter.HighPass,HDR.NS,1);
346 if length(HDR.Cal)==1,
347 HDR.Cal = repmat(HDR.Cal,HDR.NS,1);
349 if length(HDR.Filter.LowPass)==1,
350 HDR.Filter.LowPass = repmat(HDR.Filter.LowPass,HDR.NS,1);
352 if length(HDR.Filter.Notch)==1,
353 HDR.Filter.Notch = repmat(HDR.Filter.Notch,HDR.NS,1);
357 if ~isfield(HDR,'FLT'); HDR.FLT = []; end;
359 %%%%%%%%% FIXED HEADER %%%%%%%%%%%%%%
360 fprintf(fid,'[Header]\n');
361 fprintf(fid,'version=2.1\nid=1\n');
362 fprintf(fid,'name=created by BioSig for Octave and Matlab http:
363 fprintf(fid,'comment= -\n');
364 fprintf(fid,'name_of_data_file=%s\n',HDR.FILE.Name);
366 fprintf(fid,'\n[Dataformat]\n');
367 fprintf(fid,'* data types : HP-UX data\n');
368 fprintf(fid,'* 1=(1
byte int) 2=(2
byte int) 3=(4
byte int)\n');
369 fprintf(fid,'* 4=(4
byte float) 5=(8
byte float) 6=(ASCII)\n');
370 fprintf(fid,'* LINUX data\n');
371 fprintf(fid,'* 11=(1
byte int) 12=(2
byte int) 13=(4
byte int)\n');
372 fprintf(fid,'* 14=(4
byte float) 15=(8
byte float) 16=(ASCII)\n');
373 fprintf(fid,'version=1.0\nid=1\nname=ET-MEG
double data format\n');
374 fprintf(fid,'type=14\n'); HDR.GDFTYP=16; % float32
375 if isfield(HDR,'data')
376 [HDR.SPR,HDR.NS]=size(HDR.data);
379 fprintf(fid,'number_of_samples=%i\n',HDR.NRec*HDR.SPR);
381 fprintf(fid,'\n[Measurement]\nversion=0.0\nlaboratory_name=%s\n',HDR.FLT.Measurement.laboratory_name);
382 fprintf(fid,'*\nmeasurement_day=%02i.%02i.%04i\n',HDR.T0([3,2,1]));
383 fprintf(fid,'measurement_time=%02i:%02i:%02i\n',HDR.T0(4:6));
384 fprintf(fid,'sampling_unit=s\n');
385 e = floor(log10(1/HDR.SampleRate));
386 fprintf(fid,'sampling_exponent=%i\n',e);
387 fprintf(fid,'sampling_step=%f\n',10^-e/HDR.SampleRate);
389 if isfield(HDR,'Patient')
390 fprintf(fid,'\n[Patient]\nid= 1\nversion= 1.00\n');
391 fprintf(fid,'name= -\n'); %%% will not be supported due to privacy reasons
392 if HDR.Patient.Sex==1,
393 fprintf(fid,'sex= male\n');
394 elseif HDR.Patient.Sex==2,
395 fprintf(fid,'sex= female\n');
397 fprintf(fid,'sex= -\n');
399 if isfield(HDR.Patient,'Birthday')
400 fprintf(fid,'birthday=%02i.%02i.%04i\n',HDR.T0([3,2,1]));
402 fprintf(fid,'birthday= -\n');
406 fprintf(fid,'\n[System]\nversion=0.0\n');
407 fprintf(fid,'number_of_channels=%i\n',HDR.NS);
408 %fprintf(fid,'SamplingRate=%i\n',HDR.SampleRate);
411 fprintf(fid,'*---------------------------------------------------------------\n');
412 fprintf(fid,'*seq
id u name calib grd grd_name grp n_sensors\n');
413 fprintf(fid,'*---------------------------------------------------------------\n');
414 fprintf(fid,'parameter_of_channels={\n
');
415 if isfield(HDR.FLT,'channels
')
416 % write original channel header
417 num = [HDR.FLT.channels.seq,HDR.FLT.channels.id,HDR.FLT.channels.usage,HDR.FLT.channels.cal,HDR.FLT.channels.grd_mode,HDR.FLT.channels.grp_id];
419 ix = find(HDR.FLT.channels.Cal(k,:));
420 fprintf(fid,'%04i %04i %i %-17s %5.3f %i %-8s %04i %i\n
',num(k,1:3),HDR.Label{k},num(k,4:5),HDR.FLT.channels.grd_mode_name{k},num(k,6),length(ix));
421 for k1 = 1:length(ix)
422 fprintf(fid,'\t%04i %9.6f * %s\n
',ix(k1)-1,full(HDR.FLT.channels.Cal(k,ix(k1))),HDR.FLT.sensors.name{ix(k1)});
427 fprintf(fid,'%04i %04i 1 %-16s 1.000 1 #### 0000 1\n
',k-1,k-1,HDR.Label{k});
428 fprintf(fid,' %04i 1.000000 * CH%i\n
',k-1,k-1);
432 if isfield(HDR.FLT,'sensors
');
433 fprintf(fid,'}\n\nnumber_of_sensors=%i\n
',HDR.FLT.System.number_of_sensors);
435 fprintf(fid,'}\n\nnumber_of_sensors=%i\n
',HDR.NS);
437 fprintf(fid,'*----------------------------------------------------------------------------------------\n
');
438 fprintf(fid,'*
id name type mod x y z a b c area\n
');
439 fprintf(fid,'*----------------------------------------------------------------------------------------\n
');
440 fprintf(fid,'parameter_of_sensors={\n
');
441 if isfield(HDR.FLT,'sensors
');
442 for k=1:size(HDR.FLT.sensors.id,1),
443 fprintf(fid,'%04i %-10s %i %04i %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f\n
',HDR.FLT.sensors.id(k),HDR.FLT.sensors.name{k},HDR.FLT.sensors.type(k),HDR.FLT.sensors.mod(k),HDR.FLT.sensors.XYZabcArea(k,:));
447 fprintf(fid,'%04i CH%-08i 1 0000 %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %11.9f\n
',k-1,k-1,HDR.ELEC.XYZ(k,1:3),[NaN,NaN,NaN,NaN]);
451 fprintf(fid,'}\n\nnumber_of_groups=%i\n
',HDR.FLT.System.number_of_groups);
452 fprintf(fid,'*----------------------------------------\n
');
453 fprintf(fid,'*
id u name unit exp calib\n
');
454 fprintf(fid,'*----------------------------------------\n
');
455 fprintf(fid,'parameter_of_groups={\n
');
456 if isfield(HDR.FLT,'groups
')
457 for k=1:size(HDR.FLT.groups.id,1),
458 fprintf(fid,'%04i %i %-16s %-6s %i %8.3f\n
',HDR.FLT.groups.id(k),HDR.FLT.groups.usage(k),HDR.FLT.groups.name{k},HDR.FLT.groups.unit{k},HDR.FLT.groups.unit_exp(k),HDR.FLT.groups.calib(k));
461 fprintf(fid,'0001 1 ET-Mag_80WH T 0 1.000\n
');
462 fprintf(fid,'0002 1 ET-AxGrd_80WH T 0 1.000\n
');
463 fprintf(fid,'0003 1 ET-PlGrd_80WH T 0 1.000\n
');
464 fprintf(fid,'0004 1 ET-Mag_RefCh T 0 1.000\n
');
465 fprintf(fid,'0005 1 ET-AxGrd_RefCh T 0 1.000\n
');
466 fprintf(fid,'0006 1 ET-PlGrd_RefCh T 0 1.000\n
');
467 fprintf(fid,'0007 1 Trigger V 0 1.000\n
');
468 fprintf(fid,'0008 1 EEG V 0 1.000\n
');
469 fprintf(fid,'0009 1 ECG V 0 1.000\n
');
470 fprintf(fid,'0010 1 Etc V 0 1.000\n
');
471 fprintf(fid,'0011 0 Null_Channel V 0 1.000\n
');
474 fprintf(fid,'\nnumber_of_modules=%i\n
',HDR.FLT.System.number_of_modules);
475 fprintf(fid,'*-------------------------------------------------------------------------\n
');
476 fprintf(fid,'*
id name x y z a b c unit exp name\n
');
477 fprintf(fid,'*-------------------------------------------------------------------------\n
');
478 fprintf(fid,'parameter_of_modules={\n
');
479 if isfield(HDR.FLT,'modules
')
480 for k=1:size(HDR.FLT.modules.id,1),
481 fprintf(fid,'%04i %-13s %5.3f %5.3f %5.3f %5.3f %5.3f %5.3f %5.3f %i %s\n
',HDR.FLT.modules.id(k),HDR.FLT.modules.name{k},HDR.FLT.modules.XYZabc(k,:),HDR.FLT.modules.unit(k),HDR.FLT.modules.exp(k),HDR.FLT.modules.unitname{k});
485 fprintf(fid,'0000 Magnetic 0.000 0.000 0.000 0.000 0.000 0.000 1.000 0 m\n
');
486 fprintf(fid,'0007 Electric 0.000 0.000 0.000 0.000 0.000 0.000 1.000 0 m\n}\n
');
491 HDR.FILE.FID = fopen(fullfile(HDR.FILE.Path,HDR.FILE.Name),'wb
','ieee-le
');
496 elseif any(HDR.FILE.PERMISSION=='a
'),
497 HDR.FILE.FID = fopen(fullfile(HDR.FILE.Path,HDR.FILE.Name),'ab
','ieee-le
');