Closed b-grimaud closed 9 months ago
Indeed, the parameters set in the probe differ. It's been the plan for some time to only use SpikeImterface objects, but progress has been a bit slow to implement this. Do you think you can adjust the parameters to get the same behaviour? I'll take a closer look asap!
I have already tried passing the arguments with Probe = hs.probe.RecordingExtractor(recording,noise_amp_percent=1,inner_radius=1.75,neighbor_radius=None, masked_channels=[0])
, but the max_neighbors
property remains different because BioCam
uses preset file for its neighbors matrix, while RecordingExtractor
generates a new file on the go that is very different from the base BioCam neighbors matrix (see attached file here).
I compared results from the same file, using the same parameters, with the only difference being that one is loaded through Probe = BioCam(file_path)
and the other through SpikeInterface's read_biocam
, as recording = read_biocam(file_path)
then Probe = hs.probe.RecordingExtractor(recording)
.
Sorting and clustering are then performed with the exact same parameters.
The first obvious difference is when using H.PlotTracesChannel
:
Through HS :
Through SI :
Then, with H.PlotAll
:
Through HS :
Through SI :
The main difference is that it's rotated and mirrored, but there's also slightly fewer spikes detected : 59742 spikes through HS and 60990 spikes through SI. Again, all of the detection parameters are exactly the same, the only difference is the Probe
object.
This is also the case after clustering, with C.PlotAll
:
Through HS :
Through SI :
The axis labels are also incorrect when going through SI's reader.
From what I can tell, it seems to stem from BioCam
Probe
objects getting their positions and neighbours coordinates from positions_biocam
and neighbormatrix_biocam
, respectively, while the RecordingExtractor
Probe
object uses positions_spikeextractor
and neighbormatrix_spikeextractor
, which seem quite different.
@mhhennig Is there a reason why those objects need to use different coordinate files ?
See #70
Hi, I'm trying to run Herding Spikes on an object that is then compatible with SpikeInterface and/or Neo objects. Ideally, I would be able to have the flexibility of using standalone Herding Spikes while still being able to interact with a SpikeInterface pipeline.
My issue was intially detailed here.
Essentially, running
HSDetection
on the same file with the same parameters results in different outputs depending on wether I use HS2'sBioCam
object or SI'sread_biocam
then feed it throughhs.probe.RecordingExtractor
, as illustrated here.It seems to boil down to
BioCam
andRecordingExtractor
having different default parameters forinner_radius
,neighbor_radius
andmasked_channels
, and using different files for position and neighbor coordinates.As detailed here, the
neighbormatrix_spikeextractor
generated when usingRecordingExtractor
is very different from the defaultneighbormatrix_biocam
used withBioCam
, and as a result themax_neighbors
property is different.From what I've been able to understand, it might be caused by how channel positions are obtained here.