


USAGE: inhomg_img = create_inclusion( homg_img, inclusion_xyz, ...
inclusion_r, inclusion_mat )
Parameters:
homg_img - image structure (fwd_model + elem_data)
center - center of spherical inclusion
r - radius of inclusion
inclusion_mat - inclusion material
Function create inclusion by changing material properties for elements
which center is is inside of the sphere defined by (center and r).
(C) 2009, Bartosz Sawicki
$Id: create_inclusion.m 3028 2012-06-06 14:26:48Z aadler $
Licenced under the GPLv2 or later

0001 function inhomg_img = create_inclusion( homg_img, center, r, inclusion_mat, order) 0002 % USAGE: inhomg_img = create_inclusion( homg_img, inclusion_xyz, ... 0003 % inclusion_r, inclusion_mat ) 0004 % 0005 % Parameters: 0006 % homg_img - image structure (fwd_model + elem_data) 0007 % center - center of spherical inclusion 0008 % r - radius of inclusion 0009 % inclusion_mat - inclusion material 0010 % 0011 % Function create inclusion by changing material properties for elements 0012 % which center is is inside of the sphere defined by (center and r). 0013 % 0014 % (C) 2009, Bartosz Sawicki 0015 % $Id: create_inclusion.m 3028 2012-06-06 14:26:48Z aadler $ 0016 % Licenced under the GPLv2 or later 0017 0018 name = homg_img.name; 0019 mat = homg_img.elem_data; 0020 fwd_model = homg_img.fwd_model; 0021 0022 % Use coarse2fine mapping to determine if elements are in sphere 0023 xyzr = [center r]; 0024 fraction = mk_c2f_circ_mapping( homg_img.fwd_model, xyzr'); 0025 0026 % Inclusion is overlaped on old material 0027 mat = fraction*inclusion_mat + (1-fraction).*mat; 0028 0029 % Create new image object 0030 inhomg_img= eidors_obj('image', name, ... 0031 'elem_data', mat, ... 0032 'fwd_model', fwd_model ); 0033 0034 0035 0036