Home > vbmeg > functions > tool_box > dynamics_movie > test_fig > basic_tool > set_pair_ch.m

set_pair_ch

PURPOSE ^

SYNOPSIS ^

function parm = set_pair_ch(posfile)

DESCRIPTION ^

 Copyright (C) 2011, ATR All Rights Reserved.
 License : New BSD License(see VBMEG_LICENSE.txt)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function    parm = set_pair_ch(posfile)
0002 %
0003 % Copyright (C) 2011, ATR All Rights Reserved.
0004 % License : New BSD License(see VBMEG_LICENSE.txt)
0005 
0006 parm = define_pair_channel;
0007 
0008 p = load(posfile);
0009 
0010 % Source channel
0011 Nsource = length(parm.source);
0012 parm.src_pos = zeros(Nsource,3);
0013 
0014 for k=1:Nsource
0015     ix = strmatch(parm.source{k}, p.channel.name, 'exact');
0016     if isempty(ix)
0017         error('channel %s not found.\n', parm.source{k});
0018     end
0019     parm.src_pos(k,:) = p.channel.Xspm(ix, :);
0020 end
0021 
0022 % Detector channel
0023 Ndetector = length(parm.detector);
0024 parm.det_pos = zeros(Ndetector,3);
0025 
0026 for k=1:Ndetector
0027     ix = strmatch(parm.detector{k}, p.channel.name, 'exact');
0028     if isempty(ix)
0029         error('channel %s not found.\n', parm.detector{k});
0030     end
0031     parm.det_pos(k,:) = p.channel.Xspm(ix, :);
0032 end
0033 
0034 return
0035 
0036 if Npair~=size(det_pos,1)
0037     error('# of source and detector are different');
0038 end
0039

Generated on Mon 22-May-2023 06:53:56 by m2html © 2005