pet2doseFull.m 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. petFileName = 'C:\Documents and Settings\Steve\My Documents\Research\Human\HeadAndNeck\HN003\MatlabData\cuATSMoptFlipped.am';
  5. % PET = load(petFileName);
  6. % PETsparse = sparse3D(PET.data);
  7. PET = am2geom(petFileName);
  8. TDP = open_presc('C:\Documents and Settings\Steve\My Documents\Research\optNew\linlsqOpt\input\HN003uniPrescVolNew\PTV70dosePlus.bin');
  9. TDPfull = full3D(TDP);
  10. TDPbinary = single(~~TDPfull);
  11. PETcorrected = PET.data.*TDPbinary;
  12. PETsparse = sparse3D(PETcorrected);
  13. PETnorm = PETsparse.non_zero_values./(max(PETsparse.non_zero_values));
  14. Power = {};
  15. Power = {PETnorm,PETnorm.^(1/2),PETnorm.^(1/4),PETnorm.^2,PETnorm.^4};
  16. PETprescPower = {};
  17. for i=1:5;
  18. mkdir(['normPower' num2str(i)]);
  19. cd(['normPower' num2str(i)]);
  20. PETprescPower{i}=PETsparse;
  21. PETprescPower{i}.non_zero_values = 60.+10*Power{i};
  22. write_presc(PETprescPower{i});
  23. end
  24. Gomp = {};
  25. E=2.718281828;
  26. k = [2*E,4*E,10*E];
  27. x0 = [0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8];
  28. PETprescGomp = {};
  29. for i=1:3;
  30. for j=1:8;
  31. mkdir(['normGomp' num2str(i) '.' num2str(j)]);
  32. cd(['normGomp' num2str(i) '.' num2str(j)]);
  33. PETprescGomp{i,j}=PETsparse;
  34. PETprescGomp{i,j}.non_zero_values=exp(-exp(-k(i)*(PETnorm-x0(j))));
  35. PETprescGomp{i,j}.non_zero_values=60+10*PETprescGomp{i,j}.non_zero_values;
  36. write_presc(PETprescGomp{i,j});
  37. end
  38. end