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

Spike location with true channel #1950

Merged

Conversation

samuelgarcia
Copy link
Member

@alejoe91 @yger : there are some question in the code for you

@yger: can you test this for the localization benchmark ?

@yger
Copy link
Collaborator

yger commented Sep 1, 2023

I'll test asap.

params = self._params.copy()
channel_from_template = params.pop("channel_from_template")

# @alessio @pierre: where do we expose the parameters of radius for the retriever (this is not the same as the one for locatization it is smaller) ???
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would expose it in the compute_spike_location function, otherwise this has no sense. In addition, to ensure comparison with/witout this extra mecanism, we should make sure that if radius_um is set to 0, a classical PeakRetriever is used here

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PeakRetriever will be not used here this is postprocessing.

params.update(**method_kwargs)
print(params)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the print here

Comment on lines 173 to 176
self.channel_from_template = channel_from_template

assert extremum_channel_inds is not None, "SpikeRetriever need the dict extremum_channel_inds"

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the SpikeRetriever is not internally, automatically, getting the extremum_channel_inds? This seems like a useless argument no? You have use cases where users would like to provide their own extremum channels?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no the instanciation has to be fast because it duplicate on several process this is external when building the node graph

src/spikeinterface/core/node_pipeline.py Outdated Show resolved Hide resolved
@@ -95,12 +116,16 @@ def get_extension_function():

WaveformExtractor.register_extension(SpikeLocationsCalculator)

# @alessio @pierre: channel_from_template=True is the old behavior but this is not accurate
# what do we put by default ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would go for the new behavior as a default, but we need to think on the impact with the metrics

channel_from_template=channel_from_template,
extremum_channel_inds=extremum_channel_inds,
radius_um=50,
peak_sign=self._params.get("peaks_sign", "neg"),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This neg should not be hardcoded, and peak_sign should be an argument of compute_spike_locations

@alejoe91 alejoe91 added the postprocessing Related to postprocessing module label Sep 1, 2023
@yger
Copy link
Collaborator

yger commented Sep 1, 2023

We need to provide a value for peaks['amplitudes'], otherwise some localizaiotn methods are not working. I propose to add
local_peaks["amplitude"][i] = traces[peak["sample_index"], local_peaks[i]["channel_index"]] L 220 in spike_locations.py

…arcia/spikeinterface into spike_location_with_true_channel
@yger
Copy link
Collaborator

yger commented Oct 16, 2023

@samuelgarcia can we proceed with this PR such that I can wrap up our next paper ?

@samuelgarcia
Copy link
Member Author

@yger : I made some update on this. Can you test this ?

@yger
Copy link
Collaborator

yger commented Oct 25, 2023

@samuelgarcia some tests are still failing, waiting for merging

Copy link
Member

@alejoe91 alejoe91 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix tests

@samuelgarcia
Copy link
Member Author

@alejoe91 I did a fix.

@alejoe91 alejoe91 added this to the 0.99.0 milestone Oct 26, 2023
@alejoe91 alejoe91 merged commit ef095c2 into SpikeInterface:main Oct 26, 2023
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
postprocessing Related to postprocessing module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants