the-siesta-group / edfio

Read and write EDF/EDF+ files.
Apache License 2.0
30 stars 4 forks source link

Read only specific time segments? #55

Open cbrnr opened 2 months ago

cbrnr commented 2 months ago

I was wondering if it would be useful to be able to read only specific time segments (as opposed to the entire data), WDYT? This is probably a very niche feature, but I'm bringing it up because if we ever wanted to use edfio as a reader in MNE, then we'd need this functionality (and this would be a separate discussion on its own).

hofaflo commented 2 months ago

I think this would be a good addition! There might need to be different options to handle segment limits which do not coincide with sample times for all signals (in Edf.slice_between_seconds we currently take the easiest way by failing if that is the case). Would you be willing to create a PR for this?

cbrnr commented 2 months ago

I don't have the time to implement this feature currently. It is also not urgent at all, I just wanted to know if you were open to this addition in principle – so thanks, great 👍. If MNE devs decide that it would be worth having edfio replace or supplement their own reader, I can tackle this of course (but feel free to beat me to it if you want/need this feature earlier).

marcoross commented 2 months ago

This would be a nice feature as well if we ever wanted to implement a viewer or read partial data from a network location for machine learning purposes.

jtmiles commented 2 months ago

I also think this would be very helpful! I am sometimes given cumbersome (~100GB) clinical iEEG data files that I only need a small time window and select channels from. Additional slicing functionality would be awesome!

hofaflo commented 1 month ago

As I'm not sure if #58 applies to your use cases @cbrnr and @jtmiles, I'll reopen this for now

cbrnr commented 1 month ago

I think this looks good for now 👍! If there is anything still missing for an MNE reader using edfio, I'll let you know 😄 (I don't have time to implement it in the near future).