0001 function is_cover_all = dmri_parcels_cover_all_vertices(parcel_file, ...
0002 brain_file, ...
0003 fs_info_file)
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027 if nargin ~= 3
0028 error('Please check input arguments.');
0029 end
0030 if exist(parcel_file, 'file') ~= 2
0031 error('Specified parcel_file not found.');
0032 end
0033 if exist(brain_file, 'file') ~= 2
0034 error('Specified brain_file not found.');
0035 end
0036 if exist(fs_info_file, 'file') ~= 2
0037 error('Specified fs_info_file not found.');
0038 end
0039
0040
0041
0042
0043
0044 load(parcel_file);
0045 load(fs_info_file);
0046
0047 warning('off', 'MATLAB:load:variableNotFound')
0048 load(brain_file, 'subj');
0049 warning('on', 'MATLAB:load:variableNotFound')
0050 if exist('subj', 'var')
0051
0052 Vinfo = subj.Vinfo;
0053 normal_stat = subj.normal_stat;
0054 else
0055
0056 load(brain_file, 'Vinfo', 'normal_stat');
0057 end
0058
0059 tt=[];
0060
0061 tt = [tt FS_wm.lh_subcortex_index];
0062 for ii = 1:length(lh_cortex_id)
0063 tt = [tt lh_cortex_id{ii}];
0064 end
0065
0066 tt = [tt FS_wm.rh_subcortex_index+Vinfo.NdipoleL0];
0067 for ii = 1:length(rh_cortex_id)
0068 tt = [tt rh_cortex_id{ii}+Vinfo.NdipoleL0];
0069 end
0070
0071 is_cover_all = false;
0072 Nfsv = size(normal_stat.normal_org,1);
0073 if (min(tt)==1)&&(max(tt)==Nfsv)&&(length(unique(tt))==Nfsv)
0074 is_cover_all = true;
0075 end