0001 function vb_inflate_to_flat(parm)
0002
0003
0004
0005
0006
0007
0008
0009
0010 dir = parm.dir ;
0011 file = parm.file;
0012
0013 tic;
0014 fprintf('--- Make Flat model ');
0015
0016
0017 if ~isempty( findstr(file.brain, '.mat') )
0018 BRAINfile = file.brain(1:findstr(file.brain, '.mat')-1);
0019 else
0020 BRAINfile = file.brain;
0021 end
0022
0023 load([dir.inflate file.inflate], 'F','V','inf_C','xxA');
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035 Pmode.flg = {'XLB';'XLF';'XRB';'XRF'; ...
0036 'ZLB';'ZLF';'ZRB';'ZRF'; ...
0037 'YLB';'YLF';'YRB';'YRF'};
0038
0039
0040
0041 Pmode.XYZ = [ 1 1 1 1 2 2 2 2 3 3 3 3 ];
0042
0043
0044
0045 Pmode.LRFB = [ 1 2 3 4 1 2 3 4 1 2 3 4 ];
0046
0047
0048 Xdim = 1;
0049
0050 [XX, IXX, FXX, VXX] = ...
0051 vb_inflate_to_flat_func(V,F,Xdim);
0052
0053
0054 Xdim = 2;
0055
0056 [YY, IYY, FYY, VYY] = ...
0057 vb_inflate_to_flat_func(V,F,Xdim);
0058
0059
0060 Xdim = 3;
0061
0062 [ZZ, IZZ, FZZ, VZZ] = ...
0063 vb_inflate_to_flat_func(V,F,Xdim);
0064
0065
0066
0067
0068
0069
0070 XYsph = cell(3,1);
0071
0072
0073 XYsph{1}.xyz = XX;
0074 XYsph{2}.xyz = YY;
0075 XYsph{3}.xyz = ZZ;
0076
0077
0078 XYsph{1}.ID = IXX;
0079 XYsph{2}.ID = IYY;
0080 XYsph{3}.ID = IZZ;
0081
0082
0083 XYsph{1}.FLR = FXX;
0084 XYsph{2}.FLR = FYY;
0085 XYsph{3}.FLR = FZZ;
0086
0087
0088
0089
0090
0091
0092 fprintf('%f[sec]\n',toc);
0093
0094 fprintf(['--- Save inflate and flat models (' file.inflate ')\n']);
0095 vb_fsave([dir.inflate file.inflate],'F','V','XYsph','Pmode','inf_C', ...
0096 'xxA');
0097
0098