CT2dens.m 998 B

12345678910111213141516171819202122
  1. function dens = CT2dens(CTimage,imgtype)
  2. % converts the CT image to physical density based on one of the IVDT tables
  3. % listed below.
  4. GE_LS_PD_hu = [-1024 -689 -518 -92 -50 0 73 214 225 450 812 1201];
  5. GE_LS_PD_dens = [0.0 0.29 0.46 0.947 0.976 1 1.094 1.144 1.153 1.335 1.561 1.824];
  6. % MVCT_hu = [-1024 -682 -494 -54 44 103 118 132 296 463 717 2584];
  7. % MVCT_dens = [0.0 0.3 0.41 0.92 1 1.11 1.14 1.16 1.39 1.56 1.82 4.59];
  8. MVCT_hu = [-1024 -662 -490 -33 2 33 93 107 144 148 314 722 2588];
  9. MVCT_dens = [0 0.29 0.46 0.947 0.976 1 1.051 1.094 1.144 1.153 1.335 1.824 4.59];
  10. if strcmp(imgtype,'pinn') || strcmp(imgtype,'tomo')
  11. GE_hu = GE_LS_PD_hu + 1024;
  12. dens = interp1(GE_hu,GE_LS_PD_dens,double(CTimage),'linear','extrap');
  13. elseif strcmp(imgtype,'mvct') || strcmp(imgtype,'reg')
  14. mvct_hu = MVCT_hu + 1024;
  15. dens = interp1(mvct_hu,MVCT_dens,double(CTimage),'linear','extrap');
  16. else
  17. fprintf('Error: Could not determine density values from CT image.\n');
  18. end