From 3e485c79f7a0bbc54af60cd59c81fafa0063fbed Mon Sep 17 00:00:00 2001 From: owinter Date: Fri, 6 Dec 2024 16:29:37 +0000 Subject: [PATCH] support for openephys --- src/ibldsp/voltage.py | 2 +- src/ibldsp/waveforms.py | 8 ++++---- src/spikeglx.py | 1 + 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/ibldsp/voltage.py b/src/ibldsp/voltage.py index 9fcdf27..bd8d4bc 100644 --- a/src/ibldsp/voltage.py +++ b/src/ibldsp/voltage.py @@ -369,7 +369,7 @@ def destripe( if neuropixel_version is not None: x = fourier.fshift(x, h["sample_shift"], axis=1) # apply spatial filter only on channels that are inside of the brain - if channel_labels is not None: + if (channel_labels is not None) and (channel_labels is not False): x = interpolate_bad_channels(x, channel_labels, h["x"], h["y"]) inside_brain = np.where(channel_labels != 3)[0] x[inside_brain, :] = spatial_fcn(x[inside_brain, :]) # apply the k-filter diff --git a/src/ibldsp/waveforms.py b/src/ibldsp/waveforms.py index bcc3f0b..fae7cd9 100644 --- a/src/ibldsp/waveforms.py +++ b/src/ibldsp/waveforms.py @@ -815,10 +815,10 @@ def iradon(w, sr, offset, fmin=0, fmax=None, slowness=None, N=1, mu=.1): fmax = 1 / (sr * 2) if fmax is None else fmax if slowness is None: - ds = 1 / fmax / (np.max(offset) - np.min(offset)) - dx = np.median(np.abs(np.diff(offset))) - smax = 1 / dx / fmax - slowness = np.linspace(0, smax, int(np.ceil(smax / ds))) + ds = 1 / fmax / (np.max(offset) - np.min(offset)) + dx = np.median(np.abs(np.diff(offset))) + smax = 1 / dx / fmax + slowness = np.linspace(0, smax, int(np.ceil(smax / ds))) # Decompose les donnees sous la forme d'une somme d'ondes de vitesse 1./slowness ns, nc = w.shape diff --git a/src/spikeglx.py b/src/spikeglx.py index a2d1788..2aa0195 100644 --- a/src/spikeglx.py +++ b/src/spikeglx.py @@ -123,6 +123,7 @@ def __init__( self.channel_conversion_sample2v = {"samples": np.ones(nc) * s2v} if self._nsync > 0: self.channel_conversion_sample2v["samples"][-nsync:] = 1 + self.geometry = neuropixel.trace_header(version=1) else: # normal case we continue reading and interpreting the metadata file self.file_meta_data = meta_file