Home > functions > gui > bm_editor > brain_data > brain_data_new.m

brain_data_new

PURPOSE ^

create brain_data object

SYNOPSIS ^

function [obj] = brain_data_new(coord_type, model_name, conductivity)

DESCRIPTION ^

 create brain_data object
 [USAGE]
    [obj] = brain_data_new(<coord_type>, <model_name>);
 [IN]
    coord_type : coordinate type of brain_data
    model_name : model name of brain_data
 [OUT]
    obj : brain_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] = brain_data_new(coord_type, model_name, conductivity)
0002 % create brain_data object
0003 % [USAGE]
0004 %    [obj] = brain_data_new(<coord_type>, <model_name>);
0005 % [IN]
0006 %    coord_type : coordinate type of brain_data
0007 %    model_name : model name of brain_data
0008 % [OUT]
0009 %    obj : brain_data object
0010 %
0011 % Copyright (C) 2011, ATR All Rights Reserved.
0012 % License : New BSD License(see VBMEG_LICENSE.txt)
0013 
0014 const = define_bm_edit_app;
0015 
0016 %
0017 % --- Previous check
0018 %
0019 if ~exist('coord_type', 'var')
0020     error('coord_type is a required parameter.');
0021 end
0022 if ~exist('model_name', 'var') || isempty(model_name)
0023     error('model_name is a required parameter.');
0024 end
0025 if ~exist('conductivity', 'var') || isempty(conductivity)
0026     conductivity = const.DEFAULT_CONDUCTIVITY;
0027 end
0028 
0029 % set class type
0030 obj.class_type = 'brain_data';
0031 
0032 %
0033 % --- Main Procedure
0034 %
0035 obj.coord_type   = coord_type;
0036 obj.model_name   = model_name;
0037 obj.conductivity = conductivity;
0038 obj.history = history_new;
0039 
0040 %
0041 % --- After check
0042 %
0043 if nargout ~= 1
0044     error('function caller should receive obj.');
0045 end

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