catalystneuro / roiextractors

Python-based module for extracting from, converting between, and handling optical imaging data from several file formats. Inspired by SpikeInterface.
https://roiextractors.readthedocs.io/en/latest/index.html
BSD 3-Clause "New" or "Revised" License
11 stars 7 forks source link

Unify terminology for frames in `frame_to_time` and `get_frame`. #202

Open h-mayorquin opened 2 years ago

h-mayorquin commented 2 years ago

Right now we have frames on the functions for getting time: https://github.com/catalystneuro/roiextractors/blob/master/src/roiextractors/imagingextractor.py#L69

And frame_idxs in the function for getting the frames: https://github.com/catalystneuro/roiextractors/blob/b71f17db4d3dadeaa4ae02c806c1e269f03d3d9b/src/roiextractors/imagingextractor.py#L62-L68 But both of them are referring to the same. We should use either frames, frame_idxs or frame_indices for the two of them. Numpy uses indices for their indexing routines so maybe that's a good choice: https://numpy.org/doc/stable/reference/arrays.indexing.html#routines-indexing

But I don't think it matters that much.

CodyCBakerPhD commented 2 years ago

I'd vote for frames

CodyCBakerPhD commented 2 years ago

Although, specific to the usage in frame_to_time, how badly do we want to mimic SpikeInterface and plan to eventually just have a single get_times function that either uses an underlying irregular time_vector or otherwise returns a np.arange scaled by the sampling frequency and shifted by an offset?

https://github.com/SpikeInterface/spikeinterface/blob/master/spikeinterface/core/baserecording.py#L441-L452

h-mayorquin commented 2 years ago

Yeah, maybe going for get_times for consistency is better overall.