mne-python icon indicating copy to clipboard operation
mne-python copied to clipboard

Add option to import BrainVision files without marker types

Open cbrnr opened this issue 1 month ago • 5 comments

BrainVision markers (stored in .vmrk files) consist of the following fields (the last field is optional):

Mk<number>=<Type>,<Description>,<Position>,<Size>,<Channel>,<Date>

For example:

Mk2=Comment,bad_segment,251,391,0

This is a marker as exported via raw.export() using pybv from an annotation with the description bad_segment. Since the Type field must be present, pybv uses Comment by default.

However, when importing the exported BrainVision file, annotations are created from markers, and the description will be pieced together as <Type>/<Description>, i.e. Comment/bad_segment in this case.

This makes the round-trip inconsistent, because I'd like to recover the original annotation descriptions from markers. This simply means that I'd need an option for read_raw_brainvision() to ignore the Type fields when constructing annotations. This would require a new parameter, e.g. ignore_marker_types=False (or something along these lines).

Would that be an addition that everyone is OK with (pinging @sappelhoff explicitly as one of the pybv maintainers)?

cbrnr avatar May 10 '24 10:05 cbrnr