Compare commits
7 Commits
ffc4f9995d
...
396ebe0c52
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
396ebe0c52 | ||
|
|
58b88b7e73 | ||
|
|
a8778f3596 | ||
|
|
d5499eb3e8 | ||
|
|
307709834b | ||
|
|
a32a1f8cb4 | ||
|
|
56a430df26 |
@@ -5,11 +5,9 @@ project:
|
|||||||
|
|
||||||
format:
|
format:
|
||||||
html:
|
html:
|
||||||
# code-fold: true
|
|
||||||
# code-summary: "Show the code"
|
|
||||||
theme:
|
theme:
|
||||||
light: flatly
|
|
||||||
dark: darkly
|
dark: darkly
|
||||||
|
light: flatly
|
||||||
css:
|
css:
|
||||||
- api/_styles-quartodoc.css
|
- api/_styles-quartodoc.css
|
||||||
- styles.css
|
- styles.css
|
||||||
@@ -37,7 +35,8 @@ website:
|
|||||||
- text: "Usage"
|
- text: "Usage"
|
||||||
href: "usage.qmd"
|
href: "usage.qmd"
|
||||||
- text: "Sample Rates"
|
- text: "Sample Rates"
|
||||||
href: "samplerates.qmd"
|
- text: "Algorithm"
|
||||||
|
href: "algorithm.qmd"
|
||||||
- section: "Delays"
|
- section: "Delays"
|
||||||
href: 'delays.qmd'
|
href: 'delays.qmd'
|
||||||
contents:
|
contents:
|
||||||
|
|||||||
7
doc/algorithm.qmd
Normal file
7
doc/algorithm.qmd
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
---
|
||||||
|
title: Algorithm
|
||||||
|
---
|
||||||
|
|
||||||
|
### 1. Algorithm for automatic detection of repros with TTL pulses
|
||||||
|

|
||||||
|
|
||||||
BIN
doc/assets/algorithm.png
Normal file
BIN
doc/assets/algorithm.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 170 KiB |
@@ -19,23 +19,22 @@ Lets look at the calibration and the first trial of the recording.
|
|||||||
```{python}
|
```{python}
|
||||||
import pathlib
|
import pathlib
|
||||||
|
|
||||||
import rlxnix as rlx
|
|
||||||
import plotly.graph_objects as go
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
import plotly.graph_objects as go
|
||||||
|
import rlxnix as rlx
|
||||||
import scipy.signal as signal
|
import scipy.signal as signal
|
||||||
from plotly.subplots import make_subplots
|
from plotly.subplots import make_subplots
|
||||||
|
from util import plot_line_comparision, trial_plot
|
||||||
from util import trial_plot, plot_line_comparision
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
dataset_path = pathlib.Path("../oephys2nix/test/AllStimuli/2025-10-20-aa-invivo-2-recording.nix")
|
dataset_path = pathlib.Path("../oephys2nix/test/AllStimuli/2025-10-20-aa-invivo-2-recording.nix")
|
||||||
relacs_path = pathlib.Path("../oephys2nix/test/AllStimuli/2025-10-20-aa-invivo-2_relacs/2025-10-20-aa-invivo-2_relacs.nix")
|
relacs_path = pathlib.Path(
|
||||||
|
"../oephys2nix/test/AllStimuli/2025-10-20-aa-invivo-2_relacs/2025-10-20-aa-invivo-2_relacs.nix"
|
||||||
|
)
|
||||||
|
|
||||||
dataset = rlx.Dataset(str(dataset_path))
|
dataset = rlx.Dataset(str(dataset_path))
|
||||||
relacs = rlx.Dataset(str(relacs_path))
|
relacs = rlx.Dataset(str(relacs_path))
|
||||||
|
|
||||||
#INFO: Select the first stimulus of the calibration repro
|
# INFO: Select the first stimulus of the calibration repro
|
||||||
repro_d = dataset.repro_runs("BaselineActivity")[0]
|
repro_d = dataset.repro_runs("BaselineActivity")[0]
|
||||||
repro_r = relacs.repro_runs("BaselineActivity")[0]
|
repro_r = relacs.repro_runs("BaselineActivity")[0]
|
||||||
|
|
||||||
@@ -57,7 +56,7 @@ ttl, t = repro_d.trace_data("ttl-line")
|
|||||||
If you zoom in you can see a little delay between the different recording systems. It seems that open-ephys is before the relacs recording.
|
If you zoom in you can see a little delay between the different recording systems. It seems that open-ephys is before the relacs recording.
|
||||||
|
|
||||||
```{python}
|
```{python}
|
||||||
#| echo: False
|
# | echo: False
|
||||||
# 2. Add traces to the FIRST subplot (row=1, col=1)
|
# 2. Add traces to the FIRST subplot (row=1, col=1)
|
||||||
# Note: Plotly rows and columns are 1-indexed
|
# Note: Plotly rows and columns are 1-indexed
|
||||||
fig = trial_plot(repro_d, repro_r, 1.0)
|
fig = trial_plot(repro_d, repro_r, 1.0)
|
||||||
@@ -70,12 +69,13 @@ print(f"Duration of the dataset {repro_d.duration}")
|
|||||||
print(f"Duration of the relacs {repro_r.duration}")
|
print(f"Duration of the relacs {repro_r.duration}")
|
||||||
# Resample the open-ephys data
|
# Resample the open-ephys data
|
||||||
sinus_resampled = signal.resample(sinus, len(sinus_r))
|
sinus_resampled = signal.resample(sinus, len(sinus_r))
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
```{python}
|
```{python}
|
||||||
#| echo: False
|
# | echo: False
|
||||||
fig= plot_line_comparision(t_r, t_r, sinus_r, sinus_resampled, ["sinus-relacs", "sinus-resampled-open-ephys"])
|
fig = plot_line_comparision(
|
||||||
|
t_r, t_r, sinus_r, sinus_resampled, ["sinus-relacs", "sinus-resampled-open-ephys"]
|
||||||
|
)
|
||||||
fig.show()
|
fig.show()
|
||||||
```
|
```
|
||||||
We need to scale the two signals
|
We need to scale the two signals
|
||||||
@@ -85,23 +85,26 @@ oephys_lanes = [sinus, local_eod_oe, global_eod_oe, stimulus_oe]
|
|||||||
relacs_lanes = [sinus_r, local_eod_re, global_eod_re, stimulus_re]
|
relacs_lanes = [sinus_r, local_eod_re, global_eod_re, stimulus_re]
|
||||||
names_lanes = ["sinus", "local-eod", "global-eod", "stimulus"]
|
names_lanes = ["sinus", "local-eod", "global-eod", "stimulus"]
|
||||||
samples_20kHz = t[-1] * 20_000
|
samples_20kHz = t[-1] * 20_000
|
||||||
print(samples_20kHz)
|
|
||||||
print(f"Total duration {t[-1]}")
|
|
||||||
print(repro_d.duration)
|
|
||||||
lags_lanes = []
|
lags_lanes = []
|
||||||
for oephys_lane, relacs_lane, names_lane in zip(oephys_lanes, relacs_lanes, names_lanes, strict=True):
|
for oephys_lane, relacs_lane, names_lane in zip(
|
||||||
print(oephys_lane.shape)
|
oephys_lanes, relacs_lanes, names_lanes, strict=True
|
||||||
print(relacs_lane.shape)
|
):
|
||||||
oephys_lane_resampled = signal.resample(oephys_lane, int(samples_20kHz))
|
oephys_lane_resampled = signal.resample(oephys_lane, int(samples_20kHz))
|
||||||
correlation = signal.correlate(oephys_lane_resampled, relacs_lane, mode="full")
|
correlation = signal.correlate(oephys_lane_resampled, relacs_lane, mode="full")
|
||||||
lags = signal.correlation_lags(oephys_lane_resampled.size, relacs_lane.size, mode="full")
|
lags = signal.correlation_lags(oephys_lane_resampled.size, relacs_lane.size, mode="full")
|
||||||
lag = lags[np.argmax(correlation)]
|
lag = lags[np.argmax(correlation)]
|
||||||
lags_lanes.append(lag)
|
lags_lanes.append(lag)
|
||||||
print(f"{names_lane} has a lag of {lag}")
|
print(f"{names_lane} has a lag of {lag}")
|
||||||
```
|
```
|
||||||
|
|
||||||
```{python}
|
```{python}
|
||||||
#| echo: False
|
# | echo: False
|
||||||
fig = plot_line_comparision(t_r, t_r, np.roll(sinus_r, lags_lanes[0]), sinus_resampled, ["rolled sinus-relacs", "sinus-resampled-open-ephys"])
|
fig = plot_line_comparision(
|
||||||
|
t_r,
|
||||||
|
t_r,
|
||||||
|
np.roll(sinus_r, lags_lanes[0]),
|
||||||
|
sinus_resampled,
|
||||||
|
["rolled sinus-relacs", "sinus-resampled-open-ephys"],
|
||||||
|
)
|
||||||
fig.show()
|
fig.show()
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ If you zoom in you can see a little delay between the different recording system
|
|||||||
|
|
||||||
```{python}
|
```{python}
|
||||||
# | echo: False
|
# | echo: False
|
||||||
fig = trial_plot(repro_d, repro_r)
|
fig = trial_plot(repro_d, repro_r, 0.41)
|
||||||
fig.show()
|
fig.show()
|
||||||
```
|
```
|
||||||
### Correlation between the Signals
|
### Correlation between the Signals
|
||||||
@@ -85,8 +85,6 @@ lags_lanes = []
|
|||||||
for oephys_lane, relacs_lane, names_lane in zip(
|
for oephys_lane, relacs_lane, names_lane in zip(
|
||||||
oephys_lanes, relacs_lanes, names_lanes, strict=True
|
oephys_lanes, relacs_lanes, names_lanes, strict=True
|
||||||
):
|
):
|
||||||
print(oephys_lane.shape)
|
|
||||||
print(relacs_lane.shape)
|
|
||||||
oephys_lane_resampled = signal.resample(oephys_lane, len(relacs_lane))
|
oephys_lane_resampled = signal.resample(oephys_lane, len(relacs_lane))
|
||||||
correlation = signal.correlate(oephys_lane_resampled, relacs_lane, mode="full")
|
correlation = signal.correlate(oephys_lane_resampled, relacs_lane, mode="full")
|
||||||
lags = signal.correlation_lags(oephys_lane_resampled.size, relacs_lane.size, mode="full")
|
lags = signal.correlation_lags(oephys_lane_resampled.size, relacs_lane.size, mode="full")
|
||||||
|
|||||||
@@ -19,23 +19,22 @@ Lets look at the calibration and the first trial of the recording.
|
|||||||
```{python}
|
```{python}
|
||||||
import pathlib
|
import pathlib
|
||||||
|
|
||||||
import rlxnix as rlx
|
|
||||||
import plotly.graph_objects as go
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
import plotly.graph_objects as go
|
||||||
|
import rlxnix as rlx
|
||||||
import scipy.signal as signal
|
import scipy.signal as signal
|
||||||
from plotly.subplots import make_subplots
|
from plotly.subplots import make_subplots
|
||||||
|
from util import plot_line_comparision, trial_plot
|
||||||
from util import trial_plot, plot_line_comparision
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
dataset_path = pathlib.Path("../oephys2nix/test/Test1/2025-10-08-aa-invivo-2-recording.nix")
|
dataset_path = pathlib.Path("../oephys2nix/test/Test1/2025-10-08-aa-invivo-2-recording.nix")
|
||||||
relacs_path = pathlib.Path("../oephys2nix/test/Test1/2025-10-08-aa-invivo-2_relacs/2025-10-08-aa-invivo-2.nix")
|
relacs_path = pathlib.Path(
|
||||||
|
"../oephys2nix/test/Test1/2025-10-08-aa-invivo-2_relacs/2025-10-08-aa-invivo-2.nix"
|
||||||
|
)
|
||||||
|
|
||||||
dataset = rlx.Dataset(str(dataset_path))
|
dataset = rlx.Dataset(str(dataset_path))
|
||||||
relacs = rlx.Dataset(str(relacs_path))
|
relacs = rlx.Dataset(str(relacs_path))
|
||||||
|
|
||||||
#INFO: Select the first stimulus of the calibration repro
|
# INFO: Select the first stimulus of the calibration repro
|
||||||
repro_d = dataset.repro_runs("FICurve_1")[0].stimuli[2]
|
repro_d = dataset.repro_runs("FICurve_1")[0].stimuli[2]
|
||||||
repro_r = relacs.repro_runs("FICurve_1")[0].stimuli[2]
|
repro_r = relacs.repro_runs("FICurve_1")[0].stimuli[2]
|
||||||
|
|
||||||
@@ -57,10 +56,8 @@ ttl, t = repro_d.trace_data("ttl-line")
|
|||||||
If you zoom in you can see a little delay between the different recording systems. It seems that open-ephys is before the relacs recording.
|
If you zoom in you can see a little delay between the different recording systems. It seems that open-ephys is before the relacs recording.
|
||||||
|
|
||||||
```{python}
|
```{python}
|
||||||
#| echo: False
|
# | echo: False
|
||||||
# 2. Add traces to the FIRST subplot (row=1, col=1)
|
fig = trial_plot(repro_d, repro_r, 0.41)
|
||||||
# Note: Plotly rows and columns are 1-indexed
|
|
||||||
fig = trial_plot(repro_d, repro_r)
|
|
||||||
fig.show()
|
fig.show()
|
||||||
```
|
```
|
||||||
### Correlation between the Signals
|
### Correlation between the Signals
|
||||||
@@ -70,12 +67,13 @@ print(f"Duration of the dataset {repro_d.duration}")
|
|||||||
print(f"Duration of the relacs {repro_r.duration}")
|
print(f"Duration of the relacs {repro_r.duration}")
|
||||||
# Resample the open-ephys data
|
# Resample the open-ephys data
|
||||||
sinus_resampled = signal.resample(sinus, len(sinus_r))
|
sinus_resampled = signal.resample(sinus, len(sinus_r))
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
```{python}
|
```{python}
|
||||||
#| echo: False
|
# | echo: False
|
||||||
fig= plot_line_comparision(t_r, t_r, sinus_r, sinus_resampled, ["sinus-relacs", "sinus-resampled-open-ephys"])
|
fig = plot_line_comparision(
|
||||||
|
t_r, t_r, sinus_r, sinus_resampled, ["sinus-relacs", "sinus-resampled-open-ephys"]
|
||||||
|
)
|
||||||
fig.show()
|
fig.show()
|
||||||
```
|
```
|
||||||
We need to scale the two signals
|
We need to scale the two signals
|
||||||
@@ -85,19 +83,25 @@ oephys_lanes = [sinus, local_eod_oe, global_eod_oe, stimulus_oe]
|
|||||||
relacs_lanes = [sinus_r, local_eod_re, global_eod_re, stimulus_re]
|
relacs_lanes = [sinus_r, local_eod_re, global_eod_re, stimulus_re]
|
||||||
names_lanes = ["sinus", "local-eod", "global-eod", "stimulus"]
|
names_lanes = ["sinus", "local-eod", "global-eod", "stimulus"]
|
||||||
lags_lanes = []
|
lags_lanes = []
|
||||||
for oephys_lane, relacs_lane, names_lane in zip(oephys_lanes, relacs_lanes, names_lanes, strict=True):
|
for oephys_lane, relacs_lane, names_lane in zip(
|
||||||
print(oephys_lane.shape)
|
oephys_lanes, relacs_lanes, names_lanes, strict=True
|
||||||
print(relacs_lane.shape)
|
):
|
||||||
oephys_lane_resampled = signal.resample(oephys_lane, len(relacs_lane))
|
oephys_lane_resampled = signal.resample(oephys_lane, len(relacs_lane))
|
||||||
correlation = signal.correlate(oephys_lane_resampled, relacs_lane, mode="full")
|
correlation = signal.correlate(oephys_lane_resampled, relacs_lane, mode="full")
|
||||||
lags = signal.correlation_lags(oephys_lane_resampled.size, relacs_lane.size, mode="full")
|
lags = signal.correlation_lags(oephys_lane_resampled.size, relacs_lane.size, mode="full")
|
||||||
lag = lags[np.argmax(correlation)]
|
lag = lags[np.argmax(correlation)]
|
||||||
lags_lanes.append(lag)
|
lags_lanes.append(lag)
|
||||||
print(f"{names_lane} has a lag of {lag}")
|
print(f"{names_lane} has a lag of {lag}")
|
||||||
```
|
```
|
||||||
|
|
||||||
```{python}
|
```{python}
|
||||||
#| echo: False
|
# | echo: False
|
||||||
fig = plot_line_comparision(t_r, t_r, np.roll(sinus_r, lags_lanes[0]), sinus_resampled, ["rolled sinus-relacs", "sinus-resampled-open-ephys"])
|
fig = plot_line_comparision(
|
||||||
|
t_r,
|
||||||
|
t_r,
|
||||||
|
np.roll(sinus_r, lags_lanes[0]),
|
||||||
|
sinus_resampled,
|
||||||
|
["rolled sinus-relacs", "sinus-resampled-open-ephys"],
|
||||||
|
)
|
||||||
fig.show()
|
fig.show()
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -18,23 +18,22 @@ format:
|
|||||||
```{python}
|
```{python}
|
||||||
import pathlib
|
import pathlib
|
||||||
|
|
||||||
import rlxnix as rlx
|
|
||||||
import plotly.graph_objects as go
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
import plotly.graph_objects as go
|
||||||
|
import rlxnix as rlx
|
||||||
import scipy.signal as signal
|
import scipy.signal as signal
|
||||||
from plotly.subplots import make_subplots
|
from plotly.subplots import make_subplots
|
||||||
|
from util import plot_line_comparision, trial_plot
|
||||||
from util import trial_plot, plot_line_comparision
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
dataset_path = pathlib.Path("../oephys2nix/test/Test1/2025-10-08-aa-invivo-2-recording.nix")
|
dataset_path = pathlib.Path("../oephys2nix/test/Test1/2025-10-08-aa-invivo-2-recording.nix")
|
||||||
relacs_path = pathlib.Path("../oephys2nix/test/Test1/2025-10-08-aa-invivo-2_relacs/2025-10-08-aa-invivo-2.nix")
|
relacs_path = pathlib.Path(
|
||||||
|
"../oephys2nix/test/Test1/2025-10-08-aa-invivo-2_relacs/2025-10-08-aa-invivo-2.nix"
|
||||||
|
)
|
||||||
|
|
||||||
dataset = rlx.Dataset(str(dataset_path))
|
dataset = rlx.Dataset(str(dataset_path))
|
||||||
relacs = rlx.Dataset(str(relacs_path))
|
relacs = rlx.Dataset(str(relacs_path))
|
||||||
|
|
||||||
#INFO: Select the first stimulus of the calibration repro
|
# INFO: Select the first stimulus of the calibration repro
|
||||||
repro_d = dataset.repro_runs("FileStimulus_1")[0].stimuli[2]
|
repro_d = dataset.repro_runs("FileStimulus_1")[0].stimuli[2]
|
||||||
repro_r = relacs.repro_runs("FileStimulus_1")[0].stimuli[2]
|
repro_r = relacs.repro_runs("FileStimulus_1")[0].stimuli[2]
|
||||||
|
|
||||||
@@ -56,10 +55,10 @@ ttl, t = repro_d.trace_data("ttl-line")
|
|||||||
If you zoom in you can see a little delay between the different recording systems. It seems that open-ephys is before the relacs recording.
|
If you zoom in you can see a little delay between the different recording systems. It seems that open-ephys is before the relacs recording.
|
||||||
|
|
||||||
```{python}
|
```{python}
|
||||||
#| echo: False
|
# | echo: False
|
||||||
# 2. Add traces to the FIRST subplot (row=1, col=1)
|
# 2. Add traces to the FIRST subplot (row=1, col=1)
|
||||||
# Note: Plotly rows and columns are 1-indexed
|
# Note: Plotly rows and columns are 1-indexed
|
||||||
fig = trial_plot(repro_d, repro_r)
|
fig = trial_plot(repro_d, repro_r,1.01)
|
||||||
|
|
||||||
fig.show()
|
fig.show()
|
||||||
```
|
```
|
||||||
@@ -73,8 +72,10 @@ sinus_resampled = signal.resample(sinus, len(sinus_r))
|
|||||||
```
|
```
|
||||||
|
|
||||||
```{python}
|
```{python}
|
||||||
#| echo: False
|
# | echo: False
|
||||||
fig= plot_line_comparision(t_r, t_r, sinus_r, sinus_resampled, ["sinus-relacs", "sinus-resampled-open-ephys"])
|
fig = plot_line_comparision(
|
||||||
|
t_r, t_r, sinus_r, sinus_resampled, ["sinus-relacs", "sinus-resampled-open-ephys"]
|
||||||
|
)
|
||||||
fig.show()
|
fig.show()
|
||||||
```
|
```
|
||||||
We need to scale the two signals
|
We need to scale the two signals
|
||||||
@@ -84,21 +85,29 @@ oephys_lanes = [sinus, local_eod_oe, global_eod_oe, stimulus_oe]
|
|||||||
relacs_lanes = [sinus_r, local_eod_re, global_eod_re, stimulus_re]
|
relacs_lanes = [sinus_r, local_eod_re, global_eod_re, stimulus_re]
|
||||||
names_lanes = ["sinus", "local-eod", "global-eod", "stimulus"]
|
names_lanes = ["sinus", "local-eod", "global-eod", "stimulus"]
|
||||||
lags_lanes = []
|
lags_lanes = []
|
||||||
for oephys_lane, relacs_lane, names_lane in zip(oephys_lanes, relacs_lanes, names_lanes, strict=True):
|
for oephys_lane, relacs_lane, names_lane in zip(
|
||||||
print(oephys_lane.shape)
|
oephys_lanes, relacs_lanes, names_lanes, strict=True
|
||||||
print(relacs_lane.shape)
|
):
|
||||||
oephys_lane_resampled = signal.resample(oephys_lane, len(relacs_lane))
|
print(oephys_lane.shape)
|
||||||
correlation = signal.correlate(oephys_lane_resampled, relacs_lane, mode="full")
|
print(relacs_lane.shape)
|
||||||
lags = signal.correlation_lags(oephys_lane_resampled.size, relacs_lane.size, mode="full")
|
oephys_lane_resampled = signal.resample(oephys_lane, len(relacs_lane))
|
||||||
lag = lags[np.argmax(correlation)]
|
correlation = signal.correlate(oephys_lane_resampled, relacs_lane, mode="full")
|
||||||
lags_lanes.append(lag)
|
lags = signal.correlation_lags(oephys_lane_resampled.size, relacs_lane.size, mode="full")
|
||||||
print(f"{names_lane} has a lag of {lag}")
|
lag = lags[np.argmax(correlation)]
|
||||||
|
lags_lanes.append(lag)
|
||||||
|
print(f"{names_lane} has a lag of {lag}")
|
||||||
```
|
```
|
||||||
|
|
||||||
```{python}
|
```{python}
|
||||||
#| echo: False
|
# | echo: False
|
||||||
fig = plot_line_comparision(t_r, t, np.roll(stimulus_re, lags_lanes[-1]), stimulus_oe-np.mean(stimulus_oe), ["rolled sinus-relacs", "sinus-resampled-open-ephys"])
|
fig = plot_line_comparision(
|
||||||
|
t_r,
|
||||||
|
t,
|
||||||
|
np.roll(stimulus_re, lags_lanes[-1]),
|
||||||
|
stimulus_oe - np.mean(stimulus_oe),
|
||||||
|
["rolled sinus-relacs", "sinus-resampled-open-ephys"],
|
||||||
|
)
|
||||||
fig.show()
|
fig.show()
|
||||||
|
|
||||||
print(f"The lag of the whitenoise is {lags_lanes[-1] * (1/20_000) * 1000} milli seconds")
|
print(f"The lag of the whitenoise is {lags_lanes[-1] * (1 / 20_000) * 1000} milli seconds")
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -86,8 +86,6 @@ lags_lanes = []
|
|||||||
for oephys_lane, relacs_lane, names_lane in zip(
|
for oephys_lane, relacs_lane, names_lane in zip(
|
||||||
oephys_lanes, relacs_lanes, names_lanes, strict=True
|
oephys_lanes, relacs_lanes, names_lanes, strict=True
|
||||||
):
|
):
|
||||||
print(oephys_lane.shape)
|
|
||||||
print(relacs_lane.shape)
|
|
||||||
oephys_lane_resampled = signal.resample(oephys_lane, len(relacs_lane))
|
oephys_lane_resampled = signal.resample(oephys_lane, len(relacs_lane))
|
||||||
correlation = signal.correlate(oephys_lane_resampled, relacs_lane, mode="full")
|
correlation = signal.correlate(oephys_lane_resampled, relacs_lane, mode="full")
|
||||||
lags = signal.correlation_lags(oephys_lane_resampled.size, relacs_lane.size, mode="full")
|
lags = signal.correlation_lags(oephys_lane_resampled.size, relacs_lane.size, mode="full")
|
||||||
|
|||||||
@@ -2,10 +2,38 @@
|
|||||||
title: How to use it
|
title: How to use it
|
||||||
---
|
---
|
||||||
|
|
||||||
|
### 1.Usage
|
||||||
If you have a folder or multiple folders with each containing two recordings one from `relacs` and one from `open-ephys` you can simply run the CLI like this:
|
If you have a folder or multiple folders with each containing two recordings one from `relacs` and one from `open-ephys` you can simply run the CLI like this:
|
||||||
|
|
||||||
```{python}
|
```{python}
|
||||||
# leave out the ! at the beginning if you running this in your shell
|
# leave out the ! at the beginning if you running this in your shell
|
||||||
!oephys2nix ../oephys2nix/test/Test1/
|
!oephys2nix convert ../oephys2nix/test/Test1/
|
||||||
```
|
```
|
||||||
which provides you with information about the transition of the stimuli into the new file.
|
which provides you with information about the transition of the stimuli into the new file.
|
||||||
|
|
||||||
|
### 1.2 Timeline plot
|
||||||
|
```sh
|
||||||
|
oephys2nix timeline ../oephys2nix/test/Test1/
|
||||||
|
```
|
||||||
|
```{python}
|
||||||
|
# | echo: False
|
||||||
|
from oephys2nix.main import timeline
|
||||||
|
|
||||||
|
path = "../oephys2nix/test/Test1/"
|
||||||
|
timeline(path)
|
||||||
|
```
|
||||||
|
|
||||||
|
### 1.3 plot
|
||||||
|
```sh
|
||||||
|
oephys2nix plot ../oephys2nix/test/Test1/
|
||||||
|
```
|
||||||
|
|
||||||
|
```{python}
|
||||||
|
# | echo: False
|
||||||
|
from oephys2nix.main import plot
|
||||||
|
|
||||||
|
path = "../oephys2nix/test/Test1/"
|
||||||
|
plot(path)
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -349,9 +349,6 @@ class StimulusToNix:
|
|||||||
if repro.duration < 0.05:
|
if repro.duration < 0.05:
|
||||||
log.warning(f"Skipping repro {repro.name} because it is two short")
|
log.warning(f"Skipping repro {repro.name} because it is two short")
|
||||||
continue
|
continue
|
||||||
|
|
||||||
embed()
|
|
||||||
exit()
|
|
||||||
if repro.stimuli:
|
if repro.stimuli:
|
||||||
log.debug("Processing MultiTag")
|
log.debug("Processing MultiTag")
|
||||||
repetition = len(repro.stimuli)
|
repetition = len(repro.stimuli)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "oepyhs2nix"
|
name = "oepyhs2nix"
|
||||||
version = "0.1.0"
|
version = "0.1.1"
|
||||||
description = "Converting ophen-ephys data to nix format"
|
description = "Converting ophen-ephys data to nix format"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
requires-python = ">=3.13"
|
requires-python = ">=3.13"
|
||||||
|
|||||||
2
uv.lock
generated
2
uv.lock
generated
@@ -1322,7 +1322,7 @@ wheels = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "oepyhs2nix"
|
name = "oepyhs2nix"
|
||||||
version = "0.1.0"
|
version = "0.1.1"
|
||||||
source = { virtual = "." }
|
source = { virtual = "." }
|
||||||
dependencies = [
|
dependencies = [
|
||||||
{ name = "matplotlib" },
|
{ name = "matplotlib" },
|
||||||
|
|||||||
Reference in New Issue
Block a user