Skip to content

Commit ddc3b94

Browse files
author
Thinh Nguyen
committed
add neuropixels UHD probe type
1 parent 58b5984 commit ddc3b94

File tree

1 file changed

+33
-49
lines changed

1 file changed

+33
-49
lines changed

element_array_ephys/probe.py

Lines changed: 33 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def activate(schema_name, *, create_schema=True, create_tables=True):
1818
schema.activate(schema_name, create_schema=create_schema, create_tables=create_tables)
1919

2020
# Add neuropixels probes
21-
for probe_type in ('neuropixels 1.0 - 3A', 'neuropixels 1.0 - 3B',
21+
for probe_type in ('neuropixels 1.0 - 3A', 'neuropixels 1.0 - 3B', 'neuropixels UHD',
2222
'neuropixels 2.0 - SS', 'neuropixels 2.0 - MS'):
2323
ProbeType.create_neuropixels_probe(probe_type)
2424

@@ -46,15 +46,38 @@ class Electrode(dj.Part):
4646
def create_neuropixels_probe(probe_type='neuropixels 1.0 - 3A'):
4747
"""
4848
Create `ProbeType` and `Electrode` for neuropixels probes:
49-
1.0 (3A and 3B), 2.0 (SS and MS)
49+
+ neuropixels 1.0 - 3A
50+
+ neuropixels 1.0 - 3B
51+
+ neuropixels UHD
52+
+ neuropixels 2.0 - SS
53+
+ neuropixels 2.0 - MS
54+
5055
For electrode location, the (0, 0) is the
5156
bottom left corner of the probe (ignore the tip portion)
5257
Electrode numbering is 1-indexing
5358
"""
5459

60+
neuropixels_probes_config = {
61+
'neuropixels 1.0 - 3A': dict(site_count=960, col_spacing=32, row_spacing=20,
62+
white_spacing=16, col_count=2,
63+
shank_count=1, shank_spacing=0),
64+
'neuropixels 1.0 - 3B': dict(site_count=960, col_spacing=32, row_spacing=20,
65+
white_spacing=16, col_count=2,
66+
shank_count=1, shank_spacing=0),
67+
'neuropixels UHD': dict(site_count=384, col_spacing=6, row_spacing=6,
68+
white_spacing=0, col_count=8,
69+
shank_count=1, shank_spacing=0),
70+
'neuropixels 2.0 - SS': dict(site_count=1280, col_spacing=32, row_spacing=15,
71+
white_spacing=0, col_count=2,
72+
shank_count=1, shank_spacing=250),
73+
'neuropixels 2.0 - MS': dict(site_count=1280, col_spacing=32, row_spacing=15,
74+
white_spacing=0, col_count=2,
75+
shank_count=4, shank_spacing=250)
76+
}
77+
5578
def build_electrodes(site_count, col_spacing, row_spacing,
56-
white_spacing, col_count=2,
57-
shank_count=1, shank_spacing=250):
79+
white_spacing, col_count,
80+
shank_count, shank_spacing):
5881
"""
5982
:param site_count: site count per shank
6083
:param col_spacing: (um) horrizontal spacing between sites
@@ -88,51 +111,12 @@ def build_electrodes(site_count, col_spacing, row_spacing,
88111

89112
return npx_electrodes
90113

91-
# ---- 1.0 3A ----
92-
if probe_type == 'neuropixels 1.0 - 3A':
93-
electrodes = build_electrodes(site_count=960, col_spacing=32, row_spacing=20,
94-
white_spacing=16, col_count=2)
95-
96-
probe_type = {'probe_type': 'neuropixels 1.0 - 3A'}
97-
with ProbeType.connection.transaction:
98-
ProbeType.insert1(probe_type, skip_duplicates=True)
99-
ProbeType.Electrode.insert([{**probe_type, **e} for e in electrodes],
100-
skip_duplicates=True)
101-
102-
# ---- 1.0 3B ----
103-
if probe_type == 'neuropixels 1.0 - 3B':
104-
electrodes = build_electrodes(site_count=960, col_spacing=32, row_spacing=20,
105-
white_spacing=16, col_count=2)
106-
107-
probe_type = {'probe_type': 'neuropixels 1.0 - 3B'}
108-
with ProbeType.connection.transaction:
109-
ProbeType.insert1(probe_type, skip_duplicates=True)
110-
ProbeType.Electrode.insert([{**probe_type, **e} for e in electrodes],
111-
skip_duplicates=True)
112-
113-
# ---- 2.0 Single shank ----
114-
if probe_type == 'neuropixels 2.0 - SS':
115-
electrodes = build_electrodes(site_count=1280, col_spacing=32, row_spacing=15,
116-
white_spacing=0, col_count=2,
117-
shank_count=1, shank_spacing=250)
118-
119-
probe_type = {'probe_type': 'neuropixels 2.0 - SS'}
120-
with ProbeType.connection.transaction:
121-
ProbeType.insert1(probe_type, skip_duplicates=True)
122-
ProbeType.Electrode.insert([{**probe_type, **e} for e in electrodes],
123-
skip_duplicates=True)
124-
125-
# ---- 2.0 Multi shank ----
126-
if probe_type == 'neuropixels 2.0 - MS':
127-
electrodes = build_electrodes(site_count=1280, col_spacing=32, row_spacing=15,
128-
white_spacing=0, col_count=2,
129-
shank_count=4, shank_spacing=250)
130-
131-
probe_type = {'probe_type': 'neuropixels 2.0 - MS'}
132-
with ProbeType.connection.transaction:
133-
ProbeType.insert1(probe_type, skip_duplicates=True)
134-
ProbeType.Electrode.insert([{**probe_type, **e} for e in electrodes],
135-
skip_duplicates=True)
114+
electrodes = build_electrodes(**neuropixels_probes_config[probe_type])
115+
probe_type = {'probe_type': probe_type}
116+
with ProbeType.connection.transaction:
117+
ProbeType.insert1(probe_type, skip_duplicates=True)
118+
ProbeType.Electrode.insert([{**probe_type, **e} for e in electrodes],
119+
skip_duplicates=True)
136120

137121

138122
@schema

0 commit comments

Comments
 (0)