0001 function vb_check_brain_model(proj_root,brain_parm)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 analyzefile = brain_parm.analyze_file;
0014 brainfile = [proj_root '/' brain_parm.brain_file];
0015
0016
0017
0018
0019
0020
0021
0022 [V, F] = vb_load_cortex(brainfile);
0023 V = V .* 1000;
0024
0025
0026 angle = [45 30; -45 30; -60 30; 60 30];
0027
0028 Nfig = 4;
0029 NY = 2;
0030 NX = 2;
0031 fclr = [0.8 0.7 0.6];
0032 eclr = 'none';
0033
0034 light_mode = 1;
0035 max_mode = 1;
0036
0037 figure;
0038 subplot(NY,NX,1)
0039 vb_plot_surf(V, F.F3L, fclr,eclr,light_mode,max_mode)
0040 view(angle(1,:));
0041 title('Left brain')
0042 xlabel('[mm]'); ylabel('[mm]'); zlabel('[mm]');
0043
0044 subplot(NY,NX,2)
0045 vb_plot_surf(V, F.F3R, fclr,eclr,light_mode,max_mode)
0046 view(angle(2,:));
0047 title('Right brain')
0048 xlabel('[mm]'); ylabel('[mm]'); zlabel('[mm]');
0049
0050 subplot(NY,NX,3)
0051 vb_plot_surf(V, F.F3, fclr,eclr,light_mode,max_mode)
0052 view(angle(3,:));
0053 title('Both brain [Left angle]')
0054 xlabel('[mm]'); ylabel('[mm]'); zlabel('[mm]');
0055
0056 subplot(NY,NX,4)
0057 vb_plot_surf(V, F.F3, fclr,eclr,light_mode,max_mode)
0058 view(angle(4,:));
0059 title('Both brain [Right angle]')
0060 xlabel('[mm]'); ylabel('[mm]'); zlabel('[mm]');
0061
0062 V = V ./ 1000;
0063
0064
0065
0066
0067
0068
0069
0070
0071 if ~exist(analyzefile,'file'),
0072 fprintf('There is no analyze file: %s\n',analyzefile)
0073 fprintf('Check of MRI and brain model is skipped\n')
0074 return
0075 end
0076
0077 [B, Vdim, Vsize] = vb_load_analyze_to_right(analyzefile);
0078
0079
0080 Vana = vb_spm_right_to_analyze_right(V,Vdim,Vsize);
0081
0082 Msize = 1;
0083 Mtype = 'y-';
0084 dz = 5;
0085 vcut = ['x','y','z','z'];
0086
0087 indx = fix([Vdim(1)*0.45 Vdim(2)/2 Vdim(3)*0.5 Vdim(3)*0.7]);
0088 xymode = 0;
0089
0090 label = {'Sagittal cut'; 'Coronal cut'; 'Axial cut'; 'Axial cut'};
0091
0092 Nfig = length(vcut);
0093 NX = 2;
0094 NY = 2;
0095
0096 figure;
0097
0098 for n= 1:Nfig
0099 subplot(NY,NX,n)
0100 vdim = vcut(n);
0101 [strX,strY] = vb_plot_3d_image(B, indx(n), vcut(n), xymode);
0102 xlabel(strX);
0103 ylabel(strY);
0104
0105 hold on
0106 vb_plot_cross_section(Vana,F.F3,indx(n),vcut(n),dz,Msize,Mtype,xymode);
0107
0108 title(label{n})
0109 end
0110
0111
0112 vcut = 'z';
0113 zindx = fix(Vdim(3)* [0.3:0.1:0.8]);
0114
0115
0116
0117 NX = 3;
0118 NY = 2;
0119 Nfig = length(zindx);
0120
0121 figure;
0122
0123 for n= 1:Nfig
0124 subplot(NY,NX,n)
0125 vb_plot_3d_image(B, zindx(n), vcut, xymode);
0126
0127 hold on
0128 vb_plot_cross_section(Vana,F.F3,zindx(n),vcut,dz,Msize,Mtype,xymode);
0129
0130 title(['z-slice (' num2str(zindx(n),3) ')'])
0131 colormap(gray);
0132 end
0133
0134 return