Skip to content

Commit

Permalink
changed ripple detection to save detection channels as channel tags
Browse files Browse the repository at this point in the history
  • Loading branch information
lolaBerkowitz committed Dec 9, 2024
1 parent b8a8a3d commit bf2dada
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions preprocessing/preprocess_pipeline.m
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,15 @@

%% Detect SWRs using DectSWR.
% first input [ripple channel, sharp wave channel] using intan channels + 1 (for matlab 1-based indexing).
ripple_channel = 1;%session.brainRegions.CA1sp.channels(end-1)
sharp_wave_channel = 8;%session.brainRegions.CA1sr.channels(end-3);
noise_channel = 46;
session.channelTags.Ripple = 25;
session.channelTags.SharpWave = 11;
session.channelTags.RippleNoise = 32;

ripples = DetectSWR([ripple_channel,...
sharp_wave_channel,...
noise_channel],...
save([basepath,filesep,[basename,'.session.mat']],'session');

ripples = DetectSWR([session.channelTags.Ripple,...
session.channelTags.SharpWave,...
session.channelTags.RippleNoise],...
'thresSDrip',[.25,.5],...
'thresSDswD',[.25,.5],...
'saveMat',true,...
Expand Down Expand Up @@ -216,10 +218,10 @@ function preprocess_batch(data_folder, multishank)
try
basepath = df.basepath{i}{:};
basename = basenameFromBasepath(basepath);
if isempty(dir(fullfile(basepath,[basename,'.lfp']))) & ~multishank
if isempty(dir(fullfile(basepath,[basename,'.lfp']))) && ~multishank
preprocess_session(basepath,'digitalInputs',false,'check_epochs',false,'kilosort',false,'overwrite',false)
channel_mapping('basepath',basepath)
elseif isempty(dir(fullfile(basepath,[basename,'.lfp']))) & multishank
elseif isempty(dir(fullfile(basepath,[basename,'.lfp']))) && multishank
preprocess_session(basepath,'digitalInputs',false,'kilosort',false,'tracking',false,'specialChannels',[],'multishank',true,'check_epochs',false)
else
channel_mapping('basepath',basepath)
Expand Down

0 comments on commit bf2dada

Please sign in to comment.