read_probeinterface() does not read in device_channel_indices
Opened this issue · 8 comments
Hello,
I got this problem when attempting to attach a probe read in using read_probeinterface(). Since I have only one probe, I first convert the read in probegroup to dataframe then instantiate a Probe object from dataframe. The .json file was able to retain the device indices I saved but the read in function didn't take this column in as it was not in the dataframe. Is there something I misunderstood and did wrong, or it was a glitch of the function?
Thanks,
Hi @ThetaS.
Can you share the piece of code to generate the probe + the dataframe + the json file ?
Thanks for the response and sorry for the delay! Sure, here are the code snippets:
This is the calling from my analysis code:
I'm working with the UCLA Masmanidis probes and had quite a hard to generate the probe map because they are checkerboard patterned and multi-shank. Hope I didn't miss any shortcuts and solutions for handling this problem.
Thank you very much.
ThetaS
128_ANbottom_map.csv
This is the CSV associated. Basically, the information from the Masmanidis lab's Matlab program and the wiring configuration to Intan 128 headstage.
For the calling part, I tried ndim = 2 and 3, both didn't work.
Best
Hi,
You have device_channel_ids, in probeinterface it should device_channel_indices and it should be starting from 0.
So a zero-based index and not an "id" (identifier).
contact_id = id = str or int = zeros-based orone-based
device_channel_indices = index = zero-based in the python ecosystem
Thank you very much for solving this problem and explain the backend logic! When plotting this probe I'm also a bit confused with the "plane axes" parameter. I don't think the doc explain this concept very well. Suppose my probe is 2D, may I know how this parameter is supposed to be tuned?
Again, thank you very much for the feedback.
The plan axes is a bit more complicated. This is used internally for rotation. And so not so well documentated.
On this example : https://probeinterface.readthedocs.io/en/main/examples/ex_08_more_plotting_examples.html#sphx-glr-examples-ex-08-more-plotting-examples-py
you can see that some some probe are rotated. In that case you should inspect the plane_axes and you will understand how this is used.
By default, you should not use this plan_axes and everything should be OK and with no rotation.
I think the problem is how you're setting the probe in SpikeInterface!
You need to use in_place=True
if you want to modify an existing object. Otherwise the set_probe/probegroup
will return a separate object (see here: https://spikeinterface.readthedocs.io/en/latest/modules/core.html#handling-probes)
Basically you can do:
data.set_probegroup(probe, group_mode="by_shank", in_place=True)
# or
daa_w_probe = data.set_probegroup(probe, group_mode="by_shank")
# then continue with data_w_probe