Home > functions > tool_box > atlas2vb_dir > vb_plot_non_atlas_area.m

vb_plot_non_atlas_area

PURPOSE ^

Plot non-atlas area in brain

SYNOPSIS ^

function [Nvert,Npart,name] = vb_plot_non_atlas_area(brainfile,atlasfile)

DESCRIPTION ^

 Plot non-atlas area in brain 
  vb_plot_non_atlas_area(brainfile,atlasfile)
 --- Input
 brainfile
 atlasfile

 2006-11-12 M. Sato

 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    [Nvert,Npart,name] = vb_plot_non_atlas_area(brainfile,atlasfile)
0002 % Plot non-atlas area in brain
0003 %  vb_plot_non_atlas_area(brainfile,atlasfile)
0004 % --- Input
0005 % brainfile
0006 % atlasfile
0007 %
0008 % 2006-11-12 M. Sato
0009 %
0010 % Copyright (C) 2011, ATR All Rights Reserved.
0011 % License : New BSD License(see VBMEG_LICENSE.txt)
0012 
0013 [V, F, xx, inf_C] = vb_load_cortex(brainfile,'Inflate');
0014 
0015 NL = F.NdipoleL;
0016 FL = F.F3L;
0017 FR = F.F3R;
0018 F  = F.F3;
0019 NV = size(V,1);
0020 
0021 load(atlasfile,'Act')
0022 
0023 ixlist = find( Act{1}.xxP == 0 );
0024 
0025 NLz = sum(ixlist <= NL);
0026 NRz = sum(ixlist > NL);
0027 
0028 fprintf('N_left = %d, N_right = %d\n',NLz,NRz)
0029 
0030 % Color of Inflate model
0031 colors = vb_get_inflate_color(inf_C);
0032 
0033 angl = [ 10 45 ; -10 45; 90 10; -90 10; 35  20; -35  20];
0034 nL = 3;
0035 nR = 4;
0036 
0037 Lmax = max(V(1:NL,:));
0038 Lmin = min(V(1:NL,:));
0039 Rmax = max(V((NL+1):NV,:));
0040 Rmin = min(V((NL+1):NV,:));
0041 
0042 subplot(1,2,1)
0043 patch('Faces',FL,'Vertices',V,'FaceColor','interp',...
0044     'EdgeColor','none','FaceVertexCData',colors);
0045 hold on;
0046 
0047 Fx = vb_patch_select2(ixlist,FL,NV);
0048 vb_plot_surf(V,Fx,'r');
0049 
0050 xlim([Lmin(1) Lmax(1)]);
0051 ylim([Lmin(2) Lmax(2)]);
0052 zlim([Lmin(3) Lmax(3)]);
0053 
0054 view(angl(nL,:));
0055 
0056 subplot(1,2,2)
0057 patch('Faces',FR,'Vertices',V,'FaceColor','interp',...
0058     'EdgeColor','none','FaceVertexCData',colors);
0059 hold on;
0060 
0061 Fx = vb_patch_select2(ixlist,FR,NV);
0062 vb_plot_surf(V,Fx,'r');
0063 
0064 xlim([Rmin(1) Rmax(1)]);
0065 ylim([Rmin(2) Rmax(2)]);
0066 zlim([Rmin(3) Rmax(3)]);
0067 
0068 view(angl(nR,:));
0069 
0070 % connected region number
0071 [Nvert,Npart,name] = vb_find_atlas_label_number(atlasfile,brainfile);
0072 
0073 Narea = length(Act{1}.label);
0074 Nmax = max(Npart);
0075 Mvert = zeros(Narea+1,Nmax);
0076 
0077 for n=1:Narea+1
0078     if Npart(n) > 0
0079         Mvert(n,1:Npart(n)) = Nvert{n};
0080     end
0081 end
0082 
0083 iz = find(Npart==0);
0084 miss = {name{iz}};
0085 
0086 figure;
0087 subplot 211
0088 plot(Npart)
0089 
0090 subplot 212
0091 plot(Mvert)
0092 
0093 return

Generated on Tue 27-Aug-2013 11:46:04 by m2html © 2005