66import numpy as np
77import matplotlib .pyplot as plt
88
9- from probeinterface .neuropixels_tools import _make_npx_probe_from_description , get_probe_metadata_from_probe_features
9+ from probeinterface .neuropixels_tools import build_neuropixels_probe
1010from probeinterface .plotting import plot_probe
1111from probeinterface import write_probeinterface
1212
@@ -28,6 +28,8 @@ def generate_all_npx(base_folder=None):
2828 probe_part_numbers = probe_features ['neuropixels_probes' ].keys ()
2929
3030
31+ # Note: model_name here is the probe_part_number (specific SKU like "NP1000"),
32+ # NOT the model/platform (like "Neuropixels 1.0", "Neuropixels 2.0", "Ultra", or "NHP")
3133 for model_name in probe_part_numbers :
3234 print (model_name )
3335
@@ -41,18 +43,8 @@ def generate_all_npx(base_folder=None):
4143 probe_folder = base_folder / model_name
4244 probe_folder .mkdir (exist_ok = True )
4345
44- pt_metadata , _ , _ = get_probe_metadata_from_probe_features (probe_features , model_name )
45-
46- num_shank = pt_metadata ["num_shanks" ]
47- contact_per_shank = pt_metadata ["cols_per_shank" ] * pt_metadata ["rows_per_shank" ]
48- if num_shank == 1 :
49- elec_ids = np .arange (contact_per_shank )
50- shank_ids = None
51- else :
52- elec_ids = np .concatenate ([np .arange (contact_per_shank ) for i in range (num_shank )])
53- shank_ids = np .concatenate ([np .zeros (contact_per_shank ) + i for i in range (num_shank )])
54-
55- probe = _make_npx_probe_from_description (pt_metadata , model_name , elec_ids , shank_ids )
46+ # Build the full probe with all possible contacts from the probe part number
47+ probe = build_neuropixels_probe (model_name )
5648
5749 # plotting
5850 fig , axs = plt .subplots (ncols = 2 )
@@ -73,7 +65,10 @@ def generate_all_npx(base_folder=None):
7365 plot_probe (probe , ax = ax )
7466 ax .set_title ("" )
7567
76- yp = pt_metadata ["electrode_pitch_vert_um" ]
68+ # Get vertical pitch from contact positions (minimum non-zero y-distance)
69+ positions = probe .contact_positions
70+ y_positions = np .unique (positions [:, 1 ])
71+ yp = np .min (np .diff (y_positions ))
7772 ax .set_ylim (- yp * 8 , yp * 13 )
7873 ax .yaxis .set_visible (False )
7974 ax .spines ["top" ].set_visible (False )
0 commit comments