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

vb_plot_brain_mask

PURPOSE ^

Plot brain and cortex mask image on MRI slices

SYNOPSIS ^

function vb_plot_brain_mask(avw,analyzefile)

DESCRIPTION ^

 Plot brain and cortex mask image on MRI slices
  vb_plot_brain_mask(avw,analyzefile)
 --- Input
 analyzefile
 avw.img  : 3D brain mask image (SPM-right)

 Label value
  1 = CSF
  2 = Gray
  3 = White
  4 = Cerebellum
  5 = Brainstem

 2007/6/15 Masa-aki 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_brain_mask(avw,analyzefile)
0002 % Plot brain and cortex mask image on MRI slices
0003 %  vb_plot_brain_mask(avw,analyzefile)
0004 % --- Input
0005 % analyzefile
0006 % avw.img  : 3D brain mask image (SPM-right)
0007 %
0008 % Label value
0009 %  1 = CSF
0010 %  2 = Gray
0011 %  3 = White
0012 %  4 = Cerebellum
0013 %  5 = Brainstem
0014 %
0015 % 2007/6/15 Masa-aki Sato
0016 %
0017 % Copyright (C) 2011, ATR All Rights Reserved.
0018 % License : New BSD License(see VBMEG_LICENSE.txt)
0019 
0020 
0021 % subplot の 数
0022 Nfig  = [3, 3];
0023 % スライス画像表示の Z-座標リスト
0024 zindx = fix([80:15:200]);
0025 
0026 % Subject 3D image
0027 [B, Vdim, Vsize] = vb_load_analyze_to_right(analyzefile);
0028 
0029 zindx = fix(zindx/Vsize(3));
0030 
0031 %
0032 % --- Plot brain on slices
0033 %
0034 
0035 % Brain index
0036 ix_brain  = find( avw.img(:) > 0 );
0037 
0038 % Transform brain 1D-index to 3D-voxel index
0039 [ix,iy,iz] = ind2sub(Vdim,ix_brain);
0040 
0041 vb_plot_slice( B, [ix,iy,iz], zindx, 1, Nfig);
0042 
0043 %
0044 % --- Plot cortex on slices
0045 %
0046 
0047 % Cortex index
0048 ix_cortex = find( avw.img(:)==2 | avw.img(:)==3);
0049 
0050 % Transform cortex 1D-index to 3D-voxel index
0051 [ix,iy,iz] = ind2sub(Vdim,ix_cortex);
0052 
0053 vb_plot_slice( B, [ix,iy,iz], zindx, 1, Nfig);
0054 
0055 
0056 return

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