Home > functions > brain > vb_reduce_cortex.m

vb_reduce_cortex

PURPOSE ^

Make new cortex model with reduced resolution

SYNOPSIS ^

function [Jreduce,Vnew,Fnew,xx,Vinfo] =vb_reduce_cortex(brainfile,Jindx,Reduce_ratio);

DESCRIPTION ^

 Make new cortex model with reduced resolution
  [Jreduce,Vnew,Fnew] = vb_reduce_cortex(brainfile,Jindx,Reduce_ratio);

 --- Input
 brainfile
 Jindx    : vertex index for traget region
 Reduce_ratio = 1/Nrate : reduced ratio 
  number of reduced vertex points become 1/Nrate

 --- Output
 Jreduce  : reduced vertex index in the original brain
 Vnew : vertex coordinate
 Fnew : patch index structure

 --- History
 Ver 1.1  by M. Sato  2003-4-15
 2003-07-11 Modified by Taku Yoshioka
 2004-3-28 Modified by M. Sato
 2006-7-21 Modified by M. Sato
 2008-11-28 Taku Yoshioka
   Use vb_disp() for displaying message

 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 [Jreduce,Vnew,Fnew,xx,Vinfo] = ...
0002               vb_reduce_cortex(brainfile,Jindx,Reduce_ratio);
0003 % Make new cortex model with reduced resolution
0004 %  [Jreduce,Vnew,Fnew] = vb_reduce_cortex(brainfile,Jindx,Reduce_ratio);
0005 %
0006 % --- Input
0007 % brainfile
0008 % Jindx    : vertex index for traget region
0009 % Reduce_ratio = 1/Nrate : reduced ratio
0010 %  number of reduced vertex points become 1/Nrate
0011 %
0012 % --- Output
0013 % Jreduce  : reduced vertex index in the original brain
0014 % Vnew : vertex coordinate
0015 % Fnew : patch index structure
0016 %
0017 % --- History
0018 % Ver 1.1  by M. Sato  2003-4-15
0019 % 2003-07-11 Modified by Taku Yoshioka
0020 % 2004-3-28 Modified by M. Sato
0021 % 2006-7-21 Modified by M. Sato
0022 % 2008-11-28 Taku Yoshioka
0023 %   Use vb_disp() for displaying message
0024 %
0025 % Copyright (C) 2011, ATR All Rights Reserved.
0026 % License : New BSD License(see VBMEG_LICENSE.txt)
0027 
0028 const = vb_define_verbose;
0029 VERBOSE_LEVEL_NOTICE = const.VERBOSE_LEVEL_NOTICE;
0030 
0031 % 解像度を下げて皮質点を作成
0032 
0033 % 全脳モデル
0034 [V,F,xx] = vb_load_cortex(brainfile);  
0035 
0036 % 頂点座標 V を左右の脳に分ける
0037 Ndipole  = size(V,1);
0038 NdipoleL = F.NdipoleL ;
0039 
0040 if ~exist('Jindx','var') | isempty(Jindx), Jindx = 1:Ndipole; end;
0041 if ~exist('Reduce_ratio','var'), Reduce_ratio = 1/3; end;
0042 
0043 V0L = V(1:NdipoleL , :);
0044 V0R = V((NdipoleL+1):Ndipole , :);
0045 F0R = F.F3R    ;
0046 F0L = F.F3L    ;
0047 
0048 %
0049 % --- Redeuce patch
0050 %
0051 vb_disp('--- Reduce cortex',VERBOSE_LEVEL_NOTICE);
0052 F0R = F0R - NdipoleL;
0053 [F3L,V3L] = reducepatch(F0L,V0L,Reduce_ratio); 
0054 [F3R,V3R] = reducepatch(F0R,V0R,Reduce_ratio);
0055 
0056 %  低解像度皮質点全点のもとの全脳モデルにおけるインデックス
0057 % ---  Find original vertex point to reduced model
0058 %
0059 IndxL = vb_find_match_point(V0L,V3L,50 );
0060 IndxR = vb_find_match_point(V0R,V3R,50 ) + NdipoleL;
0061 
0062 Jflag = zeros(Ndipole,1);    % Extract point flag
0063 Jflag(Jindx) = 1;
0064 
0065 ixL = find( Jflag(IndxL) > 0 );
0066 ixR = find( Jflag(IndxR) > 0 );
0067 
0068 % Index of reduced brain in the original brain
0069 Jreduce = [ IndxL(ixL) ; IndxR(ixR)  ];
0070 
0071 [V3L,F3L] = vb_trans_index( V3L, F3L, ixL);
0072 [V3R,F3R] = vb_trans_index( V3R, F3R, ixR);
0073 
0074 NL  = size(V3L,1);
0075 F3R = F3R + NL;
0076 
0077 Vnew = [V3L; V3R];
0078 
0079 Fnew.F3L = F3L;
0080 Fnew.F3R = F3R;
0081 Fnew.F3  = [F3L; F3R ];
0082 
0083 Fnew.NdipoleL = NL ;
0084 
0085 xx = xx(Jreduce,:);
0086 
0087 % Dimensional info
0088 Vinfo.Ndipole   = size(Vnew, 1);
0089 Vinfo.NdipoleL  = NL;
0090 Vinfo.Npatch    = size(Fnew.F3, 1);
0091 Vinfo.Coord     = 'SPM_Right_m';

Generated on Tue 27-Aug-2013 11:46:04 by m2html © 2005