readFitParameters.m 916 B

12345678910111213141516171819202122232425
  1. function p=readFitParameters(path,patientID,nclass)
  2. nr=20;
  3. pf=zeros(nr,4);
  4. for realizationId=1:nr
  5. fname=sprintf('%s_%d_%d_fitParFinal.txt',patientID,nclass,realizationId);
  6. of=fullfile(path,patientID,fname);
  7. try
  8. fitPar=readmatrix(of,'Delimiter','\t');
  9. catch ME
  10. fitPar=dlmread(of,'\t')
  11. end
  12. ft=[fitPar(3) 1/fitPar(4)];%rise and fall time; due to symmetry, they get confused, and max is always fall time and min is rise
  13. pf(realizationId,2)=max(ft);
  14. pf(realizationId,3)=1/min(ft);
  15. pf(realizationId,1)=fitPar(2);%constant
  16. pf(realizationId,4)=fitPar(5);%delay
  17. %size(fitPar)
  18. %fprintf('%.2f %.2f %.2f %.2f\n',fitPar(1),fitPar(2),pf(realizationId,2),pf(realizationId,3));
  19. end
  20. p=pf;
  21. %fprintf('%.2f %.2f %.2f\n',median(pf(1,:)), median(pf(2,:)),median(pf(3,:)));
  22. end