Home > vbmeg > functions > plotfunc > subdirectory > vb_plot_brain_flat.m

vb_plot_brain_flat

PURPOSE ^

---

SYNOPSIS ^

function vb_plot_brain_flat(plot_parm)

DESCRIPTION ^

 ---
 function vb_plot_brain_flat(plot_parm)

 This function supports high resolution patch created by
 FreeSurfer. Note that the vertex resolution can be different
 between the flat map (high resolution) and estimation model (low
 resolution). Thus, ix_J must be the indices on the flat map. 
 The translation table from the high-resolution model to the
 low-resolution model is included in cortical model file
 (.brain.mat) as variable 'BV_index'. See sample script
 'job_plot_brain_flat_sample.m'. 

 --- Necessary parameters
 plot_parm.V      : Vertices of the flat map
 plot_parm.F      : Faces of the flat map
 plot_parm.C      : Curvature (discritized for visualization)

 --- Optional parameters
 plot_parm.J       : Activity map
 plot_parm.ix_J    : Vertex index of flatmap for J
 plot_parm.cmap    : Color map (1:jet 2:hot, default 1)
 plot_parm.wmode   : 1:absolute, 2:real value (default 1)
 plot_parm.wmax    : Relative cutoff value (0-1, default 1)
 plot_parm.wmin    : Relative minimum threshold (0-1, default 0.1)
 plot_parm.paint   : 1:off 2:on (default 1)
 plot_parm.th_curv : Relative threshold of curvature (default 0.5)
 plot_parm.color   : Color of flatmap (default [0.7 0.7 0.7])
 plot_parm.ms      : Marker size (default 5.0)
 plot_parm.ix_area : Vertex indices of area (cell array)
 plot_parm.clr_area: Color of areas to be displayed (cell array)

 2006-03-24 Taku Yoshioka
 ---

 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 vb_plot_brain_flat(plot_parm)
0002 % ---
0003 % function vb_plot_brain_flat(plot_parm)
0004 %
0005 % This function supports high resolution patch created by
0006 % FreeSurfer. Note that the vertex resolution can be different
0007 % between the flat map (high resolution) and estimation model (low
0008 % resolution). Thus, ix_J must be the indices on the flat map.
0009 % The translation table from the high-resolution model to the
0010 % low-resolution model is included in cortical model file
0011 % (.brain.mat) as variable 'BV_index'. See sample script
0012 % 'job_plot_brain_flat_sample.m'.
0013 %
0014 % --- Necessary parameters
0015 % plot_parm.V      : Vertices of the flat map
0016 % plot_parm.F      : Faces of the flat map
0017 % plot_parm.C      : Curvature (discritized for visualization)
0018 %
0019 % --- Optional parameters
0020 % plot_parm.J       : Activity map
0021 % plot_parm.ix_J    : Vertex index of flatmap for J
0022 % plot_parm.cmap    : Color map (1:jet 2:hot, default 1)
0023 % plot_parm.wmode   : 1:absolute, 2:real value (default 1)
0024 % plot_parm.wmax    : Relative cutoff value (0-1, default 1)
0025 % plot_parm.wmin    : Relative minimum threshold (0-1, default 0.1)
0026 % plot_parm.paint   : 1:off 2:on (default 1)
0027 % plot_parm.th_curv : Relative threshold of curvature (default 0.5)
0028 % plot_parm.color   : Color of flatmap (default [0.7 0.7 0.7])
0029 % plot_parm.ms      : Marker size (default 5.0)
0030 % plot_parm.ix_area : Vertex indices of area (cell array)
0031 % plot_parm.clr_area: Color of areas to be displayed (cell array)
0032 %
0033 % 2006-03-24 Taku Yoshioka
0034 % ---
0035 %
0036 % Copyright (C) 2011, ATR All Rights Reserved.
0037 % License : New BSD License(see VBMEG_LICENSE.txt)
0038 
0039 % Setup optional parameters
0040 if ~isfield(plot_parm,'J'), plot_parm.J = []; end; 
0041 if ~isfield(plot_parm,'cmap'), plot_parm.cmap = 'jet'; end;
0042 if ~isfield(plot_parm,'wmode'), plot_parm.wmode = 1; end; 
0043 if ~isfield(plot_parm,'wmax'), plot_parm.wmax = 1.0; end; 
0044 if ~isfield(plot_parm,'wmin'), plot_parm.wmin = 0.1; end; 
0045 if ~isfield(plot_parm,'paint'), plot_parm.paint = 2; end; 
0046 if ~isfield(plot_parm,'th_curv'), plot_parm.th_curv = 0.5; end; 
0047 if ~isfield(plot_parm,'color'), plot_parm.color = [0.7 0.7 0.7]; end; 
0048 if ~isfield(plot_parm,'ms'), plot_parm.ms = 5.0; end;
0049 if ~isfield(plot_parm,'ix_area'), plot_parm.ix_area = []; end; 
0050 
0051 % Patch color
0052 ix = find(plot_parm.C>plot_parm.th_curv); 
0053 C = ones(length(plot_parm.C),1);
0054 C(ix) = 0.4; 
0055 fclr = [C C C].*repmat(plot_parm.color,[size(C,1) 1]);
0056 
0057 % Plot flat map
0058 patch('Faces',plot_parm.F,'Vertices',plot_parm.V,...
0059       'FaceVertexCData',fclr,'FaceColor','interp',...
0060       'EdgeColor','none');
0061 
0062 % Plot activity map
0063 if ~isempty(plot_parm.J), 
0064   hold on; 
0065   colormap(plot_parm.cmap);
0066   ix = find(plot_parm.J>abs(max(plot_parm.J))*plot_parm.wmin);
0067   plot_parm.ix_J = plot_parm.ix_J(ix);
0068   plot_parm.J = plot_parm.J(ix);
0069   
0070   if isfield(plot_parm,'mtype'), 
0071     h = scatter3(plot_parm.V(plot_parm.ix_J,1),...
0072          plot_parm.V(plot_parm.ix_J,2),...
0073          plot_parm.V(plot_parm.ix_J,3),...
0074          plot_parm.ms,plot_parm.J,'filled');
0075     set(h,'MarkerSize',plot_parm.ms);
0076   else
0077     h = scatter3(plot_parm.V(plot_parm.ix_J,1),...
0078          plot_parm.V(plot_parm.ix_J,2),...
0079          plot_parm.V(plot_parm.ix_J,3),...
0080          plot_parm.ms,plot_parm.J,'filled');
0081   end
0082 end
0083 
0084 % Plot areas
0085 if ~isempty(plot_parm.ix_area),
0086   hold on; 
0087   for i=1:length(plot_parm.ix_area)
0088     h = plot3(plot_parm.V(plot_parm.ix_area{i},1),...
0089           plot_parm.V(plot_parm.ix_area{i},2),...
0090           plot_parm.V(plot_parm.ix_area{i},3),...
0091           '.','MarkerSize',plot_parm.ms);
0092     set(h,'MarkerFaceColor',plot_parm.clr_area{i});
0093     set(h,'MarkerEdgeColor',plot_parm.clr_area{i});
0094     if isfield(plot_parm,'mtype'), 
0095       set(h,'Marker',plot_parm.mtype); 
0096     end
0097   end
0098 end

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