Skip to content

Commit

Permalink
add sr to spikes if needed
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanharvey1 committed Dec 6, 2024
1 parent 41a0ee7 commit 8d73f13
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions preProcessing/add_event_psth_cell_explorer.m
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
function add_event_psth_cell_explorer(basepath)
% add_event_psth_cell_explorer: adds event psth after cell_metrics creation
% add_event_psth_cell_explorer: adds event psth after cell_metrics creation
%
% Here is a function to add the psths for your events to cell_metrics after
% you have already created your cell_metrics file. Normally, this is done during
% Here is a function to add the psths for your events to cell_metrics after
% you have already created your cell_metrics file. Normally, this is done during
% pre processing, but maybe you forgot to detect ripples or maybe you have
% a new type of event that you want to view in cell explorer
%
%


% set default params
parameters.excludeMetrics = {'none'};
Expand All @@ -27,6 +26,10 @@ function add_event_psth_cell_explorer(basepath)

load(fullfile(basepath, [basename, '.spikes.cellinfo.mat']), 'spikes');

if ~isfield(spikes, 'sr')
spikes.sr = session.extracellular.sr;
end

% generate psths for existing event files
if any(contains(parameters.metrics, {'event_metrics', 'all'})) && ~any(contains(parameters.excludeMetrics, {'event_metrics'}))
field2remove = {'rippleCorrelogram', 'events', 'rippleModulationIndex', 'ripplePeakDelay'};
Expand Down

0 comments on commit 8d73f13

Please sign in to comment.