loadTime.asv 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. [cax, cm]=function loadTime(path,patientID)
  2. end
  3. %patientID='2SMobr';
  4. path=[ path '/' patientID];
  5. %load ventricle data
  6. %caFile=[ patientID '_Ventricle.mcsv'];
  7. %caFile=fullfile(path,caFile);
  8. %opts = detectImportOptions(caFile,'FileType','text');
  9. %ca=readmatrix(caFile,opts);
  10. caDTFile=[ patientID '_Dummy.mcsv'];
  11. caDTFile=fullfile(path,caDTFile);
  12. opts = detectImportOptions(caDTFile,'FileType','text');
  13. cma=readmatrix(caDTFile,opts);
  14. %convert to seconds->multiply time by 1e-3 and value (integral/t) with 1e3
  15. cax=cma(:,1)*1e-3;
  16. %cay=ca(:,2)*1e3;
  17. cm=cma(:,2)*1e-3;
  18. %this is highly tuned. Assume nframe=20
  19. %p=[1e-3 1e-2*ones(1,1) 1e-1*ones(1,3) ones(1,2) 10*ones(1,8) 100*ones(1,5)];
  20. %w=cay/sum(cay);
  21. %w(1)=1;
  22. %caspline=csaps(cax,cay,p,[],w);
  23. %x=lsqnonlin(biexp,[20 3 10 5.5 0.1],[0,0,0,0,0],[Inf,Inf,Inf, Inf, Inf]);
  24. %chat0=[20, 3, 10, 5.5, 0.1];
  25. %chat0=[10 0.8 10 100];
  26. %lb=zeros(size(chat0));
  27. %ub=Inf*ones(size(chat0));
  28. %chat0=[chat0 cax(1:2)'];
  29. %lb=[lb cax(1:2)'];
  30. %ub=[ub cax(1:2)'];
  31. %chat=lsqcurvefit(@biexp,chat0 ,cax,cay,lb,ub);
  32. centers=loadCenters(path,patientID,nclass,realizationId);