From 1b9c2575b3645ea6e1690f8e1f0a83f152f7f7ae Mon Sep 17 00:00:00 2001 From: JoeZiminski Date: Mon, 16 Oct 2023 18:24:56 +0100 Subject: [PATCH 1/6] Update ks3 master file.m --- src/spikeinterface/sorters/external/kilosort3_master.m | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/spikeinterface/sorters/external/kilosort3_master.m b/src/spikeinterface/sorters/external/kilosort3_master.m index 0999939f14..d73ffc918e 100644 --- a/src/spikeinterface/sorters/external/kilosort3_master.m +++ b/src/spikeinterface/sorters/external/kilosort3_master.m @@ -26,7 +26,7 @@ function kilosort3_master(fpath, kilosortPath) if skip_kilosort_preprocessing % hack to skip the internal preprocessing % this mimic the preprocessDataSub() function - fprintf("SKIP kilosort2.5 preprocessing\n"); + fprintf("Skipping kilosort3 preprocessing\n"); ops.nt0 = getOr(ops, {'nt0'}, 61); % number of time samples for the templates (has to be <=81 due to GPU shared memory) ops.nt0min = getOr(ops, 'nt0min', ceil(20 * ops.nt0/61)); % time sample where the negative peak should be aligned @@ -49,11 +49,13 @@ function kilosort3_master(fpath, kilosortPath) rez.xcoords = xc; rez.ycoords = yc; Nbatch = ceil(ops.sampsToRead / ops.NT); % number of data batches + ops.Nbatch = Nbatch; NTbuff = ops.NT + 3*ops.ntbuff; % we need buffers on both sides for filtering rez.Wrot = eye(ops.Nchan); % fake whitenning rez.temp.Nbatch = Nbatch; - % fproc is the same as the binary + % fproc (preprocessed output) is the same as the fbinary (unprocessed input) + % because we are skipping preprocessing. ops.fproc = ops.fbinary; rez.ops = ops; % memorize ops @@ -62,7 +64,7 @@ function kilosort3_master(fpath, kilosortPath) rez.ops.Nbatch = Nbatch; rez.ops.NTbuff = NTbuff; - tic; % tocs are coming + tic; % tocs are coming TODO else % preprocess data to create temp_wh.dat From 68b044aa794b26c6713c2062ed72f8f38c53569a Mon Sep 17 00:00:00 2001 From: JoeZiminski Date: Mon, 16 Oct 2023 18:25:34 +0100 Subject: [PATCH 2/6] Update ks2.5 master file.m --- src/spikeinterface/sorters/external/kilosort2_5_master.m | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/spikeinterface/sorters/external/kilosort2_5_master.m b/src/spikeinterface/sorters/external/kilosort2_5_master.m index 2dd39f236c..e514080f67 100644 --- a/src/spikeinterface/sorters/external/kilosort2_5_master.m +++ b/src/spikeinterface/sorters/external/kilosort2_5_master.m @@ -26,7 +26,7 @@ function kilosort2_5_master(fpath, kilosortPath) if skip_kilosort_preprocessing % hack to skip the internal preprocessing % this mimic the preprocessDataSub() function - fprintf("SKIP kilosort2.5 preprocessing\n"); + fprintf("Skipping kilosort2.5 preprocessing\n"); ops.nt0 = getOr(ops, {'nt0'}, 61); % number of time samples for the templates (has to be <=81 due to GPU shared memory) ops.nt0min = getOr(ops, 'nt0min', ceil(20 * ops.nt0/61)); % time sample where the negative peak should be aligned @@ -49,11 +49,13 @@ function kilosort2_5_master(fpath, kilosortPath) rez.xcoords = xc; rez.ycoords = yc; Nbatch = ceil(ops.sampsToRead / ops.NT); % number of data batches + ops.Nbatch = Nbatch; NTbuff = ops.NT + 3*ops.ntbuff; % we need buffers on both sides for filtering rez.Wrot = eye(ops.Nchan); % fake whitenning rez.temp.Nbatch = Nbatch; - % fproc is the same as the binary + % fproc (preprocessed output) is the same as the fbinary (unprocessed input) + % because we are skipping preprocessing. ops.fproc = ops.fbinary; rez.ops = ops; % memorize ops @@ -62,7 +64,7 @@ function kilosort2_5_master(fpath, kilosortPath) rez.ops.Nbatch = Nbatch; rez.ops.NTbuff = NTbuff; - tic; % tocs are coming + tic; % tocs are coming TODO else % preprocess data to create temp_wh.dat From 032aca735a65a06dca25c70dc3cb7193937ab795 Mon Sep 17 00:00:00 2001 From: JoeZiminski Date: Mon, 16 Oct 2023 18:25:50 +0100 Subject: [PATCH 3/6] Update ks2 master file.m --- .../sorters/external/kilosort2_master.m | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/spikeinterface/sorters/external/kilosort2_master.m b/src/spikeinterface/sorters/external/kilosort2_master.m index da7c5f5598..1e2587aac2 100644 --- a/src/spikeinterface/sorters/external/kilosort2_master.m +++ b/src/spikeinterface/sorters/external/kilosort2_master.m @@ -26,7 +26,7 @@ function kilosort2_master(fpath, kilosortPath) if skip_kilosort_preprocessing % hack to skip the internal preprocessing % this mimic the preprocessDataSub() function - fprintf("SKIP kilosort2.5 preprocessing\n"); + fprintf("Skipping kilosort2 preprocessing\n"); ops.nt0 = getOr(ops, {'nt0'}, 61); % number of time samples for the templates (has to be <=81 due to GPU shared memory) ops.nt0min = getOr(ops, 'nt0min', ceil(20 * ops.nt0/61)); % time sample where the negative peak should be aligned @@ -48,12 +48,14 @@ function kilosort2_master(fpath, kilosortPath) rez.yc = yc; rez.xcoords = xc; rez.ycoords = yc; - Nbatch = ceil(ops.sampsToRead / ops.NT); % number of data batches - NTbuff = ops.NT + 3*ops.ntbuff; % we need buffers on both sides for filtering + Nbatch = ceil(ops.sampsToRead /(NT-ops.ntbuff)); % number of data batches + ops.Nbatch = Nbatch; + NTbuff = NT + 4*ops.ntbuff; % we need buffers on both sides for filtering rez.Wrot = eye(ops.Nchan); % fake whitenning rez.temp.Nbatch = Nbatch; - % fproc is the same as the binary + % fproc (preprocessed output) is the same as the fbinary (unprocessed input) + % because we are skipping preprocessing. ops.fproc = ops.fbinary; rez.ops = ops; % memorize ops @@ -62,7 +64,7 @@ function kilosort2_master(fpath, kilosortPath) rez.ops.Nbatch = Nbatch; rez.ops.NTbuff = NTbuff; - tic; % tocs are coming + tic; % tocs are coming TODO else % preprocess data to create temp_wh.dat From c80f7fbd4836544b0f17d28e8489657b562a4c7e Mon Sep 17 00:00:00 2001 From: Alessio Buccino Date: Wed, 25 Oct 2023 16:48:33 +0200 Subject: [PATCH 4/6] Update src/spikeinterface/sorters/external/kilosort2_5_master.m Co-authored-by: Zach McKenzie <92116279+zm711@users.noreply.github.com> --- src/spikeinterface/sorters/external/kilosort2_5_master.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/spikeinterface/sorters/external/kilosort2_5_master.m b/src/spikeinterface/sorters/external/kilosort2_5_master.m index e514080f67..95894eaf40 100644 --- a/src/spikeinterface/sorters/external/kilosort2_5_master.m +++ b/src/spikeinterface/sorters/external/kilosort2_5_master.m @@ -64,7 +64,7 @@ function kilosort2_5_master(fpath, kilosortPath) rez.ops.Nbatch = Nbatch; rez.ops.NTbuff = NTbuff; - tic; % tocs are coming TODO + tic; % tocs are supplied in other parts of KS code else % preprocess data to create temp_wh.dat From 3f64786b57d50046648b2674d15093377bcc17b2 Mon Sep 17 00:00:00 2001 From: Alessio Buccino Date: Wed, 25 Oct 2023 16:48:42 +0200 Subject: [PATCH 5/6] Update src/spikeinterface/sorters/external/kilosort2_master.m Co-authored-by: Zach McKenzie <92116279+zm711@users.noreply.github.com> --- src/spikeinterface/sorters/external/kilosort2_master.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/spikeinterface/sorters/external/kilosort2_master.m b/src/spikeinterface/sorters/external/kilosort2_master.m index 1e2587aac2..ebd5bd4a25 100644 --- a/src/spikeinterface/sorters/external/kilosort2_master.m +++ b/src/spikeinterface/sorters/external/kilosort2_master.m @@ -64,7 +64,7 @@ function kilosort2_master(fpath, kilosortPath) rez.ops.Nbatch = Nbatch; rez.ops.NTbuff = NTbuff; - tic; % tocs are coming TODO + tic; % tocs are supplied in other parts of KS code else % preprocess data to create temp_wh.dat From bbe06eda3117c19b833ee2cc68eeded91abf9dd4 Mon Sep 17 00:00:00 2001 From: Alessio Buccino Date: Wed, 25 Oct 2023 16:48:54 +0200 Subject: [PATCH 6/6] Update src/spikeinterface/sorters/external/kilosort3_master.m Co-authored-by: Zach McKenzie <92116279+zm711@users.noreply.github.com> --- src/spikeinterface/sorters/external/kilosort3_master.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/spikeinterface/sorters/external/kilosort3_master.m b/src/spikeinterface/sorters/external/kilosort3_master.m index d73ffc918e..26dd06e2fa 100644 --- a/src/spikeinterface/sorters/external/kilosort3_master.m +++ b/src/spikeinterface/sorters/external/kilosort3_master.m @@ -64,7 +64,7 @@ function kilosort3_master(fpath, kilosortPath) rez.ops.Nbatch = Nbatch; rez.ops.NTbuff = NTbuff; - tic; % tocs are coming TODO + tic; % tocs are supplied in other parts of KS code else % preprocess data to create temp_wh.dat