demo_2d_simdata

PURPOSE ^

Example of using EIDORS to simulate 2D data and to

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 Example of using EIDORS to simulate 2D data and to
 solve it using various 2D solvers

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % Example of using EIDORS to simulate 2D data and to
0002 % solve it using various 2D solvers
0003 
0004 % (C) 2005 Andy Adler. License: GPL version 2 or version 3
0005 % $Id: demo_2d_simdata.m 3125 2012-06-08 16:16:24Z bgrychtol $
0006 
0007 %
0008 % Step 1: Create simple 16 electrode 2D model
0009 %
0010 % get parameters for model from mk_circ_tank
0011 % param= mk_circ_tank(rings, levels, n_elec, n_planes )
0012 n_elec= 16;
0013 n_rings= 1;
0014 %options = {'no_meas_current','rotate_meas'};
0015  options = {'no_meas_current','no_rotate_meas'};
0016 params= mk_circ_tank(12, [], n_elec ); 
0017 
0018 params.stimulation= mk_stim_patterns(n_elec, n_rings, '{ad}','{ad}', ...
0019                             options, 10);
0020 params.solve=      'fwd_solve_1st_order';
0021 params.system_mat= 'system_mat_1st_order';
0022 mdl_2d = eidors_obj('fwd_model', params);
0023 show_fem( mdl_2d ); pause;
0024 
0025 % create homogeneous image + simulate data
0026 mat= ones( size(mdl_2d.elems,1) ,1);
0027 homg_img= eidors_obj('image', 'homogeneous image', ...
0028                      'elem_data', mat, ...
0029                      'fwd_model', mdl_2d );
0030 homg_data=fwd_solve( homg_img);
0031 
0032 % create inhomogeneous image + simulate data
0033 mat([65,81,82,101,102,122])=2;
0034 inh_img= eidors_obj('image', 'homogeneous image', ...
0035                      'elem_data', mat, ...
0036                      'fwd_model', mdl_2d );
0037 inh_data=fwd_solve( inh_img);
0038 
0039 %
0040 % Step 2: Create different model for reconstruction
0041 %
0042 params= mk_circ_tank(8, [], n_elec ); 
0043 
0044 params.stimulation= mk_stim_patterns(n_elec, n_rings, '{ad}','{ad}', ...
0045                             options, 10);
0046 params.solve=      'fwd_solve_1st_order';
0047 params.system_mat= 'system_mat_1st_order';
0048 params.jacobian=   'jacobian_adjoint';
0049 mdl_2d_2 = eidors_obj('fwd_model', params);
0050 show_fem( mdl_2d_2 ); pause;
0051 
0052 %
0053 % Step 3: Create inverse model
0054 %
0055 clear inv2d;
0056 inv2d.name= 'EIT inverse';
0057 %inv2d.solve=       'inv_solve_diff_GN_one_step';
0058  inv2d.solve=       'np_inv_solve';
0059 %inv2d.solve=       'aa_inv_total_var';
0060  inv2d.hyperparameter.value = 3e-3;
0061 %inv2d.hyperparameter.func = 'select_noise_figure';
0062 %inv2d.hyperparameter.noise_figure= 2;
0063 %inv2d.hyperparameter.tgt_elems= 1:4;
0064 %inv2d.RtR_prior= 'prior_laplace';
0065  inv2d.R_prior= 'prior_TV';
0066 %inv2d.RtR_prior= 'prior_gaussian_HPF';
0067 inv2d.reconst_type= 'difference';
0068 inv2d.jacobian_bkgnd.value= 1;
0069 inv2d.fwd_model= mdl_2d_2;
0070 inv2d.fwd_model.misc.perm_sym= '{y}';
0071 inv2d= eidors_obj('inv_model', inv2d);
0072 
0073 %
0074 % Step 3: Reconst and show image
0075 %
0076 img= inv_solve( inv2d, inh_data, homg_data);
0077 show_slices(img);
0078

Generated on Fri 30-Dec-2022 19:44:54 by m2html © 2005