You can find the channel locations using the following code
from one.api import ONE
from iblatlas.atlas import AllenAtlas, Insertion
from brainbox.io.one import SpikeSortingLoader
one = ONE(base_url='https://openalyx.internationalbrainlab.org')
ba = AllenAtlas()
pid = 'decc8d40-cf74-4263-ae9d-a0cc68b47e86'
# Load in the channels
ssl = SpikeSortingLoader(pid=pid, one=one, atlas=ba)
channels = ssl.load_channels()
# Coordinates of each channel in 3D space relative to Bregma
xyz = np.c_[channels['x'], channels['y'], channels['z']]
# From the channels we can compute an insertion object
ins = Insertion.from_track(xyz, brain_atlas=ba)
# The entry point of this insertion object on the surface of the cortex is given by
entry = ins.entry
You could then compute the depth or euclidean distance of each channel relative to this entry point, does this get out what you need?
I apologize I’m a statistician not an experimentalist, I’ve never actually had to insert a neuropixels probe so computing this is not something I am familiar with. It’s not clear how I could take your dv coordinates and compute a cortical depth measure from them. Is it as simple as just multiplying the entry array in my case …array([-0.003514, -0.002875, -0.000668]) element wise with the IBL convention coordinates for each channel?
I looked up the code of the method you used and its not really explained what this is.
Ok so after talking to a colleague, we have reasoned that the xyz array is what I need. I assume these values are in meters and I think z is what we need, the DV axis, because that looks like it spans 3.7mm which would be the length of an active probe, and I can just compute down from the first channel registered to a cortical region.