1 function HDR =
mat2sel(FileName,fnout);
2 % MAT2SEL is useful
for converting visual artifact selection
3 % with gBSanalyze into BKR/EPS compliant *.SEL files.
5 % HDR =
mat2sel(infile, [selfile]);
6 % infile input filename (*.BKR or *.MAT are supported)
7 % selfile output file with info artifact selection [OPTIONAL]
8 %
if no selfile is provided, the information will be
9 % stored with extension
'.SEL' and the same filename and
12 % The artifact selection is available in HDR.ArtifactSelection and
13 % can be also loaded with
14 % [s,HDR]=
sload(filename);
15 % Currently, artifact selection of EPS/BKR-Software and
16 % gBSanalyze is supported.
21 % $Id:
mat2sel.m 2205 2009-10-27 12:18:15Z schloegl $
22 % Copyright (C) 2004 by Alois Schloegl
25 % This library is free software; you can redistribute it and/or
26 % modify it under the terms of the GNU Library General Public
27 % License as published by the Free Software Foundation; either
28 % Version 2 of the License, or (at your option) any later version.
30 % This library is distributed in the hope that it will be useful,
31 % but WITHOUT ANY WARRANTY; without even the implied warranty of
32 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
33 % Library General Public License
for more details.
35 % You should have received a copy of the GNU Library General Public
36 % License along with
this library;
if not, write to the
37 % Free Software Foundation, Inc., 59 Temple Place - Suite 330,
38 % Boston, MA 02111-1307, USA.
40 [s,HDR] =
sload(FileName);
42 if isfield(HDR,
'ArtifactSelection'),
43 artifact = HDR.ArtifactSelection;
45 save([HDR.FILE.Name,
'_artifact'],
'artifact');
48 fnout = [HDR.FILE.Name,
'.sel']
49 fnout = fullfile(HDR.FILE.Path,[HDR.FILE.Name,
'.sel']);
51 if 0, exist(fnout)==2,
52 fprintf(1,
'File %s exists! Do you want to overwrite ',fnout);
53 answer = input(
'[Y/N] ?');
57 if any(answer==
'jJyYzZ'),
58 fid = fopen(fnout,
'w');
59 fprintf(fid,
'%i\r\n', artifact);