@@ -18,7 +18,7 @@ def activate(schema_name, *, create_schema=True, create_tables=True):
18
18
schema .activate (schema_name , create_schema = create_schema , create_tables = create_tables )
19
19
20
20
# 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' ,
22
22
'neuropixels 2.0 - SS' , 'neuropixels 2.0 - MS' ):
23
23
ProbeType .create_neuropixels_probe (probe_type )
24
24
@@ -46,15 +46,38 @@ class Electrode(dj.Part):
46
46
def create_neuropixels_probe (probe_type = 'neuropixels 1.0 - 3A' ):
47
47
"""
48
48
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
+
50
55
For electrode location, the (0, 0) is the
51
56
bottom left corner of the probe (ignore the tip portion)
52
57
Electrode numbering is 1-indexing
53
58
"""
54
59
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
+
55
78
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 ):
58
81
"""
59
82
:param site_count: site count per shank
60
83
:param col_spacing: (um) horrizontal spacing between sites
@@ -66,14 +89,15 @@ def build_electrodes(site_count, col_spacing, row_spacing,
66
89
:return:
67
90
"""
68
91
row_count = int (site_count / col_count )
69
- x_coords = np .tile ([ 0 , 0 + col_spacing ] , row_count )
70
- x_white_spaces = np .tile ([ white_spacing , white_spacing , 0 , 0 ], int (row_count / 2 ) )
92
+ x_coords = np .tile (np . arange ( 0 , col_spacing * col_count , col_spacing ) , row_count )
93
+ y_coords = np .repeat ( np . arange (row_count ) * row_spacing , col_count )
71
94
72
- x_coords = x_coords + x_white_spaces
73
- y_coords = np .repeat (np .arange (row_count ) * row_spacing , 2 )
95
+ if white_spacing :
96
+ x_white_spaces = np .tile ([white_spacing , white_spacing , 0 , 0 ], int (row_count / 2 ))
97
+ x_coords = x_coords + x_white_spaces
74
98
75
- shank_cols = np .tile ([ 0 , 1 ] , row_count )
76
- shank_rows = np .repeat (range (row_count ), 2 )
99
+ shank_cols = np .tile (range ( col_count ) , row_count )
100
+ shank_rows = np .repeat (range (row_count ), col_count )
77
101
78
102
npx_electrodes = []
79
103
for shank_no in range (shank_count ):
@@ -88,51 +112,12 @@ def build_electrodes(site_count, col_spacing, row_spacing,
88
112
89
113
return npx_electrodes
90
114
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 )
115
+ electrodes = build_electrodes (** neuropixels_probes_config [probe_type ])
116
+ probe_type = {'probe_type' : probe_type }
117
+ with ProbeType .connection .transaction :
118
+ ProbeType .insert1 (probe_type , skip_duplicates = True )
119
+ ProbeType .Electrode .insert ([{** probe_type , ** e } for e in electrodes ],
120
+ skip_duplicates = True )
136
121
137
122
138
123
@schema
0 commit comments