Home > functions > plotfunc > 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     load(brainfile,'V','F')
0038     
0039     V = vb_spm_right_to_analyze_right( V, Vdim, Vsize);
0040     figure(h1);
0041     vb_plot_slice_surf([], V, F.F3, xindx, 'x', Nfigx, Mtype{6}, dmax, 0);
0042     figure(h2);
0043     vb_plot_slice_surf([], V, F.F3, zindx, 'z', Nfigz, Mtype{6}, dmax, 1);
0044 end
0045 
0046 %
0047 % --- Overwrite Head surface
0048 %
0049 
0050 %    headfiles{1} = ['csf.head.mat'];    % ǾÀÔ¿ñ±Õ
0051 %    headfiles{2} = ['skull.head.mat'];  % Ƭ³¸¹ü
0052 %    headfiles{3} = ['scalp.head.mat'];  % ƬÈé
0053 
0054 if ~iscell(headfile), headfile = {headfile}; end;
0055 
0056 dmax  = 10; % search distance from cut slice
0057 Nfile = length(headfile);
0058 
0059 for n=1:Nfile
0060     if isempty(headfile{n}), continue; end;
0061     load(headfile{n},'Vhead','Fhead')
0062     Vhead = vb_spm_right_to_analyze_right( Vhead, Vdim, Vsize);
0063     figure(h1);
0064     vb_plot_slice_surf( [], Vhead, Fhead, xindx, 'x', Nfigx, Mtype{n},dmax,0);
0065     figure(h2);
0066     vb_plot_slice_surf( [], Vhead, Fhead, zindx, 'z', Nfigz, Mtype{n},dmax,1);
0067 end

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