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

Can we write ImageSeries in external_mode if the timestamps are well specified #472

Open
h-mayorquin opened this issue Jun 7, 2023 · 6 comments
Labels

Comments

@h-mayorquin
Copy link
Collaborator

Right now when external mode is chosen we have the starting frames as a requirement:

if external_mode:
image_series_kwargs = videos_metadata[0]
if self._number_of_files > 1 and starting_frames is None:

That is, for ImageSeries of multiple videos in external mode, we add the requirements of starting_frames. Is this necessary? I can't see any of this specified on pynwb:

https://pynwb.readthedocs.io/en/stable/pynwb.image.html

What is the logic here?
My feeling is that if the timestamps are well specfiied then we should be able to write the ImageSeries.

@CodyCBakerPhD
Copy link
Member

CodyCBakerPhD commented Jun 7, 2023

The timestamps don't tell you the number of frames in each external video file

As far as PyNWB, no I don't think it's a strict requirement, or even technically a best practice just yet, but I think it's a 'highly recommended' strategy

The closest mention we get is in the code https://github.com/NeurodataWithoutBorders/pynwb/blob/a6fa9170f2ad6942d74eaf44c22cedf0b80f0fcd/src/pynwb/image.py#L82-L90

@h-mayorquin
Copy link
Collaborator Author

No, but if you have the timestamps, this should not matter right? As in, you know at what time in your experiment each of the frames in the TimeSeries occured.

@CodyCBakerPhD
Copy link
Member

It's not just about the timing of the frames, it's valuable context about how the shape of the total ImageSeries is distributed across the external files

Example: one very short video and one very long one - nearly contiguous but slightly irregular timestamps - timestamps alone do not tell you exactly which frames of the timestamp vector correspond to which video file

@h-mayorquin
Copy link
Collaborator Author

OK, thanks, I undestand that is very important information.

The logic as I understand it now is that: an external file with wihout information would be very incomplete, so we don't let you, even if you could.

@CodyCBakerPhD
Copy link
Member

The logic as I understand it now is that: an external file with wihout information would be very incomplete, so we don't let you, even if you could.

As I currently understand it

NWB-schema: this is an optional field
PyNWB: we check the field and auto-fill if only a single file - possible plans to warn to specify if using external mode but you can technically skip if you want
NeuroConv/GUIDE: not currently required, but it can be easily grabbed from the external files and set automatically for convenience

@h-mayorquin
Copy link
Collaborator Author

Right, I guess we are moving towards there in #464

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants