Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 31 additions & 17 deletions src/probeinterface/neuropixels_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,21 +145,29 @@ def make_mux_table_array(mux_information) -> np.array:

def get_probe_contour_vertices(shank_width, tip_length, probe_length) -> list:
"""
Function to get the vertices of the probe contour from probe properties. The probe contour can be constructed
from five points. These are the vertices shown in the following figure:

A | | E
| |
.
.
.
| |
B | | D
\\ /
\\/
C

This function returns the points indicated in the diagram above in a list [A,B,C,D,E].
Function to get the vertices of the probe contour from probe properties.
The probe contour can be constructed from five points.

These are the vertices shown in the following figure:

Top of probe (y = probe_length)
A +-------------------------------+ E
| |
| |
| Shank body |
| (shank_width) |
| |
| |
B +-------------------------------+ D (y = 0)
\ /
\ Tip region /
\ (tip_length) /
\ /
\ /
\ /
+-----------------+ C (y = -tip_length)

This function returns the vertices in the order [A, B, C, D, E] as a list of (x, y) coordinates.

Parameters
----------
Expand All @@ -172,8 +180,14 @@ def get_probe_contour_vertices(shank_width, tip_length, probe_length) -> list:

Returns
-------
polygon_vertices : list
List of five points which make up the probe contour.
polygon_vertices : tuple of tuple
Five vertices as (x, y) coordinate pairs in micrometers, returned in the
order [A, B, C, D, E] corresponding to the diagram above:
A = (0, probe_length) - top-left corner
B = (0, 0) - bottom-left corner at shank base
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not exactly tru. This 0, 0 is the bottom, left contact center no ?

Copy link
Member

@chrishalcrow chrishalcrow Oct 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shift the entire probe after we run this function (I can't remember why - probably to make it easier to figure out the probe contour?). See code here:

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @chrishalcrow, maybe we should use a unified frame of reference (x and y axis center) across our code so don't confuse ourselves?

Or ... maybe we should use random generator for the center in every different function and correct on the spot to remind ourselves that everything is relative. Food for thought.

C = (shank_width/2, -tip_length) - tip point (center bottom)
D = (shank_width, 0) - bottom-right corner at shank base
E = (shank_width, probe_length) - top-right corner
"""

# this dict define the contour for one shank (duplicated when several shanks so)
Expand Down