Skip to content

Conversation

@dsleiter
Copy link
Contributor

Thanks for contributing a pull request! Please make sure you have read the
contribution guidelines
before submitting.

Please be aware that we are a loose team of volunteers so patience is
necessary. Assistance handling other issues is very welcome. We value
all user contributions, no matter how minor they are. If we are slow to
review, either the pull request needs some benchmarking, tinkering,
convincing, etc. or more likely the reviewers are simply busy. In either
case, we ask for your understanding during the review process.

Again, thanks for contributing!

Reference issue

Fixes #9571

What does this implement/fix?

Uses the 'name' field from SNIRF file stim groups as the description for Annotations rather than the index of the stim group.

Additional information

This is in response to mne-tools/mne-nirs#326

This could be a breaking change for anyone who depends on annotation descriptions when reading from SNIRF files that have not been created from the update to the MNE-NIRS SNIRF writer. I'd like some guidance on whether or not I should implement a deprecation or not. I listed this as an ENH because it isn't obvious that this is a bug fix, but it is in response to a fix of what is a bug in the SNIRF writer in order to maintain consistency.

@welcome
Copy link

welcome bot commented Jul 16, 2021

Hello! 👋 Thanks for opening your first pull request here! ❤️ We will try to get back to you soon. 🚴🏽‍♂️

@dsleiter dsleiter changed the title [ENH] Get annotation description from snirf stim name [MRG, ENH] Get annotation description from snirf stim name Jul 16, 2021
@dsleiter
Copy link
Contributor Author

I believe this is ready for review!

dat.get('/nirs/' + key + '/data')))
if data.size > 0:
annot.append(data[:, 0], 1.0, key[4:])
desc = dat.get('/nirs/' + key + '/name')[0]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rob-luke
Copy link
Member

Thanks @dsleiter, this looks good to me. Lets see if we can get a review from @larsoner too.

As there is a matching PR at mne-tools/mne-nirs#326 I suggest we wait till this PR has all green CI, then I will pull both PR branches and test locally (I will test a few real files have no loss of info when converted back and forth). Then once once all CIs are green, my local tests are passing, and we have a few review approvals we merge. Ok?

Copy link
Member

@rob-luke rob-luke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested this locally with the associated MNE-NIRS branch and all results seemed correct to me. I also tested locally with some real measurements.

@larsoner larsoner merged commit 144a58c into mne-tools:main Jul 16, 2021
@welcome
Copy link

welcome bot commented Jul 16, 2021

🎉 Congrats on merging your first pull request! 🥳 Looking forward to seeing more from you in the future! 💪

@larsoner
Copy link
Member

Thanks @dsleiter !

@dsleiter
Copy link
Contributor Author

Thanks @rob-luke and @larsoner!

@dsleiter dsleiter deleted the snirf-stim-to-desc branch July 19, 2021 02:49
larsoner added a commit to alexrockhill/mne-python that referenced this pull request Jul 19, 2021
* upstream/main:
  [MRG, ENH] Find aseg labels near montage (mne-tools#9545)
  Add label to colorbar in GAT plot [skip actions] (mne-tools#9582)
  [ENH, MRG] Encapsulate warp elec image in function (mne-tools#9544)
  [DOC, MRG] Add "info" to `docdict` (mne-tools#9574)
  [MRG] Add `units` parameter to get_data for Evoked (mne-tools#9578)
  [MRG, ENH] Get annotation description from snirf stim name (mne-tools#9575)
  [MRG] ENH, FIX: Add tmin/tmax parameters to get_data methods, fix bug in find_bads_ecg (mne-tools#9556)
@rob-luke rob-luke mentioned this pull request May 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Get annotation descriptions from the stim name when reading snirf files

3 participants