getONOFFParamsFromTable.m 1.2 KB

123456789101112131415161718192021222324252627282930
  1. function out = getONOFFParamsFromTable(StimTableNeuronStim, varargin)
  2. if nargin > 1
  3. nToExcludeFromEnd = varargin{1};
  4. else
  5. nToExcludeFromEnd = 1;
  6. end
  7. for iNeuron = 1: size(StimTableNeuronStim, 1)
  8. responseInd{iNeuron} = [StimTableNeuronStim{iNeuron, 1}.responseIndex{:}];
  9. params = [StimTableNeuronStim{iNeuron, 1}.paramTuning{:}];
  10. polarityWithoutBG = arrayfun(@(x) x.polarityIndex(1: end - nToExcludeFromEnd), params, 'uni', 0);
  11. onWithoutBG = arrayfun(@(x) x.onMean(1: end - nToExcludeFromEnd), params, 'uni', 0);
  12. offWithoutBG = arrayfun(@(x) x.offMean(1: end - nToExcludeFromEnd), params, 'uni', 0);
  13. polarity{iNeuron} = [polarityWithoutBG{:}];
  14. onMean{iNeuron} = [onWithoutBG{:}];
  15. offMean{iNeuron} = [offWithoutBG{:}];
  16. lateToExtremeRatioOFF{iNeuron} = [params.lateToExtremeRatioOFF];
  17. halfRiseOFF{iNeuron} = ([params.halfRiseOFF] - 1) / 10; % Assumes interpolating at 10 Hz.
  18. timeToPeakOff{iNeuron} = ([params.argExtremeOFF] - 1) / 10; % Assumes interpolating at 10 Hz.
  19. end
  20. out.polarity = polarity;
  21. out.onMean = onMean;
  22. out.offMean = offMean;
  23. out.lateToExtremeRatioOFF = lateToExtremeRatioOFF;
  24. out.halfRiseOFF = halfRiseOFF;
  25. out.timeToPeakOff = timeToPeakOff;
  26. out.responseInd = responseInd;
  27. end