Skip to content

Commit f55a6a7

Browse files
author
Thinh Nguyen
committed
bugfix in electrode sites design for Neuropixels UHD probe
1 parent db3027b commit f55a6a7

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

element_array_ephys/probe.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,15 @@ def build_electrodes(site_count, col_spacing, row_spacing,
8989
:return:
9090
"""
9191
row_count = int(site_count / col_count)
92-
x_coords = np.tile([0, 0 + col_spacing], row_count)
93-
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)
9494

95-
x_coords = x_coords + x_white_spaces
96-
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
9798

98-
shank_cols = np.tile([0, 1], row_count)
99-
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)
100101

101102
npx_electrodes = []
102103
for shank_no in range(shank_count):

0 commit comments

Comments
 (0)