Error opening nwb files

Thanks for this debugging work.

** Invalid option. Option must be 'omitnan' or 'includenan'.
It seems to require a newer version of max(). So I changed to R2019b and the error above disappeared

This error is to be handled at the level of the matnwb library.
I opened an issue here: [Bug]: Syntax valid only after Matlab 2018b · Issue #437 · NeurodataWithoutBorders/matnwb · GitHub

I'm not sure if it's just an issue about labeling or the data was badly formatted (I obtained the data from an open database). As mentioned by mpompolas, the key names in NWB could be arbitrary.

One issue with NWB is indeed the lack of specifications, which makes it difficult to obtain reproducible data structures that can be processed automatically.

If you know how to use github, could you open a PR on the Brainstorm repository to fix this function?
Ideally, your fix should check for the existence of the field "group_name", and if it doesn't exist, use your new code instead.

If you don't know how to use GitHub or don't want to push this contribution yourself: please share your edited function and an example .nwb file (upload it somewhere and post the download link here).
Thanks