-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BUG: Fix bug with reading his_id from snirf #12526
Conversation
@drammock should be good to go! |
names = np.array(dat.get("nirs/metaDataTags/SubjectID")) | ||
subject_info["first_name"] = _correct_shape(names)[0].decode("UTF-8") | ||
names = _correct_shape(names)[0].decode("UTF-8") | ||
subject_info["his_id"] = names |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] varname shouldn't be names
if the content is an anonymous ID. Or is SubjectID
sometimes containing actual names?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sometimes it contains just the concat of first middle last. The naming and stuff is meant to mirror the NIRX convention / use I think:
mne-python/mne/io/nirx/nirx.py
Line 330 in 0aef079
subject_info["his_id"] = "_".join(names) |
else: | ||
# MNE < 1.7 used to not write the firstName tag, so pull it from names | ||
subject_info["first_name"] = names.split("_")[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this strikes me as odd but if you're doing it I trust that it makes sense?
* upstream/main: (50 commits) ENH: Improve OPM auditory dataset and example (mne-tools#12539) MAINT: Bump to latest pydata-sphinx-theme (mne-tools#12228) MRG: Simplify manual installation instructions a little by dropping explicit mention of (lib)mamba (mne-tools#12362) fix PSD weights handling when bad annotations present (mne-tools#12538) Fix phase loading (mne-tools#12537) align FFT windows to good data spans in psd_array_welch (mne-tools#12536) explicitly disallow multitaper in presence of bad annotations (mne-tools#12535) MAINT: Clean up PyVista contexts (mne-tools#12533) MAINT: Complete API change of ordered (mne-tools#12534) MAINT: Reinstall statsmodels and improve logging (mne-tools#12532) MAINT: Remove scipy.signal.morlet2 (mne-tools#12531) Update README badge links (mne-tools#12529) BUG: Fix bug with reading his_id from snirf (mne-tools#12526) [pre-commit.ci] pre-commit autoupdate (mne-tools#12524) Fix file format check in _check_eeglab_fname function (mne-tools#12523) MAINT: Reenable picard in pre testing (mne-tools#12525) MAINT: Bump to large resource class (mne-tools#12522) MAINT: Restore 2 jobs on Windows (mne-tools#12520) Add exclude_after_unique option to mne.io.read_raw_edf/read_raw_edf to search for exclude channels after making channel names unique (mne-tools#12518) Improve consistency of sensor types in code and documentation (mne-tools#12509) ...
Companion to mne-tools/mne-nirs#546. But the short version is that SNIRF stores a
SubjectID
which maps nicely onto ourinfo["subject_info"]["his_id"]
but we weren't setting it.