Time alignment
This PR implements time alignment.
@CodyCBakerPhD Would be great to get your help on a few final things:
- Can you point me to an example for setting up a Dummy Recording for a sorting interface so that we can simply set timestamps / starting time?
- The current iteration isn't properly setting timestamps on the preview conversion. Is there a reason this is happening?
Besides the above caveats, this is properly updating the time alignment information and requesting it back on the Source Data popup.
Can you point me to an example for setting up a Dummy Recording for a sorting interface so that we can simply set timestamps / starting time?
Not a 'dummy' example, but a proper test case from example data: https://github.com/catalystneuro/neuroconv/blob/179711773fc67a2a733ebc6522afa0bea6f2f305/tests/test_on_data/test_sorting_interfaces.py#L29-L33
https://github.com/catalystneuro/neuroconv/blob/179711773fc67a2a733ebc6522afa0bea6f2f305/src/neuroconv/tools/testing/data_interface_mixins.py#L586-L589
Easy way to truly do a 'dummy' one is the use the official Mock one: https://github.com/catalystneuro/neuroconv/blob/179711773fc67a2a733ebc6522afa0bea6f2f305/tests/test_ecephys/test_ecephys_interfaces.py#L127-L131
The current iteration isn't properly setting timestamps on the preview conversion. Is there a reason this is happening?
I'll look into it
And just to confirm, we actually do want to allow users to specify timestamps or a start time for Sorting Interfaces, independent of any active Recording Interfaces?
Mentioned this to Ben at the developer hackathon and he was a bit confused about what this actually would mean.
If the exact recording interface used to generate the sorting is present in the pipeline, then they should link the sorting to the recording and adjust timestamps or shift starting time of the recording
Otherwise, they still need to be able to set timestamps and shift starting time as if they had chosen to include the original recording
Ah gotcha. Makes sense now
So this is practically ready for review.
Now that I've expanded my tests beyond the SpikeGLX-Phy test case, though, I've realized that the Phy Sorting Interface in the tutorial data seems to be locked to the SpikeGLX Recording Interface regardless of any user-defined parameters. Is this an expected behavior?
This was the previous behavior before https://github.com/catalystneuro/neuroconv/pull/823—though an error was thrown about the None and int addition. If providing a mock recording interface, the specified start time would take effect but it wasn't clear what it was shifting.
Also confirmed that this time offset on the Recording Interface does not show up in stub files but can be seen from Neurosift after a full conversion.
@garrettmflynn I don't see the link recording button on my end
This is by design. I've implemented a check that determines what interfaces are compatible with a given SortingInterface before display, ensuring that users only select valid options.
It's possible to disable the option—possibly with a related message on hover—instead of removing it completely. Would that be preferable?
This is by design. I've implemented a check that determines what interfaces are compatible with a given SortingInterface before display, ensuring that users only select valid options.
Ahh, right you are - silly me I was using a nonsensible pipeline
That part is working as intended then
A couple things I noticed testing this
i) the option of linking between compatible sorting and recording is now failing for the tutorial data (no button shows up)
ii) I set timestamps for Suite2p (single plane; 250 frames); they seem to have 'uploaded' to the interface fine because the alignment bar did say the proper start and stop interval according to the timestamps; but then they do not show up even in the final converted file
iii) Nothing seems to be applying to stub mode, I'm investigating that one myself
Updated so that (i) works! Can you try again? Would be interested to get the file you're using too so I can replicate.
- When I do (i), I am getting an error during the conversion—but I can successfully associate the two.
Just FYI I was able to use the Suite2P test pipeline and align to an arbitrary start time, which I could observe across stub and full conversions.
FYI the issue I had with timestamps was a non-issue; the timestamps vector I was trying to set was regular, and NeuroConv magic automatically detected that and set to a regular rate. There's ongoing discussions over there about whether that should even happen at all though
Also confirmed the issue with the recording interfaces in stub mode is on the NeuroConv side; will push a fix for that in the future so shouldn't hold up this PR