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

vb_plot_compare_brain

PURPOSE ^

Plot two brain model on MRI slice for comparison

SYNOPSIS ^

function vb_plot_compare_brain(analyzefile, brainfile1, brainfile2)

DESCRIPTION ^

 Plot two brain model on MRI slice for comparison
  vb_plot_compare_brain(analyzefile, brainfile1, brainfile2)
 --- Input
 analyzefile
 brainfile1
 brainfile2

 2006/10/19 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    vb_plot_compare_brain(analyzefile, brainfile1, brainfile2)
0002 % Plot two brain model on MRI slice for comparison
0003 %  vb_plot_compare_brain(analyzefile, brainfile1, brainfile2)
0004 % --- Input
0005 % analyzefile
0006 % brainfile1
0007 % brainfile2
0008 %
0009 % 2006/10/19 M. Sato
0010 %
0011 % Copyright (C) 2011, ATR All Rights Reserved.
0012 % License : New BSD License(see VBMEG_LICENSE.txt)
0013 
0014 %
0015 %---- Load analyze left-handed image & flip to right-handed image
0016 %
0017 [B, Vdim, Vsize] = vb_load_analyze_to_right(analyzefile);
0018 
0019 %
0020 %---- Load vertex coordinate from brain file
0021 %
0022 
0023 [V1, F1] = vb_load_cortex(brainfile1);
0024 F1 = F1.F3;
0025 
0026 [V2, F2] = vb_load_cortex(brainfile2);
0027 F2 = F2.F3;
0028 
0029 % Transform vertex coordinate to analyze right-handed coordinate
0030 V1 = vb_spm_right_to_analyze_right(V1,Vdim,Vsize);
0031 V2 = vb_spm_right_to_analyze_right(V2,Vdim,Vsize);
0032 
0033 %
0034 %---- Cortex on the slice image
0035 %
0036 
0037 % スライス画像表示の Z-座標リスト
0038 vcut  = 'z';
0039 zindx = [130:10:200];
0040 
0041 Msize   = 1;        % marker size
0042 Mtype1  = 'y-';        % marker type
0043 Mtype2  = 'c-';        % marker type
0044 dz      = 5;        % search radius for intersection triangle
0045 xymode  = 1;
0046 
0047 % subplot の 数
0048 NX   = 2;
0049 NY   = 2;
0050 Nfig = length(zindx);
0051 nfig = NX*NY;
0052 
0053 for n= 1:Nfig
0054     if nfig==NX*NY, 
0055         figure; nfig=1;
0056     else
0057         nfig=nfig+1;
0058     end;
0059     
0060     subplot(NY,NX,nfig);
0061 
0062     vb_plot_3d_image(B, zindx(n), vcut, xymode);
0063     
0064     hold on
0065     vb_plot_cross_section(V1,F1,zindx(n),vcut,dz,Msize,Mtype1,xymode);
0066     vb_plot_cross_section(V2,F2,zindx(n),vcut,dz,Msize,Mtype2,xymode);
0067     title(['z-slice (' num2str(zindx(n),3) ')'])
0068     colormap(gray);
0069 end
0070 
0071 return

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