test_GREIT_model

PURPOSE ^

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 xx=[
0002   -88.5777  -11.4887    4.6893   49.8963  122.7033  150.3033  195.5103 249.7573 ...
0003   258.8013  279.7393  304.9623  309.2443  322.0923  337.7963  340.6503 348.2633 ...
0004   357.3043  358.7333  361.5873  364.9183  365.3943  366.3453  366.3453 365.3943 ...
0005   362.5393  351.5943  343.5053  326.8513  299.2503  288.3073  264.9923 224.0703 ...
0006   206.4633  162.6833  106.5313   92.2543   57.5153    7.0733   -8.6297 -42.4167 ...
0007   -90.9547 -105.7057 -134.2577 -178.0367 -193.2647 -222.7687 -265.5957 -278.9197 ...
0008  -313.1817 -355.5337 -363.6237 -379.3267 -397.8857 -400.7407 -401.6927 -398.8377 ...
0009  -395.0307 -384.0867 -368.3837 -363.6247 -351.7277 -334.1217 -328.4117 -314.1357 ...
0010  -291.2947 -282.7297 -267.0257 -236.5707 -221.8187 -196.5977 -159.4807 -147.5837];
0011 
0012 yy=[
0013  -385.8513 -386.8033 -386.3273 -384.8993 -368.7193 -353.9673 -323.0363 -283.5403 ...
0014  -274.9743 -254.0363 -225.4843 -217.8703 -187.4153 -140.7813 -124.6013  -86.0573 ...
0015   -38.4703  -29.4273   -9.9173   21.0137   32.4347   53.3727   83.8257   93.3437 ...
0016   114.7587  149.0237  161.8717  187.5677  222.3037  231.3447  247.5237  267.5087 ...
0017   271.3177  277.0297  281.3127  279.4097  274.6507  273.2227  276.5547  284.6447 ...
0018   295.1127  297.4927  301.7757  304.1557  302.2537  297.4947  287.5017  282.2667 ...
0019   259.9017  225.6387  213.7427  185.6677  141.4127  125.2337   88.5917   34.8187 ...
0020    17.6897  -22.2803  -73.6723  -85.0923 -117.9263 -163.6083 -176.4573 -205.9613 ...
0021  -245.9343 -256.4023 -275.4373 -304.9403 -315.4083 -332.0623 -352.0473 -355.3783];
0022 
0023 a = [xx; yy]';
0024 a = flipud(a);
0025 a = a - repmat(mean(a),[72 1]); %mk_GREIT_model::stim_targets assumes this
0026 fmdl = ng_mk_extruded_model({300,a,[3,10],25},[16,1.11,150],[1]);
0027 % maxx = max(abs(fmdl.nodes(:,1)));
0028 % maxy = max(abs(fmdl.nodes(:,2)));
0029 % scale = max(maxx,maxy);
0030 % fmdl.nodes = fmdl.nodes/scale;
0031 % fmdl.nodes(:,3) = fmdl.nodes(:,3) - mean(fmdl.nodes(:,3));
0032 fmdl = mdl_normalize(fmdl,1);
0033 [stim,meas_sel] = mk_stim_patterns(16,1,[0,1],[0,1],{'no_meas_current'}, 1);
0034 fmdl.stimulation = stim;
0035 %%
0036 img = mk_image(fmdl,1);
0037 opt.imgsz = [32 64];
0038 opt.distr = 3; % uniform`
0039 imdl = mk_GREIT_model(img, 0.25, 0.2, opt);
0040 
0041 vh=fwd_solve(img);
0042 % figure
0043 % show_fem(img)
0044 select_fcn = inline('(x-20).^2+(y-30).^2+(z-150).^2<10^2','x','y','z');
0045 img.elem_data = 1 + 0.1*elem_select(img.fwd_model, select_fcn);
0046 
0047 vi=fwd_solve(img);
0048 figure
0049 show_fem(img);
0050 title('extruded model w/ target')
0051 % print -dpng model.png
0052 figure
0053 imgr= inv_solve(imdl,vh,vi);
0054 title('current GREIT recon')
0055 show_fem(imgr);
0056 axis equal
0057 % print -dpng sln.png
0058 
0059 %%
0060 imdl= mk_common_model('c2c2',16);
0061 img=mk_image(imdl); vh=fwd_solve(img); 
0062 img.elem_data(50)=1.1; vi=fwd_solve(img);
0063 figure, show_fem(img), title('circ model');
0064 imgr = inv_solve(imdl,vh,vi);
0065 figure
0066 show_fem(imgr);
0067 title('GN recon')
0068 %%
0069 im_gr = mk_common_gridmdl('GREITc1');
0070 figure
0071 show_fem(inv_solve(im_gr,vh,vi))
0072 title('original GREIT recon');
0073 %%
0074 imdl = mk_common_model('b3cr',[16,1]); %3d, 16 elec, 1 ring
0075 imdl.fwd_model = mdl_normalize(imdl.fwd_model,1);
0076 [stim,meas_sel] = mk_stim_patterns(16,1,[0,1],[0,1],{'no_meas_current'}, 1);
0077 imdl.stimulation = stim;
0078 img = mk_image(imdl);
0079 gr_imdl = mk_GREIT_model(img,0.25,0.02);
0080 vh=fwd_solve(img);
0081 img.elem_data(4100)=1.1; 
0082 vi=fwd_solve(img);
0083 figure, show_fem(img), title('cyl model');
0084 figure
0085 show_fem(inv_solve(gr_imdl,vh,vi))
0086 title('current GREIT recon')
0087 axis equal
0088 
0089 figure
0090 show_fem(inv_solve(im_gr,vh,vi))
0091 title('original GREIT recon')
0092 axis equal

Generated on Wed 21-Jun-2017 09:29:07 by m2html © 2005