Home > vbmeg > functions > tool_box > dmri_processor > functions > util > dmri_parcels_cover_all_vertices.m

dmri_parcels_cover_all_vertices

PURPOSE ^

Check if there are vertices that are not affiliated with either parcels.

SYNOPSIS ^

function is_cover_all = dmri_parcels_cover_all_vertices(parcel_file,brain_file,fs_info_file)

DESCRIPTION ^

 Check if there are vertices that are not affiliated with either parcels.

 [Usage]
    is_cover_all = dmri_parcels_cover_all_vertices(parcel_file, ...
                                                   brain_file, ...
                                                   fs_info_file);
 
 [Input]
     parcel_file : parcels information file.
      brain_file : VBMEG Cortical model file.
    fs_info_file : Freesurfer infomation file.

 [Output]
    is_cover_all : = true  : All the vertices are affilated with either parcels.
                   = false : There are vertices that are not affilateed with 
                             either parcels.

 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 is_cover_all = dmri_parcels_cover_all_vertices(parcel_file, ...
0002                                                         brain_file, ...
0003                                                         fs_info_file)
0004 % Check if there are vertices that are not affiliated with either parcels.
0005 %
0006 % [Usage]
0007 %    is_cover_all = dmri_parcels_cover_all_vertices(parcel_file, ...
0008 %                                                   brain_file, ...
0009 %                                                   fs_info_file);
0010 %
0011 % [Input]
0012 %     parcel_file : parcels information file.
0013 %      brain_file : VBMEG Cortical model file.
0014 %    fs_info_file : Freesurfer infomation file.
0015 %
0016 % [Output]
0017 %    is_cover_all : = true  : All the vertices are affilated with either parcels.
0018 %                   = false : There are vertices that are not affilateed with
0019 %                             either parcels.
0020 %
0021 % Copyright (C) 2011, ATR All Rights Reserved.
0022 % License : New BSD License(see VBMEG_LICENSE.txt)
0023 
0024 %
0025 % --- Previous check
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 % --- Main Procedure
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     % for VBMEG ver2 BRAIN-MAT
0052     Vinfo       = subj.Vinfo;
0053     normal_stat = subj.normal_stat;
0054 else
0055     % for VBMEG ver1 BRAIN-MAT
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

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