Home > functions > tool_box > mri_toolbox > mri_point_select_dir > mps_fileio > vb_mps_fileio_read.m

vb_mps_fileio_read

PURPOSE ^

read mps file(.mps.mat).

SYNOPSIS ^

function [obj] = vb_mps_fileio_read(obj, mps_file)

DESCRIPTION ^

 read mps file(.mps.mat).
 [USAGE]
    [obj] = vb_mps_fileio_read(<obj>, <mps_file>)
 [IN]
         obj : mps_fileio object
    mps_file : mps filename
 [OUT]
    obj : mps_fileio object

 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 [obj] = vb_mps_fileio_read(obj, mps_file)
0002 % read mps file(.mps.mat).
0003 % [USAGE]
0004 %    [obj] = vb_mps_fileio_read(<obj>, <mps_file>)
0005 % [IN]
0006 %         obj : mps_fileio object
0007 %    mps_file : mps filename
0008 % [OUT]
0009 %    obj : mps_fileio object
0010 %
0011 % Copyright (C) 2011, ATR All Rights Reserved.
0012 % License : New BSD License(see VBMEG_LICENSE.txt)
0013 if ~exist('obj', 'var'), error('obj is a required parameter.'); end
0014 if ~exist('mps_file', 'var') || isempty(mps_file)
0015     error('mps_file is a required parameter.');
0016 end
0017 
0018 s = load(mps_file);
0019 
0020 %
0021 % --- Parse file format and make objects
0022 %
0023 
0024 % make analyze_info object
0025 obj.analyze_info = s.Analyzeinfo;
0026 
0027 % make point_list object
0028 NPoints = length(s.Base);
0029 point_list = vb_mps_pointlist_new;
0030 
0031 for k=1:NPoints
0032     point_list = vb_mps_pointlist_add_point(point_list,...
0033                                          s.Base{k}.name,...
0034                                          s.Base{k}.point);
0035 end
0036 
0037 obj.point_list = point_list;
0038

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