Make 1 & 3 shell surface for MEG/EEG model using face_file and SPM Segment file --- Usage vb_job_head_1shell(proj_root, parm) vb_job_head_3shell(proj_root, parm) --- Input file (Absolute path) parm.brain_file : Brain model file (.brain.mat) parm.analyze_file : MRI image file parm.gray_file : Gray matter segment file made by SPM 'Segment' parm.face_file : face surface file --- Output file (relative path from 'proj_root') parm.head_file : Base name for CSF surface file --- Optional Parameter parm.Nvertex : number of vertex in one surface - Radius of Morphology operation [mm] parm.Radius_csf : smoothing radius for CSF surface (Segment file case) = [6 6 -4 -4 ] Default %% --- Advanced Optional Parameter parm.Nloop = 200; % Iteration number for fit boundary parm.Nlast = 10 ; % Iteration number for smoothing by spring model (Segment file case) parm.Glevel = [0.8]; level of gray matter selection threshold parm.Radius_fill = [4]; Cortex fill radius parm.Radius_gray = [-2 2]; Radius to remove noise in gray matter image Masa-aki Sato 2009-10-7 Copyright (C) 2011, ATR All Rights Reserved. License : New BSD License(see VBMEG_LICENSE.txt)
0001 % Make 1 & 3 shell surface for MEG/EEG model 0002 % using face_file and SPM Segment file 0003 % --- Usage 0004 % vb_job_head_1shell(proj_root, parm) 0005 % vb_job_head_3shell(proj_root, parm) 0006 % 0007 % --- Input file (Absolute path) 0008 % parm.brain_file : Brain model file (.brain.mat) 0009 % parm.analyze_file : MRI image file 0010 % parm.gray_file : Gray matter segment file made by SPM 'Segment' 0011 % parm.face_file : face surface file 0012 % 0013 % --- Output file (relative path from 'proj_root') 0014 % parm.head_file : Base name for CSF surface file 0015 % 0016 % --- Optional Parameter 0017 % parm.Nvertex : number of vertex in one surface 0018 % 0019 % - Radius of Morphology operation [mm] 0020 % parm.Radius_csf : smoothing radius for CSF surface (Segment file case) 0021 % = [6 6 -4 -4 ] Default 0022 %%% --- Advanced Optional Parameter 0023 % parm.Nloop = 200; % Iteration number for fit boundary 0024 % parm.Nlast = 10 ; % Iteration number for smoothing by spring model 0025 % 0026 % (Segment file case) 0027 % parm.Glevel = [0.8]; level of gray matter selection threshold 0028 % parm.Radius_fill = [4]; Cortex fill radius 0029 % parm.Radius_gray = [-2 2]; Radius to remove noise in gray matter image 0030 % 0031 % Masa-aki Sato 2009-10-7 0032 % 0033 % Copyright (C) 2011, ATR All Rights Reserved. 0034 % License : New BSD License(see VBMEG_LICENSE.txt) 0035 0036 clear all 0037 0038 % Number of shell = 1 or 3 0039 shell_num = 3; 0040 0041 % Subject data directory 0042 subj_dir = [getenv('MATHOME') '/NH_SEF']; 0043 0044 proj_root = subj_dir; 0045 0046 % --- Input file (Absolute path) 0047 parm.brain_file = [subj_dir '/test/test.brain.mat' ]; 0048 parm.analyze_file = [subj_dir '/NH_brain/3D.hdr']; 0049 parm.face_file = [subj_dir '/NH_brain/HiroeNobuo.face.mat']; 0050 0051 % Segment file for gray matter by SPM2 'Segment' 0052 parm.gray_file = [subj_dir '/MRI_segment/3D_seg1.hdr']; 0053 % SPM2 - 'Segment' output 3 image files for gray/white/CSF 0054 % Only gray matter file *_seg1.hdr/img is necessary 0055 % SPM5 might output different naming files 0056 0057 % --- Output file (relative path from 'proj_root') 0058 parm.head_file = 'test/std2head'; 0059 0060 %%% --- Optional Parameter 0061 % Radius of Morphology operation [mm] 0062 parm.Radius_csf = [6 6 -4 -4 ]; % Default 0063 parm.Radius_fill = [4]; % Cortex fill radius 0064 parm.Radius_gray = [-2 2]; % Radius to remove noise in gray matter image 0065 0066 % Extract head surface from cortex and segmented gray matter 0067 switch shell_num 0068 case 1 0069 % --- 1 shell 0070 vb_job_head_1shell(proj_root, parm); 0071 case 3 0072 % --- 3 shell 0073 vb_job_head_3shell(proj_root, parm); 0074 end