nih-megcore / nih_to_mne

General functions for NIH data to work with MNE python
Other
2 stars 3 forks source link

ability to crop raw data to only include non-zero timepoints before writing out bids data. #33

Closed sjapee closed 11 months ago

sjapee commented 1 year ago

Would it be possible to add the option to exclude data from raw that is all zeros (this happens when recording is longer than the task) and would be useful for self-paced task recordings. something like the following to remove trailing zeros: raw.crop(0,raw.times[events[-1,0]]+3) before calling: write_raw_bids(raw, bids_path, overwrite=True) The above would rely on having events array available. But perhaps there's another way?

jstout211 commented 1 year ago

Currently checking with the group if there is a CTF option for this -- Otherwise, we have some code in the eyetracking that will identify when the channels have zeroed out and crop after a certain number of consecutive zeros. This still leaves us with a .fif file, but you probably want the data in CTF format. We might be able to use pyctf to cast this back into a CTF dataset.

jstout211 commented 1 year ago

image

hyperbolicTom commented 1 year ago

There is a fif2ctf utility in pyctf, but it has only been used with OPM datasets. It is easy to modify, and it writes CTF format (bare minimum of files, .meg4 and .res4)

LinaTeichmann1 commented 1 year ago

If there is a good solution for this, I'd be interested to make my BIDS datasets smaller! :) Thanks all!

jstout211 commented 1 year ago

Some progress towards this 05aae3a -- just need to integrate into the bids component

Even with ctf module loaded on biowulf - it still does not detect that it is there - will need to fix or not check

jstout211 commented 11 months ago

This is currently implemented with a cmdline argument flag.