@@ -723,7 +723,6 @@ def write_csv(file, probe):
723
723
],
724
724
}
725
725
726
- # A map from probe type to geometry_parameters
727
726
# A map from probe type to geometry_parameters
728
727
npx_probe = {
729
728
# Neuropixels 1.0
@@ -778,16 +777,7 @@ def write_csv(file, probe):
778
777
"elec_ids" ,
779
778
),
780
779
},
781
- 'Ultra' : {
782
- "x_pitch" : 6 ,
783
- "y_pitch" : 6 ,
784
- "contact_width" : 5 ,
785
- "stagger" : 0.0 ,
786
- "shank_pitch" : 0 ,
787
- "shank_number" : 1 ,
788
- "ncol" : 8
789
- },
790
- #
780
+ # Experimental probes previous to 1.0
791
781
"Phase3a" : {
792
782
"probe_name" : "Phase3a" ,
793
783
"x_pitch" : 32 ,
@@ -906,6 +896,26 @@ def write_csv(file, probe):
906
896
"ap_hp_filters" ,
907
897
),
908
898
},
899
+ # Ultra probe
900
+ 1100 : {
901
+ "probe_name" : "Ultra probe" ,
902
+ "x_pitch" : 6 ,
903
+ "y_pitch" : 6 ,
904
+ "contact_width" : 5 ,
905
+ "stagger" : 0.0 ,
906
+ "shank_pitch" : 0 ,
907
+ "shank_number" : 1 ,
908
+ "ncol" : 8 ,
909
+ "polygon" : polygon_description ["default" ],
910
+ "fields_in_imro_table" : (
911
+ "channel_ids" ,
912
+ "banks" ,
913
+ "references" ,
914
+ "ap_gains" ,
915
+ "lf_gains" ,
916
+ "ap_hp_filters" ,
917
+ ),
918
+ },
909
919
}
910
920
911
921
def read_imro (file ):
@@ -958,13 +968,13 @@ def _read_imro_string(imro_str: str) -> Probe:
958
968
contact_info [k ].append (v )
959
969
960
970
channel_ids = np .array (contact_info ['channel_ids' ])
961
- if 'elec_ids' in contact_info :
962
- elec_ids = np .array (contact_info ['elec_ids' ])
963
-
964
- if imDatPrb_type == 0 or imDatPrb_type == 'Phase3a' or (imDatPrb_type in (1015 , 1022 , 1030 , 1031 , 1032 )):
965
- # for NP1 and previous the elec_id is not in the list
971
+ probe_types_without_elec_ids_in_their_imro_table = (0 , 1015 , 1022 , 1030 , 1031 , 1032 , "Phase3a" , 1100 )
972
+ if imDatPrb_type in probe_types_without_elec_ids_in_their_imro_table :
966
973
banks = np .array (contact_info ['banks' ])
967
974
elec_ids = banks * 384 + channel_ids
975
+ else :
976
+ elec_ids = np .array (contact_info ['elec_ids' ])
977
+
968
978
969
979
# compute position
970
980
x_idx = elec_ids % probe_information ["ncol" ]
@@ -975,6 +985,7 @@ def _read_imro_string(imro_str: str) -> Probe:
975
985
stagger = np .mod (y_idx + 1 , 2 ) * probe_information ["stagger" ]
976
986
x_pos = x_idx * x_pitch + stagger
977
987
y_pos = y_idx * y_pitch
988
+ positions = np .stack ((x_pos , y_pos ), axis = 1 )
978
989
979
990
if imDatPrb_type == 24 :
980
991
shank_ids = np .array (contact_info ['shank_id' ])
@@ -983,25 +994,25 @@ def _read_imro_string(imro_str: str) -> Probe:
983
994
shank_ids = None
984
995
contact_ids = [f'e{ elec_id } ' for elec_id in elec_ids ]
985
996
986
-
987
- positions = np .zeros ((num_contact , 2 ), dtype = 'float64' )
988
- positions [:, 0 ] = x_pos
989
- positions [:, 1 ] = y_pos
990
-
991
997
# construct Probe object
992
998
probe = Probe (ndim = 2 , si_units = 'um' )
993
- probe .set_contacts (positions = positions , shapes = 'square' ,
994
- shank_ids = shank_ids ,
995
- shape_params = {'width' : probe_information ["contact_width" ]})
999
+ probe .set_contacts (
1000
+ positions = positions ,
1001
+ shapes = "square" ,
1002
+ shank_ids = shank_ids ,
1003
+ shape_params = {"width" : probe_information ["contact_width" ]},
1004
+ )
1005
+
996
1006
probe .set_contact_ids (contact_ids )
997
1007
998
1008
# Add planar contour
999
1009
polygon = np .array (probe_information ["polygon" ])
1000
1010
contour = []
1011
+ shank_pitch = probe_information ["shank_pitch" ]
1001
1012
for shank_id in range (probe_information ["shank_number" ]):
1002
- shift = [probe_information [ " shank_pitch" ] * shank_id , 0 ]
1013
+ shift = [shank_pitch * shank_id , 0 ]
1003
1014
contour += list (polygon + shift )
1004
-
1015
+
1005
1016
# shift
1006
1017
contour = np .array (contour ) - [11 , 11 ]
1007
1018
probe .set_planar_contour (contour )
@@ -1330,7 +1341,7 @@ def read_openephys(
1330
1341
ptype = 0
1331
1342
x_shift = - 11
1332
1343
elif "Ultra" in pname :
1333
- ptype = "Ultra"
1344
+ ptype = 1100
1334
1345
x_shift = - 8
1335
1346
else : # Probe type unknown
1336
1347
ptype = None
0 commit comments