@@ -797,38 +797,6 @@ def _build_canonical_contact_id(electrode_id: int, shank_id: int | None = None)
797797 return f"e{ electrode_id } "
798798
799799
800- def _contact_id_to_global_electrode_index (contact_id : str , electrodes_per_shank : int ) -> int :
801- """
802- Convert a canonical contact ID back to a global electrode index.
803-
804- This is the inverse of `_build_canonical_contact_id`. For multi-shank probes,
805- the global index is ``shank_id * electrodes_per_shank + local_electrode_id``.
806-
807- This formula works because the neuropixels-pxi plugin assigns electrode indices
808- in left-to-right, bottom-to-top, left-shank-to-right-shank order (confirmed
809- by Josh Siegle). Shank 0 owns indices 0 to electrodes_per_shank-1, shank 1
810- owns the next block, and so on.
811-
812- Parameters
813- ----------
814- contact_id : str
815- Canonical contact ID, e.g. "e123" or "s2e45".
816- electrodes_per_shank : int
817- Number of electrodes per shank (cols_per_shank * rows_per_shank).
818-
819- Returns
820- -------
821- int
822- Global electrode index.
823- """
824- if contact_id .startswith ("s" ):
825- shank_str , elec_str = contact_id .split ("e" )
826- shank_id = int (shank_str [1 :])
827- local_id = int (elec_str )
828- return shank_id * electrodes_per_shank + local_id
829- else :
830- return int (contact_id [1 :])
831-
832800
833801def _parse_imro_string (imro_table_string : str , probe_part_number : str ) -> dict :
834802 """
0 commit comments