Home > vbmeg > demo > test_scripts > vb_job_load_vivid.m

vb_job_load_vivid

PURPOSE ^

vb_job_load_vivid

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 vb_job_load_vivid
 Load VIVID VRML file

  Vivid original format
   X: 右->左
   Y: 下->上
   Z: 後->前
  SPM-R
   X: 左->右
   Y: 後->前
   Z: 下->上

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % vb_job_load_vivid
0002 % Load VIVID VRML file
0003 %
0004 %  Vivid original format
0005 %   X: 右->左
0006 %   Y: 下->上
0007 %   Z: 後->前
0008 %  SPM-R
0009 %   X: 左->右
0010 %   Y: 後->前
0011 %   Z: 下->上
0012 
0013 % Coord : Left / Right /Front    head coordinate
0014 %  'reduce_VRML'-File
0015 %        .LV   / .RV   / .FV   : 3D-Coordinate   : [Npoint 3]  [mm]
0016 %        .LX   / .RX   / .FX   : 2D X-Coordinate : [Npoint 1]  [mm]
0017 %        .LY   / .RY   / .FY   : 2D Y-Coordinate : [Npoint 1]  [mm]
0018 %        .LF   / .RF   / .FF   : Patch index     : [Npatch Nnode]
0019 %        .Limg / .Rimg / .Fimg : 2D RGB image    : [NX NY 3]
0020 %  'non_reduce_VRML'-File --- Optional
0021 %        .LV3  / .RV3  / .FV3  : 3D-Coordinate(not reduced) : [Lpoint 3] [mm]
0022 %        .LF3  / .RF3  / .FF3  : Patch index  (not reduced) : [Lpatch Lnode]
0023 %
0024 % Copyright (C) 2011, ATR All Rights Reserved.
0025 % License : New BSD License(see VBMEG_LICENSE.txt)
0026 
0027 clear
0028 
0029 %udir   = [getenv('MATHOME') '/SBIdata-new/Vivid/'];
0030 udir   = [getenv('MATHOME') '/SBIdata-new/Retino-TY/vivid/'];
0031 
0032 % Base name of vivid-vrml file  (*.wrl)
0033 fsubj  = '20051221_Yoshioka';
0034 %fsubj   = 'osako';
0035 
0036 file_ver = 0;
0037 
0038 switch    file_ver
0039 case    0
0040     % Old file extension
0041     left_ext  = '_left.wrl' ;
0042     right_ext = '_right.wrl';
0043     
0044     fname.Left  = [udir fsubj left_ext  ];% Left
0045     fname.Right = [udir fsubj right_ext ];% Right
0046     
0047 case    1
0048     % New file extension
0049     left_ext  = '_left_reduce_VRML1.wrl' ;
0050     right_ext = '_right_reduce_VRML1.wrl';
0051     front_ext = '_front_reduce_VRML1.wrl';
0052     
0053     left_ext2  = '_left_non_reduce_VRML1.wrl' ;
0054     right_ext2 = '_right_non_reduce_VRML1.wrl';
0055     front_ext2 = '_front_non_reduce_VRML1.wrl';
0056     
0057     % reduce_VRML File include 3D shape & 2D image
0058     fname.Left  = [udir fsubj left_ext  ];% Left
0059     fname.Right = [udir fsubj right_ext ];% Right
0060     fname.Front = [udir fsubj front_ext ];% Front
0061     
0062     % non_reduce_VRML File include detailed 3D shape
0063     % --- Optional
0064     %fname.Left_3d  = [udir fsubj left_ext2 ];% Left
0065     %fname.Right_3d = [udir fsubj right_ext2];% Right
0066     %fname.Front_3d = [udir fsubj front_ext2];% Front
0067 end
0068 
0069 
0070 % Output mat file
0071 fname.vivid = [udir fsubj '.vivid.mat'];
0072 
0073 %  Set mode for Vivid original format
0074 xy_mode    = 0;
0075 %   xy_mode  = 0; 2D-coordinate Y : 上(1) -> 下(400)
0076 %   xy_mode  = 1; 2D-coordinate Y : 下(1) -> 上(400)
0077 coord_mode = 1;
0078 % coord_mode = 0 座標変換無し
0079 % coord_mode = 1; VIVID -> SPM-R
0080 
0081 [Coord] = vb_read_vivid(fname,coord_mode);
0082 
0083 vb_save(fname.vivid,'Coord');
0084 
0085 % Plot vivid 2D image and 3D image to get marker position
0086 figH = vb_plot_vivid(Coord, xy_mode);

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