0001 function Act = vb_try_atlas_correct(brainfile,atlasfile,atlas_id)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 DEBUG = 0;
0023
0024 if DEBUG == 1,
0025 proj_root = [getenv('MATHOME') '/Retino_TY'];
0026 MRI_ID = 'Retino_TY';
0027 brainfile = [proj_root '/' MRI_ID '.brain.mat'];
0028 atlasfile = [proj_root '/' MRI_ID '.atlas.mat' ];
0029 atlas_id = 'aal';
0030 atlas_id = 'brodmann';
0031 end
0032
0033
0034 if ~exist('brainfile','var')
0035 [pathname, filename] = vb_file_select({'.brain.mat'}, 'Select brain file');
0036 if isempty(filename), return; end;
0037 brainfile = fullfile(pathname, filename{1})
0038 end
0039
0040 if ~exist('atlasfile','var')
0041 [pathname, filename] = vb_file_select({'.atlas.mat'}, 'Select atlas file');
0042 if isempty(filename), return; end;
0043 atlasfile = fullfile(pathname, filename{1})
0044 end
0045
0046 if ~exist('atlas_id','var')
0047 prompt = 'Enter atlas key.';
0048 answer = inputdlg(prompt,'Atlas key',1, {'brodmann'});
0049 atlas_id = answer{1}
0050 end
0051
0052
0053
0054 switch atlas_id
0055 case 'aal'
0056 Para.Rlabel = 0.01;
0057 Para.rate = 0.6;
0058 case 'brodmann'
0059 Para.Rlabel = 0.012;
0060 Para.rate = 0.3;
0061 end
0062
0063 prompt = {['Enter elimination ratio.' ...
0064 ' Increasing it eliminate larger islands']};
0065 answer = inputdlg(prompt,'Ratio',1, {num2str(Para.rate)});
0066 Para.rate = str2num(answer{1})
0067
0068
0069 Atlas = vb_get_act(atlasfile,atlas_id);
0070
0071
0072 switch atlas_id
0073 case 'aal'
0074 Act = vb_correct_atlas_label(Atlas,brainfile,Para);
0075 case 'brodmann'
0076 Act = vb_correct_atlas_label_LR(Atlas,brainfile,Para);
0077 end
0078
0079 vb_plot_atlas_area(brainfile,Act);
0080
0081 vb_plot_atlas2(brainfile,Act);
0082
0083 return