diff --git a/src/probeinterface/io.py b/src/probeinterface/io.py index b7b2c167..141f63e3 100644 --- a/src/probeinterface/io.py +++ b/src/probeinterface/io.py @@ -963,7 +963,7 @@ def write_csv(file, probe): ), "x_shift": -11, }, - # Ultra probe + # Ultra probes "1100": { "model_name": "Neuropixels Ultra", "x_pitch": 6, @@ -984,6 +984,26 @@ def write_csv(file, probe): ), "x_shift": -8, }, + "1121": { + "model_name": "Neuropixels Ultra - Type 2", + "x_pitch": 6, + "y_pitch": 3, + "contact_width": 2, + "stagger": 0.0, + "shank_pitch": 0, + "shank_number": 1, + "ncol": 1, + "polygon": polygon_description["default"], + "fields_in_imro_table": ( + "channel_ids", + "banks", + "references", + "ap_gains", + "lf_gains", + "ap_hp_filters", + ), + "x_shift": 18, + }, # NP-Opto "1300": { "model_name": "Neuropixels Opto", @@ -1031,9 +1051,11 @@ def write_csv(file, probe): "NP2003": "2003", "NP2004": "2004", "PRB2_1_2_0640_0": "21", + "PRB2_4_2_0640_0": "24", # Other probes "NP1100": "1100", # Ultra probe - 1 bank "NP1110": "1100", # Ultra probe - 16 banks + "NP1121": "1121", # Ultra probe - beta configuration "NP1300": "1300", # Opto probe } @@ -1538,7 +1560,11 @@ def read_openephys( "ptype": ptype, } # Sequentially assign probe names - np_probe_dict.update({"name": probe_names_used[probe_idx]}) + if "custom_probe_name" in np_probe.attrib and np_probe.attrib["custom_probe_name"] != probe_serial_number: + name = np_probe.attrib["custom_probe_name"] + else: + name = probe_names_used[probe_idx] + np_probe_dict.update({"name": name}) np_probes_info.append(np_probe_dict) # now select correct probe (if multiple) diff --git a/tests/data/openephys/OE_Neuropix-PXI-NP-Ultra/settings.xml b/tests/data/openephys/OE_Neuropix-PXI-NP-Ultra/settings.xml new file mode 100644 index 00000000..7f98dbab --- /dev/null +++ b/tests/data/openephys/OE_Neuropix-PXI-NP-Ultra/settings.xml @@ -0,0 +1,1156 @@ + + + + + 0.6.6 + 8 + 8 Nov 2023 8:51:06 + Windows 10 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + diff --git a/tests/test_io/test_openephys.py b/tests/test_io/test_openephys.py index 761ff21a..20e58e6e 100644 --- a/tests/test_io/test_openephys.py +++ b/tests/test_io/test_openephys.py @@ -24,6 +24,44 @@ def test_NP2_four_shank(): assert "2.0 - Four Shank" in probe.model_name +def test_NP_Ultra(): + # This dataset has 4 NP-Ultra probes (3 type 1, 1 type 2) + probeA = read_openephys( + data_path / "OE_Neuropix-PXI-NP-Ultra" / "settings.xml", + probe_name="ProbeA", + ) + assert "Ultra" in probeA.model_name + assert probeA.get_shank_count() == 1 + assert probeA.get_contact_count() == 384 + + probeB = read_openephys( + data_path / "OE_Neuropix-PXI-NP-Ultra" / "settings.xml", + probe_name="ProbeB", + ) + assert "Ultra" in probeB.model_name + assert probeB.get_shank_count() == 1 + assert probeB.get_contact_count() == 384 + + probeF = read_openephys( + data_path / "OE_Neuropix-PXI-NP-Ultra" / "settings.xml", + probe_name="ProbeF", + ) + assert "Ultra" in probeF.model_name + assert probeF.get_shank_count() == 1 + assert probeF.get_contact_count() == 384 + + probeD = read_openephys( + data_path / "OE_Neuropix-PXI-NP-Ultra" / "settings.xml", + probe_name="ProbeD", + ) + assert "Ultra" in probeD.model_name and "Type 2" in probeD.model_name + assert probeD.get_shank_count() == 1 + assert probeD.get_contact_count() == 384 + # for this probe model, all channels are aligned + assert len(np.unique(probeD.contact_positions[:, 0])) == 1 + + + def test_NP1_subset(): # NP1 - 200 channels selected by recording_state in Record Node probe_ap = read_openephys( @@ -126,4 +164,4 @@ def test_older_than_06_format(): if __name__ == "__main__": # test_multiple_probes() - test_older_than_06_format() + test_NP_Ultra()