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

plot_pair_ch

PURPOSE ^

SYNOPSIS ^

function h = plot_pair_ch(parm, facefile, p)

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    h = plot_pair_ch(parm, facefile, p)
0002 %
0003 % Copyright (C) 2011, ATR All Rights Reserved.
0004 % License : New BSD License(see VBMEG_LICENSE.txt)
0005 
0006 % get_shortest_path from source to detector along head
0007 [Xpath, Npath] = get_shortest_path(parm, facefile);
0008 
0009 %
0010 % --- Plot surface
0011 %
0012 % Face surface
0013 face = load(facefile);
0014 V = face.Vspm;
0015 F = face.F;
0016 
0017 h = figure;
0018 vb_plot_surf(V,F);
0019 camlight headlight;
0020 view(p.angle);
0021 axis equal
0022 
0023 hold on;
0024 
0025 % source & detector channel pos
0026 Npair = length(Npath);
0027 
0028 src_pos = zeros(Npair,3);
0029 det_pos = zeros(Npair,3);
0030 ch_pos  = zeros(Npair,3);
0031 
0032 for k=1:Npair
0033     Vpath = Xpath{k};
0034     NP = Npath(k);
0035     
0036     src_pos(k,:) = Vpath(1,:);
0037     det_pos(k,:) = Vpath(end,:);
0038     % channel posisin: mid point
0039     N1 = max(fix(NP/2),1);
0040     ch_pos(k,:)  = Vpath(N1,:);
0041 end
0042 
0043 % Plot source & detector channel
0044 plot3(src_pos(:,1), src_pos(:,2), src_pos(:,3), p.Msend,'MarkerSize',p.Msize);
0045 plot3(det_pos(:,1), det_pos(:,2), det_pos(:,3), p.Mrecv,'MarkerSize',p.Msize);
0046 
0047 %
0048 % ----- Plot shortest path from source to detector
0049 %
0050 
0051 for k=1:Npair
0052     % get_shortest_path from source to detector along head
0053     Vpath = Xpath{k};
0054     NP = Npath(k);
0055     N1 = max(fix(NP/2),1);
0056     ix1 = 1:N1;
0057     ix2 = N1:NP;
0058     
0059     plot3(Vpath(ix1,1), Vpath(ix1,2), Vpath(ix1,3), p.Lsend); % source
0060     plot3(Vpath(ix2,1), Vpath(ix2,2), Vpath(ix2,3), p.Lrecv); % detector
0061 end
0062

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