Home > vbmeg > functions > brain > vb_inflate_to_flat.m

vb_inflate_to_flat

PURPOSE ^

Inflation model -> flat model

SYNOPSIS ^

function vb_inflate_to_flat(parm)

DESCRIPTION ^

 Inflation model -> flat model

 Ver 1.0 written by M. Sato  2003-3-15
 Modified by Taku Yoshioka 2003-07-30

 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 vb_inflate_to_flat(parm)
0002 % Inflation model -> flat model
0003 %
0004 % Ver 1.0 written by M. Sato  2003-3-15
0005 % Modified by Taku Yoshioka 2003-07-30
0006 %
0007 % Copyright (C) 2011, ATR All Rights Reserved.
0008 % License : New BSD License(see VBMEG_LICENSE.txt)
0009 
0010 dir   = parm.dir ;
0011 file  = parm.file;
0012 
0013 tic;
0014 fprintf('--- Make Flat model ');
0015 
0016 % 拡張子 '.mat' を取り除く
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 % --- Brain-Voyager coordinate
0026 %
0027 % V0L/R  X:front(0)->back(255), Y:Top(0)->Bottom(255) , Z:left(0)->right(255)
0028 
0029 % Define various projection
0030 % X/Y/Z : X/Y/Z-projection direction
0031 % L/R   : Left/Right cortex
0032 % F/B   : Front/Back-projection
0033 
0034 % Projection & Left/Right & Front/back specification flag
0035 Pmode.flg = {'XLB';'XLF';'XRB';'XRF'; ...
0036              'ZLB';'ZLF';'ZRB';'ZRF'; ...
0037              'YLB';'YLF';'YRB';'YRF'};
0038 
0039 % X/Y/Z-projection direction index
0040 % X/Y/Z : 1/2/3
0041 Pmode.XYZ  = [ 1 1 1 1  2 2 2 2  3 3 3 3 ];
0042 
0043 % Left/Right & Front/Back index
0044 % 'LB'/'LF'/'RB'/'RF' : 1/2/3/4
0045 Pmode.LRFB = [ 1 2 3 4  1 2 3 4  1 2 3 4 ];
0046 
0047 % X-Projection
0048 Xdim     = 1;
0049 
0050 [XX, IXX, FXX, VXX] = ...
0051     vb_inflate_to_flat_func(V,F,Xdim);
0052 
0053 % Y-Projection
0054 Xdim     = 2;
0055 
0056 [YY, IYY, FYY, VYY] = ...
0057     vb_inflate_to_flat_func(V,F,Xdim);
0058 
0059 % Z-Projection
0060 Xdim     = 3;
0061 
0062 [ZZ, IZZ, FZZ, VZZ] = ...
0063     vb_inflate_to_flat_func(V,F,Xdim);
0064 
0065 % XX  : Projected spherical coordinate
0066 % IXX : Partition index (L/R & U/D) for each vertex
0067 % FXX = { FLU;  FLD;  FRU;  FRD }; % Face index for each part {LU;LD;RU;RD}
0068 
0069 % Combine different projection
0070 XYsph = cell(3,1);
0071 
0072 % XYZ-coordinate
0073 XYsph{1}.xyz = XX;    % X-projection
0074 XYsph{2}.xyz = YY;    % Y-projection
0075 XYsph{3}.xyz = ZZ;    % Z-projection
0076 
0077 % Projected plane index for each point
0078 XYsph{1}.ID  = IXX;    % X-projection
0079 XYsph{2}.ID  = IYY;    % Y-projection
0080 XYsph{3}.ID  = IZZ;    % Z-projection
0081 
0082 % Face index for projected plane
0083 XYsph{1}.FLR = FXX;    % X-projection
0084 XYsph{2}.FLR = FYY;    % Y-projection
0085 XYsph{3}.FLR = FZZ;    % Z-projection
0086 
0087 % Projected spherical coordinate
0088 % XYsph{prj}.xyz : XYZ-coordinate , prj = 1,2,3 : X,Y,Z-projection
0089 % XYsph{prj}.ID  : Projected plane index
0090 % XYsph{prj}.FLR : Face index for projected plane
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

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