You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Issue with setting probe groups when processing Intan electrophysiological data using spikeinterface #3777
Problem: When reading Intan electrophysiological data using spikeinterface, I noticed that the channel_ids are not integers but strings like 'A-001', 'A-002', etc. This causes an issue when trying to link channels to probes via the set_device_channel_indices function, which expects integer indices. How can I resolve this mismatch?
importmatplotlib.pyplotaspltfrompprintimportpprintfrompathlibimportPathimportnumpyasnpimportspikeinterface.fullassiglobal_job_kwargs=dict(n_jobs=4, chunk_duration="1s")
si.set_global_job_kwargs(**global_job_kwargs)
data_path=Path("D:/students/WWX/SpikeDataComparison/KD20250222/KD20250222_WWX009_250222_175030/KD20250222_WWX009_250222_175230.rhd")
# intan amplifier data is stored in stream_id = '0'recording=si.read_intan(data_path, stream_id='0',all_annotations=True,use_names_as_ids=True)
# recording = si.read_binary(data_path,sampling_frequency=20000,num_channels=16,dtype='int16')print(recording)
device_channel_indices are indeed integers, representing the index of the trace corresponding to a certain contact. This is totally independent of the channel_ids, which can be either int or strings.
Thank you for clarifying this! 🙌 I appreciate your help. However,I am attempting to split channels into four groups via set_probegroup, but the channels remain grouped as a single group. Here is the code.
For me this another argument for getting rid of any reference to in_place, and ideally change the terminology from set which is too loaded a term. But I guess we never settled on a better term for attaching without making it sound like it is inplace. Probes are the only place where sometimes things are set in place and sometimes they return an object which makes things confusing for end users.
Thank you so much for pointing this out! This resolved my issue, and I can now confirm that recording.get_channel_groups() correctly returns four distinct groups.
For me this another argument for getting rid of any reference to in_place, and ideally change the terminology from set which is too loaded a term. But I guess we never settled on a better term for attaching without making it sound like it is inplace. Probes are the only place where sometimes things are set in place and sometimes they return an object which makes things confusing for end users.
I fully agree with your observation about the terminology being potentially confusing. As a user, the difference between "set"and methods returning a new object was not immediately clear.
Activity
alejoe91 commentedon Mar 17, 2025
Hi @cuowunimei
device_channel_indicesare indeed integers, representing the index of the trace corresponding to a certain contact. This is totally independent of thechannel_ids, which can be either int or strings.cuowunimei commentedon Mar 17, 2025
Thank you for clarifying this! 🙌 I appreciate your help. However,I am attempting to split channels into four groups via set_probegroup, but the channels remain grouped as a single group. Here is the code.
alejoe91 commentedon Mar 17, 2025
The
set_probegroupreturns a new object.zm711 commentedon Mar 17, 2025
For me this another argument for getting rid of any reference to
in_place, and ideally change the terminology fromsetwhich is too loaded a term. But I guess we never settled on a better term for attaching without making it sound like it is inplace. Probes are the only place where sometimes things are set in place and sometimes they return an object which makes things confusing for end users.cuowunimei commentedon Mar 18, 2025
Thank you so much for pointing this out! This resolved my issue, and I can now confirm that recording.get_channel_groups() correctly returns four distinct groups.
I fully agree with your observation about the terminology being potentially confusing. As a user, the difference between "set"and methods returning a new object was not immediately clear.