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

vb_plot_slice_head

PURPOSE ^

Plot head shape and cortex surface on MRI slice

SYNOPSIS ^

function vb_plot_slice_head(headfile,analyzefile,brainfile)

DESCRIPTION ^

 Plot head shape and cortex surface on MRI slice
  vb_plot_slice_head(headfile,analyzefile,brainfile)
 --- Input
 headfile{n} : cell array of head file(*.head.mat)
 analyzefile : analyze file(*.hdr)
   brainfile : brain file(*.brain.mat)

 2006/10/20 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_slice_head(headfile,analyzefile,brainfile)
0002 % Plot head shape and cortex surface on MRI slice
0003 %  vb_plot_slice_head(headfile,analyzefile,brainfile)
0004 % --- Input
0005 % headfile{n} : cell array of head file(*.head.mat)
0006 % analyzefile : analyze file(*.hdr)
0007 %   brainfile : brain file(*.brain.mat)
0008 %
0009 % 2006/10/20 M. Sato
0010 %
0011 % Copyright (C) 2011, ATR All Rights Reserved.
0012 % License : New BSD License(see VBMEG_LICENSE.txt)
0013 
0014 Mtype = { 'y-' , 'r-' , 'c-' , 'g-' , 'w-', 'm.'};
0015 dmax  = 5;
0016 
0017 % Load 3D MRI image to analyze_right_hand coordinate
0018 [B, Vdim, Vsize] = vb_load_analyze_to_right(analyzefile);
0019 
0020 % # of subplot
0021 Nfigx = [2, 2] ;
0022 Nfigz = [2, 2] ;
0023 % slice number to cut
0024 xindx = fix(Vdim(1)* [0.2:0.2:0.8]);
0025 zindx = fix(Vdim(3)* [0.4:0.1:0.7]);
0026 %xindx = [50 80 120 150 ];
0027 %zindx = [120 150 170 200];
0028 
0029 % plot analyze data
0030 h1 = vb_plot_slice_surf( B, [], [], xindx, 'x', Nfigx, Mtype{6}, dmax, 0);
0031 h2 = vb_plot_slice_surf( B, [], [], zindx, 'z', Nfigz, Mtype{6}, dmax, 1);
0032 
0033 %
0034 % --- Plot cortex surface
0035 %
0036 if exist('brainfile','var') & ~isempty(brainfile)
0037     dz = 5;
0038     Msize  = 2;
0039     V = vb_load_cortex(brainfile, 'subj');
0040    
0041     V = vb_spm_right_to_analyze_right( V, Vdim, Vsize);
0042     figure(h1);
0043     %vb_plot_slice_surf([], V, F.F3, xindx, 'x', Nfigx, Mtype{6}, dmax, 0);
0044     for k=1:length(xindx)
0045         subplot(Nfigx(1), Nfigx(2), k);
0046         vb_plot_vertex(V, 'x', xindx(k), dz, Msize, Mtype{6}, 0);
0047     end
0048     figure(h2);
0049     for k=1:length(zindx)
0050         subplot(Nfigz(1), Nfigz(2), k);
0051         vb_plot_vertex(V, 'z', zindx(k), dz, Msize, Mtype{6}, 1);
0052     end
0053 %    vb_plot_slice_surf([], V, F.F3, zindx, 'z', Nfigz, Mtype{6}, dmax, 1);
0054 end
0055 
0056 %
0057 % --- Overwrite Head surface
0058 %
0059 
0060 %    headfiles{1} = ['csf.head.mat'];    % ǾÀÔ¿ñ±Õ
0061 %    headfiles{2} = ['skull.head.mat'];  % Ƭ³¸
0062 %    headfiles{3} = ['scalp.head.mat'];  % Ƭ
0063 
0064 if ~iscell(headfile), headfile = {headfile}; end;
0065 
0066 dmax  = 10; % search distance from cut slice
0067 Nfile = length(headfile);
0068 
0069 for n=1:Nfile
0070     if isempty(headfile{n}), continue; end;
0071     load(headfile{n},'Vhead','Fhead')
0072     Vhead = vb_spm_right_to_analyze_right( Vhead, Vdim, Vsize);
0073     figure(h1);
0074     vb_plot_slice_surf( [], Vhead, Fhead, xindx, 'x', Nfigx, Mtype{n},dmax,0);
0075     figure(h2);
0076     vb_plot_slice_surf( [], Vhead, Fhead, zindx, 'z', Nfigz, Mtype{n},dmax,1);
0077 end

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