pet2doseCanine.m 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. addpath('C:\Documents and Settings\Steve\My Documents\Research\matlab')
  2. addpath('C:\Documents and Settings\Steve\My Documents\Research\optNew\linlsqUtil')
  3. petFileName = 'C:\Documents and Settings\Steve\My Documents\Research\optNew\linlsqOpt\input\PET004cuATSM\cu64prescInput.mat'
  4. PET = load(petFileName);
  5. PETsparse = sparse3D(PET.data);
  6. % PET = am2geom(petFileName);
  7. % TDP = open_presc('C:\Documents and Settings\Steve\My Documents\Research\optNew\linlsqOpt\input\HN003uniPrescVolNew\PTV70dosePlus.bin');
  8. % TDPfull = full3D(TDP);
  9. % TDPbinary = single(~~TDPfull);
  10. % PETcorrected = PET.data.*TDPbinary;
  11. % PETsparse = sparse3D(PETcorrected);
  12. PETnorm = PETsparse.non_zero_values./(max(PETsparse.non_zero_values));
  13. ind30 = {};
  14. ind20 = {};
  15. ind15 = {};
  16. ind6 = {};
  17. ind3 = {};
  18. for i=1:30;
  19. ind30{i} = find(PETnorm.non_zero_values >= (i-1)./30 && PETnorm.non_zero_values < i./30));
  20. PETnorm.non_zero_values(ind30{i}) = i.;
  21. end
  22. PETpresc1 = 100.+PETnorm.non_zero_values;
  23. PETnorm = PETsparse.non_zero_values./(max(PETsparse.non_zero_values));
  24. for i=1:20;
  25. ind20{i} = find(PETnorm.non_zero_values >= (i-1)./20 && PETnorm.non_zero_values < i./20));
  26. PETnorm.non_zero_values(ind20{i}) = 1.5*i.;
  27. end
  28. PETpresc15 = 100.+PETnorm.non_zero_values;
  29. PETnorm = PETsparse.non_zero_values./(max(PETsparse.non_zero_values));
  30. for i=1:15;
  31. ind15{i} = find(PETnorm.non_zero_values >= (i-1)./15 && PETnorm.non_zero_values < i./15));
  32. PETnorm.non_zero_values(ind15{i}) = 2*i.;
  33. end
  34. PETpresc2 = 100.+PETnorm.non_zero_values;
  35. PETnorm = PETsparse.non_zero_values./(max(PETsparse.non_zero_values));
  36. for i=1:6;
  37. ind6{i} = find(PETnorm.non_zero_values >= (i-1)./6 && PETnorm.non_zero_values < i./6));
  38. PETnorm.non_zero_values(ind6{i}) = 5*i.;
  39. end
  40. PETpresc5 = 100.+PETnorm.non_zero_values;
  41. PETnorm = PETsparse.non_zero_values./(max(PETsparse.non_zero_values));
  42. for i=1:3;
  43. ind3{i} = find(PETnorm.non_zero_values >= (i-1)./3 && PETnorm.non_zero_values < i./3));
  44. PETnorm.non_zero_values(ind15{i}) = 10*i.;
  45. end
  46. PETpresc10 = 100.+PETnorm.non_zero_values;
  47. mkdir('linDiscrete1');
  48. cd('linDiscrete1');
  49. write_presc(PETpresc1);
  50. cd(..);
  51. mkdir('linDiscrete15');
  52. cd('linDiscrete15');
  53. write_presc(PETpresc15);
  54. cd(..);
  55. mkdir('linDiscrete2');
  56. cd('linDiscrete2');
  57. write_presc(PETpresc2);
  58. cd(..);
  59. mkdir('linDiscrete5');
  60. cd('linDiscrete5');
  61. write_presc(PETpresc5);
  62. cd(..);
  63. mkdir('linDiscrete10');
  64. cd('linDiscrete10');
  65. write_presc(PETpresc10);
  66. cd(..);