forked from njjx/matlab_functions
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathXuSimuMaterialDecomp.m
More file actions
31 lines (20 loc) · 1.24 KB
/
Copy pathXuSimuMaterialDecomp.m
File metadata and controls
31 lines (20 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
function [sgm_water, sgm_bone, coeff_water ,coeff_bone ]= XuSimuMaterialDecomp(sgm_le, sgm_he, en_simu, spec_le, spec_he, order_cell)
spec_le = spec_le/mean(spec_le);
spec_he = spec_he/mean(spec_he);
mu_water = XuGetAtten('water',1,en_simu);
mu_water_mean = mean(spec_le.*mu_water);
length_water_max = max(sgm_le(:))/(mu_water_mean/10)*1.5;% in mm
mu_bone = XuGetAtten('bone',1.92,en_simu);
mu_bone_mean = mean(spec_le.*mu_bone);
length_bone_max = max(sgm_le(:))/(mu_bone_mean/10);% in mm
water_thickness = linspace(0,length_water_max, 20);
bone_thickness = linspace(0,length_bone_max, 20);
[map_water, map_bone] = meshgrid(water_thickness, bone_thickness);
sgm_cali_le = XuGenPostlogSgmFromWaterAndBoneMap(map_water,map_bone,en_simu,spec_le);
sgm_cali_he = XuGenPostlogSgmFromWaterAndBoneMap(map_water,map_bone,en_simu,spec_he);
coeff_water = XuPolyFitForTwoInputs(sgm_cali_le(:), sgm_cali_he(:), map_water(:),order_cell);
coeff_bone = XuPolyFitForTwoInputs(sgm_cali_le(:), sgm_cali_he(:), map_bone(:),order_cell);
sgm_water = XuPolyValForTwoInputs(coeff_water,sgm_le(:), sgm_he(:),order_cell);
sgm_water = reshape(sgm_water,size(sgm_le));
sgm_bone = XuPolyValForTwoInputs(coeff_bone,sgm_le(:), sgm_he(:),order_cell);
sgm_bone = reshape(sgm_bone,size(sgm_le));