0001 function job_edit_act_plotbrain(plot_parm,V,F,inf_C,J,Jmin,Jmax)
0002
0003
0004
0005
0006
0007
0008
0009 if isfield(plot_parm,'color') & ~isempty(plot_parm.color)
0010 fclr = plot_parm.color;
0011 else
0012 fclr = [0.8 0.8 0.8];
0013 end
0014
0015
0016 switch plot_parm.LRflag
0017 case 'L'
0018 F0 = F.F3L;
0019 case 'R'
0020 F0 = F.F3R;
0021 case 'LR'
0022 F0 = F.F3;
0023 end
0024
0025
0026 index = plot_parm.index;
0027 if length(index) == 0, FF = F0;
0028 else FF = vb_patch_select2(index,F0,size(V,1)); end;
0029
0030 if isempty(inf_C)
0031
0032 patch('Faces',FF,'Vertices',V,'FaceColor',fclr,...
0033 'FaceLighting','phong','EdgeColor','none');
0034
0035
0036 camlight headlight
0037 else
0038 c = repmat(fclr,[length(inf_C) 1]) ...
0039 -0.4*[fclr(1)*inf_C fclr(2)*inf_C fclr(3)*inf_C];
0040 patch('Faces',FF,'Vertices',V,'FaceColor','interp',...
0041 'EdgeColor','none','FaceVertexCData',c);
0042 end
0043
0044 material dull;
0045 hold on;
0046
0047
0048 if plot_parm.isact,
0049 plot_value(plot_parm,V,F0,J,index,Jmin,Jmax);
0050 end
0051
0052 function plot_value(plot_parm,V,F0,J,index,wmin,wmax);
0053
0054
0055
0056
0057 if length(J) == 0
0058 return;
0059 end
0060
0061
0062 if length(index) == 0
0063 tmp = ones(length(J),1);
0064 else
0065 tmp = zeros(length(J),1);
0066 tmp(index) = 1;
0067 end
0068
0069
0070 tmp2 = zeros(length(J),1);
0071 tmp2(unique(F0(:))) = 1;
0072
0073 tmp = J.*tmp.*tmp2;
0074 ix = find(abs(tmp) >= wmin);
0075 if plot_parm.wmode==1
0076 J = abs(J);
0077 end
0078
0079
0080 if plot_parm.paint==1
0081 h = scatter3(V(ix,1),V(ix,2),V(ix,3),1,J(ix),'.','filled');
0082 set(h,'MarkerSize',plot_parm.ms);
0083 else
0084 FF = vb_patch_select2(ix,F0,size(V,1));
0085 patch('Faces',FF,'Vertices',V,'FaceColor','interp',...
0086 'FaceVertexCData',J,'EdgeColor','none',...
0087 'FaceLighting','none');
0088 material dull;
0089 end
0090
0091 if plot_parm.wmode==1
0092 caxis([0 wmax]);
0093 else
0094 caxis([-wmax wmax]);
0095 end
0096
0097 if plot_parm.cmap==1
0098 colormap(hot);
0099 else
0100 colormap(jet);
0101 end
0102