-
Notifications
You must be signed in to change notification settings - Fork 23
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
[Bug]: Conversion from Intan ephys - electrode positions not present in NWB file #634
Comments
@alejoe91 is suggesting to try intan_interface.recording_extractor.set_probe(probe, in_place=True) Note: |
@CodyCBakerPhD @bendichter if this turns out to work (I'm 99.8% sure about it), we should add a page on Neuroconv docs to show how to properly add a |
Yes it seems to have worked... thanks @CodyCBakerPhD and @alejoe91 I'm happy to help with the docs too once you decide where that should go. |
I'd recommend a full-fledged (working) tutorial in the user guide with small note as a reminder on each gallery (not in the code, because then it won't be checked or linked but just outside of the code snippet) |
Digging deeper into the NWB file, there's something strange with the 'group' column in the electrodes table. They're using a probeinterface probe that was created from a dataframe with 7 columns... none of them are group... but one is shank_id which takes the values 0, 1, 2, 3. So they have four 32-channel shanks. Do you have any idea where the group And there's also a group_name column with every entry 'A'. Not sure where that's coming from either. |
Following up here for future reference... Alessio said we should use |
Moving this to #635 since the 'bug' part has been resolved and the bigger issue is lack of documentation |
Unfortunately, the group_mode="by_shank" did not do the trick. @CodyCBakerPhD @alejoe91 should I open a separate issue for this? Here's what they are doing
And the resulting table in the NWB file uploaded to DANDI, as viewed by Neurosift: Notice the weird pattern in the group column. The shank IDs are 0, 1, 2, 3 |
@magland to be clear, there seem to be two things doing on here
|
Also if you want to override the 'location' field on the NWB table, I believe SI annotates that as the 'brain_area' property, so just be sure to set that appropriately (or can it be included on the probe spreadsheet too?) |
Thanks for that... although I'm pretty confused since I'm not used to thinking in terms of group, shank, probe, port, etc. In the end we somehow need the NwbRecordingExtractor to have a group property that corresponds to the shank_id provided by the lab. Because then we can do spike sorting by shank. I'm not sure how to get there. |
In NWB Probe = port nomenclature only comes in w.r.t. reading from certain formats that denote such in their metadata The 'shank_id' here is SI nomenclature for how probes/recording extractors store things in their API, but what matters is the SI |
Thanks @CodyCBakerPhD for the explanations. Also, you are right about the group column in Neurosift - the periodicity of 8 is just from 8 bytes per pointer - and neurosift somehow was displaying as a byte array. I saw this code in the IntanRecordingInterface neuroconv/src/neuroconv/datainterfaces/ecephys/intan/intandatainterface.py Lines 121 to 132 in 283c374
which means that it's looking for the group_name property on the recording extractor. @alejoe91 I need help figuring out why this is apparently not set properly on the recording extractor after the |
@CodyCBakerPhD we found the issue: the The immediate solution would be to overwrite the
But this is probably not what we want an end user to do :) Other better solutions:
Option 2 will also make the API for adding a probe more direct, from
What do you guys think? |
Yes, I believe the I've not checked to see if modern group names have improved, in which case we can get rid of the workaround To get the immediate conversion working, I'd recommend either
Long term, having one or two lines in the pinging @h-mayorquin on this since they might remember more (or be fresher in their minds) - they were the most recent to touch that code in 92af17b |
I believe this was fixed by your slew of PRs at the time, correct @magland? |
Yes, I duble checked and the code discussed is already there:
There is still the fact that the problem occurs when someone uses our tools.spikeinterface function but let me open another issue for that. |
Closing this as the remaining issue can be addressed in #932 |
What happened?
We used the recommended script to convert Intan ephys data to NWB file. As part of the conversion we set the probe information using the following.
The resulting NWB does not have
rel_x
andrel_y
columns in the the general/extracellular_ephys/electrodes table. There is a locations column, but it is filled with ['unknown', 'unknown', ...].@oghenand Could you please provide the probe.csv file? @CodyCBakerPhD was requesting to see this.
Steps to Reproduce
# See above
Traceback
No response
Operating System
Windows
Python Executable
Conda
Python Version
3.7
Package Versions
This screenshot shows that the probe_df has x and y columns.
Code of Conduct
The text was updated successfully, but these errors were encountered: