123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166 |
- function [Smw Fmw2] = dens2mstp(dens_ratio)
- air_low = 0;
- air_high = 0.05; fat_low = air_high;
- fat_high = 0.99; wat_low = fat_high;
- wat_high = 1.01; mus_low = wat_high;
- mus_high = 1.25; bon_low = mus_high;
- bon_high = 20.0;
- if ~isempty(find(dens_ratio < air_low, 1))
- error('Cannot have negative densities. Redefine input argument.');
- end
- if ~isempty(find(dens_ratio > bon_high, 1))
- error('Extremely high densities are present in the input array, data may not be scaled properly');
- end
- fmw_air_to_water = 990.8 * 1.205E-3;
- fmw_fat_to_water = 0.972 * 0.92;
- fmw_mus_to_water = 0.972 * 1.04;
- fmw_bon_to_water = 0.656 * 1.85;
- fmw_wat_to_water = 1.0;
- Tlo = 1;
- Thi = 250;
- load('MSTPliquid_water.mat');
- water = MSTP;
- load('MSTPair.mat');
- air = MSTP;
- load('MSTPadipose.mat');
- fat = MSTP;
- load('MSTPskeletal_muscle.mat');
- mus = MSTP;
- load('MSTPcompact_bone.mat');
- bon = MSTP;
- dT = [water.T(1) diff(water.T)];
- indices_low = find(water.T <= Tlo);
- ind_low = indices_low(end);
- indices_high = find(water.T >= Thi);
- ind_high = indices_high(1);
- smw_air_to_water = sum(air.tot(ind_low:ind_high)./water.tot(ind_low:ind_high).*dT(ind_low:ind_high))/(Thi-Tlo);
- smw_fat_to_water = sum(fat.tot(ind_low:ind_high)./water.tot(ind_low:ind_high).*dT(ind_low:ind_high))/(Thi-Tlo);
- smw_wat_to_water = 1.0;
- smw_mus_to_water = sum(mus.tot(ind_low:ind_high)./water.tot(ind_low:ind_high).*dT(ind_low:ind_high))/(Thi-Tlo);
- smw_bon_to_water = sum(bon.tot(ind_low:ind_high)./water.tot(ind_low:ind_high).*dT(ind_low:ind_high))/(Thi-Tlo);
- region_air = find (dens_ratio >= air_low & dens_ratio < air_high);
- region_fat = find (dens_ratio >= fat_low & dens_ratio < fat_high);
- region_wat = find (dens_ratio >= wat_low & dens_ratio < wat_high);
- region_mus = find (dens_ratio >= mus_low & dens_ratio < mus_high);
- region_bon = find (dens_ratio >= bon_low);
- Smw = zeros ( size ( dens_ratio ) );
- Smw ( region_air ) = smw_air_to_water * dens_ratio ( region_air );
- Smw ( region_fat ) = smw_fat_to_water * dens_ratio ( region_fat );
- Smw ( region_wat ) = smw_wat_to_water * dens_ratio ( region_wat );
- Smw ( region_mus ) = smw_mus_to_water * dens_ratio ( region_mus );
- Smw ( region_bon ) = smw_bon_to_water * dens_ratio ( region_bon );
- Fmw2 = zeros ( size ( dens_ratio ) );
- Fmw2 ( region_air ) = fmw_air_to_water ./ dens_ratio ( region_air );
- Fmw2 ( region_fat ) = fmw_fat_to_water ./ dens_ratio ( region_fat );
- Fmw2 ( region_wat ) = fmw_wat_to_water ./ dens_ratio ( region_wat );
- Fmw2 ( region_mus ) = fmw_mus_to_water ./ dens_ratio ( region_mus );
- Fmw2 ( region_bon ) = fmw_bon_to_water ./ dens_ratio ( region_bon );
- Fmw2 = Fmw2.^2;
|