0001 function [out1, out2, out3 ] = thorax_geometry(in1,in2);
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 call_thorax_geom = 1;
0016 try if strcmp(in1.type, 'fwd_model')
0017 call_thorax_geom = 0;
0018 end; end
0019
0020 if call_thorax_geom
0021 [out1, out2, out3 ] = thorax_geometry_defs(in1,in2);
0022 else
0023 [x_coord, y_coord, z_mag ] = thorax_geometry_defs;
0024 reidx= [13:16, 1:12];
0025 geo.z_mag = z_mag;
0026 geo.xy= [x_coord(in2,reidx); y_coord(in2,reidx)]';
0027
0028 [out1] = deform_cylinder(in1, geo );
0029 end
0030
0031
0032 function [x_coord, y_coord, z_mag ] = thorax_geometry_defs(level,normalize);
0033
0034 x_coord= [ ...
0035 0,60,123,173,223,202,144,75,0,-75,-144,-202,-223,-173,-123,-60;
0036 0,50,105,138,144,144,109,50,0,-50,-109,-144,-144,-138,-105,-50;
0037 0,52, 99,133,148,141,110,61,0,-61,-110,-141,-148,-133,- 99,-52;
0038 0,51, 92,129,148,136, 96,47,0,-47,- 96,-136,-148,-129,- 92,-51;
0039 0,49, 92,128,148,141,111,64,0,-64,-111,-141,-148,-128,- 92,-49 ];
0040 y_coord= [ ...
0041 123,116, 91,42,-4,-67,-105,-119,-108,-119,-105,-67,-4,42, 91,116;
0042 129,132,112,62, 3,-57,-101,-110,-107,-110,-101,-57, 3,62,112,132;
0043 116,112, 92,53, 3,-48,- 88,-106,-105,-106,- 88,-48, 3,53, 92,112;
0044 143,130, 99,63,14,-35,- 68,- 82,- 82,- 82,- 68,-35,14,63, 99,130;
0045 136,128,103,68,23,-25,- 62,- 78,- 80,- 78,- 62,-25,23,68,103,128 ];
0046 z_mag = 150;
0047
0048 if nargin>=1;
0049 x_coord= x_coord(level,:);
0050 y_coord= y_coord(level,:);
0051 end
0052
0053 if nargin>=2 && normalize
0054 maxv= max([ abs(x_coord(:)); ...
0055 abs(y_coord(:)) ]);
0056 x_coord = x_coord / maxv;
0057 y_coord = y_coord / maxv;
0058 end