Home > functions > gui > bm_editor > brain_data > surf_data > surf_data_new.m

surf_data_new

PURPOSE ^

create surf_data object

SYNOPSIS ^

function [obj] = surf_data_new(V, F, xx, coord_type, model_name, conductivity)

DESCRIPTION ^

 create surf_data object
 [USAGE]
    [obj] = surf_data_new(
               <V>, <F>, <xx>, <coord_type>[,model_name][,conductivity]);
 [IN]
               V : vertex
               F : face
              xx : normal vector
      coord_type : coordinate type of surf_data
      model_name : model name of surf_data
    conductivity : conductivity value
 [OUT]
    obj : surf_data 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] = surf_data_new(V, F, xx, coord_type, model_name, conductivity)
0002 % create surf_data object
0003 % [USAGE]
0004 %    [obj] = surf_data_new(
0005 %               <V>, <F>, <xx>, <coord_type>[,model_name][,conductivity]);
0006 % [IN]
0007 %               V : vertex
0008 %               F : face
0009 %              xx : normal vector
0010 %      coord_type : coordinate type of surf_data
0011 %      model_name : model name of surf_data
0012 %    conductivity : conductivity value
0013 % [OUT]
0014 %    obj : surf_data object
0015 %
0016 % Copyright (C) 2011, ATR All Rights Reserved.
0017 % License : New BSD License(see VBMEG_LICENSE.txt)
0018 
0019 
0020 const = define_bm_edit_app;
0021 
0022 %
0023 % --- Previous check
0024 %
0025 if ~exist('V', 'var'), error('V is a required parameter.'); end
0026 if ~exist('F', 'var'), error('F is a required parameter.'); end
0027 if ~exist('xx', 'var'), error('xx is a required parameter.'); end
0028 if ~exist('coord_type', 'var')
0029     error('coord_type is a required parameter.');
0030 end
0031 if ~exist('model_name', 'var') || isempty(model_name)
0032     model_name = 'surface model';
0033 end
0034 if ~exist('conductivity', 'var') || isempty(conductivity)
0035     conductivity = const.DEFAULT_CONDUCTIVITY;
0036 end
0037 
0038 %
0039 % --- Inheritance
0040 %
0041 obj = brain_data_new(coord_type, model_name, conductivity);
0042 
0043 % set class type
0044 obj.class_type = 'surf_data';
0045 
0046 %
0047 % --- Main Procedure
0048 %
0049 
0050 
0051 obj.V = V;
0052 obj.F = F;
0053 obj.xx = xx;
0054 
0055 % surface close status
0056 omega = vb_solid_angle_check(V, F);
0057 if abs(omega-1)>1e-10
0058     obj.status = const.surf_status.SURFACE_NOT_CLOSED;
0059 else
0060     obj.status = const.surf_status.SURFACE_CLOSED;
0061 end
0062 
0063 %
0064 % --- After check
0065 %
0066 if nargout ~= 1
0067     error('function caller should receive obj.');
0068 end

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