Repository navigation
Description
TL;DR
would it be a big problem to change the FIF file "bids-style" split naming from
_part-Xto something else? (see:)Lines 298 to 310 in 861e825
def _construct_bids_filename(base, ext, part_idx): """Construct a BIDS compatible filename for split files.""" # insert index in filename deconstructed_base = base.split('_') bids_supported = ['meg', 'eeg', 'ieeg'] for mod in bids_supported: if mod in deconstructed_base: idx = deconstructed_base.index(mod) modality = deconstructed_base.pop(idx) base = '_'.join(deconstructed_base) use_fname = '%s_part-%02d_%s%s' % (base, part_idx, modality, ext) return use_fname
When .fif files grow too large, they need to be split into chunks. In a BIDS context, where each file name follows a structure, we need some way to deal with this.
In 2017 or 2018 @jasmainak and @teonbrooks (I think? ... somebody else?) suggested to use *_part-X_meg.fif with the X being a number to define different parts of the same .fif recording.
Some context before the issue: The _part- syntax was (accidentally) not fully introduced into the specification: It is only a non-elaborated example in an appendix, see:
This leads to the issue that now several other BIDS extension proposals want to use _part- and have started using it --> because they were not aware that it is already being used in MNE (because as I said, _part- is only mentioned in a non-elaborated example in an appendix).
The complete issue is here: bids-standard/bids-specification#429
The fight is essentially whether or not it's OK for MEG/MNE to claim _part- for themselves although it was never properly introduced into the spec.
One pragmatic solution is to
- drop the non-elaborated
_part-example from the appendix of the BIDS spec - properly introduce a new way to name split
.fiffiles with a new PR to the BIDS spec (e.g.,_split-X - adapt MNE-Python to use that new, proper way (e.g.,
_split-X), and deprecating MNE support for the now invalid_part-X
This part of MNE would have to change:
Lines 298 to 310 in 861e825
| def _construct_bids_filename(base, ext, part_idx): | |
| """Construct a BIDS compatible filename for split files.""" | |
| # insert index in filename | |
| deconstructed_base = base.split('_') | |
| bids_supported = ['meg', 'eeg', 'ieeg'] | |
| for mod in bids_supported: | |
| if mod in deconstructed_base: | |
| idx = deconstructed_base.index(mod) | |
| modality = deconstructed_base.pop(idx) | |
| base = '_'.join(deconstructed_base) | |
| use_fname = '%s_part-%02d_%s%s' % (base, part_idx, modality, ext) | |
| return use_fname |
There are other solutions described in the BIDS issue thread (I summarized them in this comment) but there are several parties with strong opinions, and if the pragmatic solution proposed in THIS issue is not a big deal for MNE folks, then going with this solution would resolve the BIDS issue in a straight forward way.
Activity
larsoner commentedon May 12, 2020
This sounds fine from the MNE end to me.
_splitis clearer naming than_partfor its purpose anywayagramfort commentedon May 12, 2020
hoechenberger commentedon May 13, 2020
I like that.
jasmainak commentedon May 18, 2020
I checked a few datasets on openneuro randomly and it seems the
splitconvention is used almost nowhere. So, it's fine to change to_split-Xteonbrooks commentedon May 18, 2020
i'm also in favor of the switch from changing it from
parttosplit. I gave approval there. I have one dataset withpartin it but I will just go back rename them with the landed patch in mne-bidssappelhoff commentedon May 18, 2020
Thanks for your feedback everybody and for making this so easy. I started to make the relevant PRs to all involved parties. 🙂
robertoostenveld commentedon May 18, 2020
hmm, somehow this seems to be discussed here and also in
#429bids-standard/bids-specification#429.In the case of renaming
partto something else for MEG, I would prefersegmentoversplit.hoechenberger commentedon May 18, 2020
I have no strong feelings there, but it does seem that the term "segment" is often being used interchangeably with "epoch", see e.g.:
https://mne.tools/dev/auto_tutorials/index.html?highlight=segmented#segmenting-continuous-data-into-epochs
https://mne.tools/dev/auto_tutorials/raw/plot_30_annotate_raw.html?highlight=segment#creating-annotations-programmatically
sappelhoff commentedon May 18, 2020
yes, sorry @robertoostenveld I did not communicate this very well. It started out as an online discussion with @effigies and @franklin-feingold and we resolved it'd be good to ask the MNE community directly, so I opened this issue.
The result is basically that it'd be fine to move ahead and replace
partin the specification by some other keyword (e.g. split). Most people have voted in favor ofsplit(albeit nobody with a very strong opinion on this)I tried to remedy this with a summary post here: bids-standard/bids-specification#429 (comment)
robertoostenveld commentedon May 18, 2020
| I have no strong feelings there, but it does seem that the term "segment" is often being used interchangeably with "epoch" ...
Agreed, using "segment" for recordings that are split over multiple files because of technical reasons (i.e. 2GB file size limits) has the risk that people would confuse it with "segment" for task-related reasons, where repeated trials (in the task) are analyzed by cutting the data into segments (or epochs) corresponding to those trials. We don't want an epoched
.fiffile to be represented in a whole bunch of files, one per trial.Hereby I also upvote
splitin favour ofsegment.Perhaps we should (somewhere) clarify this terminology of split, segment, epoch, and trial.
agramfort commentedon May 18, 2020