Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

read_probeinterface() does not read in device_channel_indices #194

Open
ThetaS opened this issue Jun 8, 2023 · 8 comments
Open

read_probeinterface() does not read in device_channel_indices #194

ThetaS opened this issue Jun 8, 2023 · 8 comments
Labels
question Further information is requested

Comments

@ThetaS
Copy link

ThetaS commented Jun 8, 2023

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,

@samuelgarcia
Copy link
Member

Hi @ThetaS.
Can you share the piece of code to generate the probe + the dataframe + the json file ?

@ThetaS
Copy link
Author

ThetaS commented Jun 12, 2023

Thanks for the response and sorry for the delay! Sure, here are the code snippets:
image

This is the calling from my analysis code:
image

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

128ANbottom_map.zip

@ThetaS
Copy link
Author

ThetaS commented Jun 12, 2023

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

@samuelgarcia
Copy link
Member

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

@ThetaS
Copy link
Author

ThetaS commented Jun 15, 2023

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.

@samuelgarcia
Copy link
Member

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.

@ThetaS
Copy link
Author

ThetaS commented Jun 17, 2023

Yes, I tried deleting the plane_axes parameter and the plotting works. But the previous question, I tried the keyword "device_channel_indices" and zero-based my indices and it failed to work.

image
image
image

The save part is the same as above, key modifications are shown in the images.

@alejoe91 alejoe91 added the question Further information is requested label Aug 23, 2023
@alejoe91
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants