Home > vbmeg > demo > test_scripts > vb_job_vivid_marker.m

vb_job_vivid_marker

PURPOSE ^

vb_job_vivid_marker

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 vb_job_vivid_marker
 Sample program
 Get marker 3D coordinate from the VIVID 2D-image by mouse click

 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 % vb_job_vivid_marker
0002 % Sample program
0003 % Get marker 3D coordinate from the VIVID 2D-image by mouse click
0004 %
0005 % Copyright (C) 2011, ATR All Rights Reserved.
0006 % License : New BSD License(see VBMEG_LICENSE.txt)
0007 
0008 clear
0009 
0010 udir   = [getenv('MATHOME') '/SBIdata-new/Retino-TY/vivid/'];
0011 %udir   = [getenv('MATHOME') '/SBIdata-new/Vivid/'];
0012 
0013 % Base name of vivid-vrml file  (*.wrl)
0014 fsubj  = '20051221_Yoshioka';
0015 %fsubj   = 'osako';
0016 
0017 xy_mode    = 0;
0018 %   xy_mode  = 0; 2D-coordinate Y : ¾å(1) -> ²¼(400)
0019 %   xy_mode  = 1; 2D-coordinate Y : ²¼(1) -> ¾å(400)
0020 
0021 % Output mat file
0022 fname.vivid = [udir fsubj '.vivid.mat'];
0023 
0024 load(fname.vivid, 'Coord');
0025 
0026 % Plot vivid 2D image and 3D image to get marker position
0027 figH = vb_plot_vivid(Coord,xy_mode);
0028 
0029 %
0030 % Get marker 3D coordinate from the VIVID 2D-image by mouse click
0031 %
0032 % ---- This part will be replaced by GUI
0033 % marker(1,:): Left ear
0034 % marker(2,:): Nose
0035 % marker(3,:): Right ear
0036 
0037 % mtype ; Marker type and size (structure)
0038 mtype.msize1 = 15;
0039 mtype.mtype1 = '.y';
0040 mtype.msize2 = 20;
0041 
0042 %  Left  ear
0043 mtype.mtype2 = '.r';
0044 Lear  = vb_get_ref_point(Coord, 'L', mtype);
0045 
0046 %  Left  marker
0047 mtype.mtype2 = '.r';
0048 Lmark = vb_get_ref_point(Coord, 'L', mtype);
0049 
0050 %  Nose
0051 mtype.mtype2 = '.r';
0052 Nose = vb_get_ref_point(Coord, 'F', mtype);
0053 
0054 %  Right ear
0055 mtype.mtype2 = '.r';
0056 Rear  = vb_get_ref_point(Coord, 'R', mtype);
0057 
0058 %  Right marker
0059 mtype.mtype2 = '.r';
0060 Rmark  = vb_get_ref_point(Coord, 'R', mtype);
0061 
0062 LandMark = [Lear; Nose; Rear];
0063 Marker   = [Lear; Lmark; Rmark; Rear];
0064 
0065 vb_save(fname.vivid,'LandMark','Marker');

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