spikeinterface icon indicating copy to clipboard operation
spikeinterface copied to clipboard

Is it possible to access original data through preprocesed `BaseRecording` instance

Open rat-h opened this issue 1 year ago • 4 comments

The pipeline

Binary File -> Preprocessing -(1)-> Sorting -(2)-> Wave Extractor -(3)-> Neuron feature assessment. 

The last class gets BaseRecording after (1) and uses get_traces to compute a spike "fingerprint". Unfortunately, preprocessing removes something we are looking for. Would it be possible to get_traces from the original Binary File without reloading it and creating an additional BaseRecording object?

In other words, is there something like that

# preproc is BaseRecording (1)
# which is pointing to the filtered and zeroed data
fingerprint = array([
        preproc.original_data.get_traces(
            start_frame   = sp+frmstart,
            end_frame     = sp+frmend).T
        for sp in sp_train
        ])

rat-h avatar Mar 18 '24 14:03 rat-h

Hi @rat-h

This is something that is not implemented yet, but I agree would be super useful.

What about having a recording/sorting.get_parent()? This could be automatically implemented by all preprocessors/slicing/ etc.

alejoe91 avatar Mar 18 '24 14:03 alejoe91

Sometimes it is several parents!

samuelgarcia avatar Mar 18 '24 15:03 samuelgarcia

@alejoe91 @samuelgarcia That is exactly what I was looking for! Perfect! Thank you :)

rat-h avatar Mar 18 '24 15:03 rat-h

@rat-h this is not implemented yet. Just made a PR!

Note: this only works with parents that are single objects. The concatenate_recordings/aggregate_sortings, etc. will not have this functionality

alejoe91 avatar Mar 21 '24 08:03 alejoe91