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

plane_axes ? #271

Open
borrepp opened this issue May 8, 2024 · 5 comments
Open

plane_axes ? #271

borrepp opened this issue May 8, 2024 · 5 comments

Comments

@borrepp
Copy link

borrepp commented May 8, 2024

Hello,
I'm new to the probeInterface project. I'm working on a sorting pipeline using SpikeInterface from an NWB file. I load the file using spikeInterface and get the positions of the electrodes relative to the probe (x, y, z). But, when I set the contacts to create a the probe, I have the following error:

File "m:/Monkey_Python/SI2env/S2_sort_testing/SI_tools.py", line 310, in
locationsProbe = si_recObj.get_property('location')
probeObj.set_contacts(positions=locationsProbe, shapes='circle', shape_params={'radius':probeInfo['radius']})
File "m:\Monkey_Python\SI2env\lib\site-packages\probeinterface\probe.py", line 290, in set_contacts
raise ValueError("For ndim==3, you need to give a 'plane_axes'")
ValueError: For ndim==3, you need to give a 'plane_axes'

I have looked into the Docs, but it is not clear to me what it means the plane_axes variable. Does it have to be always zeros and ones? What is the meaning of [1 0] or [0 1] on each dimension?

For now, I'm creating the following plane_axes for the 3d coordinate system that I get from the NWB:

probe_plane_axes = numpy.zeros((si_recordingObj.get_num_channels(), 2, 3))
probe_plane_axes[:, 0, 0] = 1
probe_plane_axes[:, 1, 1] = 1

Is this the correct way to do it?

Thank you so much in advance for your help.
Best
Pepe

@zm711
Copy link
Contributor

zm711 commented May 9, 2024

This is a great question for @samuelgarcia and @alejoe91 I don't use 3d probes much so I can't help with this one. But maybe we need to add some more docs for this!

@samuelgarcia
Copy link
Member

Hi.
This plane_axes is the vector in which the contact shape is defined.

Is is used when we rotate the probe or <when the probe live in a 3D space (but the contact are still 2d shape (circle, rect or square)

See:

@borrepp
Copy link
Author

borrepp commented May 13, 2024

Thanks, @samuelgarcia and @zm711

I have seen those examples before but I will recheck them more carefully.

Just for clarification, the plane_axes defines a vector for a given contact. Based on its shape (2 by nDim), "plane_axes" consists of two coordinates (points) in the Probe coordinate system (2d or 3d). Does it mean that each point defines a unitary vector (starting from the origin) and the plane formed by these two vectors is where the contact is drawn?

I hope the question makes sense.

Thanks again for your help.

Best
Pepe

@samuelgarcia
Copy link
Member

Does it mean that each point defines a unitary vector (starting from the origin) and the plane formed by these two vectors is where the contact is drawn?

Yes, exactly! Maybe the documentation is missing on this detail. Sorry for that. It was a bit internal but should be more documented.

@borrepp
Copy link
Author

borrepp commented May 15, 2024

Great¡¡

Thank you so much¡

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

No branches or pull requests

3 participants