getParamsArrayFromStimTable.m 1.2 KB

12345678910111213141516171819202122232425262728
  1. function [amplitudeArray, positionArray, widthArray, responseIndArray, ...
  2. categoryLabel] = getParamsArrayFromStimTable(StimTable, qualityMeasure)
  3. [fitParams, gof] = getFitParamsStructArrayFromTable(StimTable);
  4. % domain = StimTable.nonParamTuning{1}(1).domain;
  5. switch qualityMeasure
  6. case 'rSquare'
  7. responseIndArray = [gof.rsquare];
  8. categoryLabel = 'Goodness of fit (r^2)';
  9. case 'responseQuality'
  10. responseIndArray = getRoisFeaturePerChannel(StimTable.responseIndex);
  11. categoryLabel = 'Response quality index';
  12. otherwise
  13. responseIndArray = getRoisFeaturePerChannel(StimTable.responseIndex);
  14. categoryLabel = 'Response quality index';
  15. end
  16. % Rescale fit units to screen units. We just assume the 1 is screen start
  17. % and number of domain elements is the end. Multiply by 2 deg distance
  18. % between adjacent bar positions. For the width also multiply by a 2 deg
  19. % factor
  20. stimDegreeFactor = 2;
  21. amplitudeArray = fitParams.a1;
  22. positionArray = stimDegreeFactor * (fitParams.b1 - 1);
  23. widthArray = stimDegreeFactor * 2 * sqrt(log(2)) * fitParams.c1; % full-width half maximum conversion
  24. end