You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if the code becomes too big I would start by putting it in
dedicated projects unless there is a consensus so that 80% of people will
use this tool anyway
if the code becomes too big I would start by putting it in
dedicated projects unless there is a consensus so that 80% of people will
use this tool anyway
This is handy to know, it will help me think about what to implement in this repo
Great to hear. Whats the best way to go about adding external code? I assume we don't want to add that repository as a dependency. Do you usually email the author and ask them to add it to MNE, or ask permission for me to add it? Seems like most of the work will be around the data format management which I can do.
@rob-luke We'll want some changes to docstring, code formatting, etc, so to me it would seem odd to ask the original author to do that work for us. But I think it's polite to let them know that you're going to incorporate their work into MNE-Python, and ask if/how they want to be involved and/or credited.
With the 0.20 release coming out soon I thought it would be a good time to say thanks to @larsoner and @agramfort for all the help getting this NIRS integration working. Right now I just completed an analysis ready for publication entirely with MNE. To me it seems all the basic requirements for a NIRS analysis is now present in MNE. Next comes the fun part of developing more advanced analysis/algorithms. Thanks again.
@kylemath the plan at this point is to support all of the stuff at the top of this issue directly in MNE-Python except what is marked as being for mne-nirs. Mostly that means I/O of fNIRS data is in scope for MNE-Python, but HRF deconvolution is being worked out right now in mne-nirs. Basically mne-nirs is there to allow @rob-luke and other to try things out and figure out APIs, and once they are settled, things should migrate to MNE-Python.
I would say you should try implementing your mne.io.read_raw_imagent or mne.io.read_raw_iss here first, probably with guidance from @rob-luke. Once that's it, talk with him about what fits better here or in mne-nirs based on what is standard (enough) practice in the field.
MOpt3d looks great. I think that kind of functionality is more suited to MNE-NIRS than MNE for now. Particularly photon migration is something I would love to get up running (see issue). A quick stalk of your repository reveals that you have extensive experience in this style of analysis. I am trying to sketch out a roadmap over at MNE-NIRS by opening issues, please feel free to create/comment on issues to share your experience of what works or doesn't, or what functionality you think is essential or not.
@rob-luke@larsoner - My student and I are working on the function to load BOXY data files from the imagent software, along with digitized sensor location files and lists of location names for our helmets.
This is working quite well at https://github.com/kylemath/pyoptical. We compute the transformation matrix needed to go from our sensor space into the fsaverage space, and add it to the info object to get added to the Raw data objects.
We noticed that the nirx function does things a bit different, by precomputing a transformation matrix from fsaverage, applying it to the fNIRS sensor coordinates and outputing those TRANSFORMED VALUES without a transformation matrix. Why does NIRx.py apply the transform ahead of time? Instead of leaving it up to the user?
So the read_raw_nirx transforms them to the head coordinate frame. Since the NIRx are in MNI (apparently?) and fsaverage is in MNI, you can just use fsaverage's standard transformation to get them to (fsaverage) head coordinates.
Ok thanks, I think part of our confusing is that we only have two coordinate frames, and our "head" and "MEG" frames are aligned.
We digitize 300 points on the optical imaging headgear with a subset of those being channel locations (sources or detectors), as well as around the eyes, and fiducials. I am assuming this is our "head" frame.
A subset of these points are also the locations of light sources and detectors, which I assume is like the "MEG" frame, but is already co-registered with our "HEAD" frame
Then we have an average or subject specific MRI parcellation of the surface of the head, "MRI" frame
I will leave these coordinate questions to the others. But it might be easier if you open a pull request as a WIP in this repository for the imagent data reader, that way we can comment directly on the code and iterate faster.
--
*Kyle E. Mathewson, Ph.D.*
Assistant Professor - Department of Psychology, Faculty of Science
Director - Attention Perception and Performance Lab
Affiliate - Neuroscience and Mental Health Institute, Faculty of Medicine
and Dentistry
University of Alberta
P455 - Biological Sciences Building
11455 Saskatchewan Dr.
Edmonton, Alberta, Canada, T6G 2E9
Phone: 1-780-492-2662
Email: [email protected]
Web: www.kylemathewson.com
@rob-luke this is marked for a 0.21 milestone. Could you look into the remaining plotting issues above in the next couple of weeks so that we can tick a few more boxes for 0.21?
Sure I can take a crack at PSD and TFR, but I don't know what projs is and if its relevant to NIRS. The other file type readers are also out of my control, particularly the artinis won't be done by 0.21. Do you plan to create another meta issue after 0.21 for the outstanding issues? I think we could ditch the mega meta style list as everything is running pretty well now and just tackle issues as they arise.
Activity
rob-luke commentedon Nov 14, 2019
Currently I am looking at the temporal whitening tutorial as a starting place for the first step of the GLM implementation.
larsoner commentedon Nov 14, 2019
@rob-luke WDYT about implementing TDDR? There is MIT licensed code here that we could adapt.
larsoner commentedon Nov 14, 2019
(Unrelatedly, also added a note about refactoring the wavelength to use
info['chs'][ii]['loc']rather than the channel name)agramfort commentedon Nov 14, 2019
larsoner commentedon Nov 14, 2019
Agreed, not sure about prevalence. @rob-luke hopefully can comment.
FWIW the code for TDDR is about 20 active lines so not too painful :)
rob-luke commentedon Nov 14, 2019
From that style of processing, TDDR is my preferred approach. I would be happy to implement it after the items listed above.
rob-luke commentedon Nov 14, 2019
This is handy to know, it will help me think about what to implement in this repo
rob-luke commentedon Nov 14, 2019
I have put my name next to the items that I have rough code already working for.
rob-luke commentedon Feb 13, 2020
There is now a python TDDR implementation here.
agramfort commentedon Feb 13, 2020
rob-luke commentedon Feb 13, 2020
Great to hear. Whats the best way to go about adding external code? I assume we don't want to add that repository as a dependency. Do you usually email the author and ask them to add it to MNE, or ask permission for me to add it? Seems like most of the work will be around the data format management which I can do.
drammock commentedon Feb 13, 2020
@rob-luke We'll want some changes to docstring, code formatting, etc, so to me it would seem odd to ask the original author to do that work for us. But I think it's polite to let them know that you're going to incorporate their work into MNE-Python, and ask if/how they want to be involved and/or credited.
rob-luke commentedon Feb 13, 2020
Thanks, I'll get in touch with the author and offer to do the bulk of the boring work and ask how they want to be involved/credited.
rob-luke commentedon Mar 27, 2020
With the 0.20 release coming out soon I thought it would be a good time to say thanks to @larsoner and @agramfort for all the help getting this NIRS integration working. Right now I just completed an analysis ready for publication entirely with MNE. To me it seems all the basic requirements for a NIRS analysis is now present in MNE. Next comes the fun part of developing more advanced analysis/algorithms. Thanks again.
23 remaining items
larsoner commentedon Apr 17, 2020
@kylemath the plan at this point is to support all of the stuff at the top of this issue directly in MNE-Python except what is marked as being for
mne-nirs. Mostly that means I/O of fNIRS data is in scope for MNE-Python, but HRF deconvolution is being worked out right now inmne-nirs. Basicallymne-nirsis there to allow @rob-luke and other to try things out and figure out APIs, and once they are settled, things should migrate to MNE-Python.I would say you should try implementing your
mne.io.read_raw_imagentormne.io.read_raw_isshere first, probably with guidance from @rob-luke. Once that's it, talk with him about what fits better here or in mne-nirs based on what is standard (enough) practice in the field.At least that's how I see it! Feel free to clarify @rob-luke @agramfort
rob-luke commentedon Apr 19, 2020
Hi @kylemath,
I agree with @larsoner, lets get the imagent reader straight in to MNE. I would recommend including at least the following files:
MOpt3d looks great. I think that kind of functionality is more suited to MNE-NIRS than MNE for now. Particularly photon migration is something I would love to get up running (see issue). A quick stalk of your repository reveals that you have extensive experience in this style of analysis. I am trying to sketch out a roadmap over at MNE-NIRS by opening issues, please feel free to create/comment on issues to share your experience of what works or doesn't, or what functionality you think is essential or not.
kylemath commentedon Apr 29, 2020
@rob-luke @larsoner - My student and I are working on the function to load BOXY data files from the imagent software, along with digitized sensor location files and lists of location names for our helmets.
This is working quite well at https://github.com/kylemath/pyoptical. We compute the transformation matrix needed to go from our sensor space into the fsaverage space, and add it to the info object to get added to the Raw data objects.
We noticed that the nirx function does things a bit different, by precomputing a transformation matrix from fsaverage, applying it to the fNIRS sensor coordinates and outputing those TRANSFORMED VALUES without a transformation matrix. Why does NIRx.py apply the transform ahead of time? Instead of leaving it up to the user?
larsoner commentedon Apr 30, 2020
Channel locations in MNE-Python are supposed to be stored in Neuromag head coordinates, see:
https://mne.tools/dev/auto_tutorials/source-modeling/plot_source_alignment.html
https://mne.tools/dev/overview/implementation.html#the-forward-solution
So the
read_raw_nirxtransforms them to the head coordinate frame. Since the NIRx are in MNI (apparently?) andfsaverageis in MNI, you can just usefsaverage's standard transformation to get them to (fsaverage) head coordinates.larsoner commentedon Apr 30, 2020
... but see also the evolving discussion here #7691 (comment)
kylemath commentedon Apr 30, 2020
Ok thanks, I think part of our confusing is that we only have two coordinate frames, and our "head" and "MEG" frames are aligned.
We digitize 300 points on the optical imaging headgear with a subset of those being channel locations (sources or detectors), as well as around the eyes, and fiducials. I am assuming this is our "head" frame.
A subset of these points are also the locations of light sources and detectors, which I assume is like the "MEG" frame, but is already co-registered with our "HEAD" frame
Then we have an average or subject specific MRI parcellation of the surface of the head, "MRI" frame
So I guess this is more analogous to the EEG coregistration in that regard. Is there some discussion of this EEG coregistration case somewhere I can't see, I see this, but not how to get the trans matrix: https://mne.tools/stable/auto_examples/visualization/plot_eeg_on_scalp.html
rob-luke commentedon Apr 30, 2020
Hi @kylemath,
I will leave these coordinate questions to the others. But it might be easier if you open a pull request as a WIP in this repository for the imagent data reader, that way we can comment directly on the code and iterate faster.
kylemath commentedon Apr 30, 2020
rob-luke commentedon May 1, 2020
Great, didn't mean to rush you, just whenever you have time. I found the support from the MNE team very encouraging when I added the NIRX reader.
Opening a PR will also move the detailed conversation there and keep this issue more for higher level agenda discussion.
kylemath commentedon May 3, 2020
Moved this discussion to: #7717 @rob-luke
larsoner commentedon Aug 31, 2020
@rob-luke this is marked for a 0.21 milestone. Could you look into the remaining plotting issues above in the next couple of weeks so that we can tick a few more boxes for 0.21?
rob-luke commentedon Aug 31, 2020
Sure I can take a crack at PSD and TFR, but I don't know what projs is and if its relevant to NIRS. The other file type readers are also out of my control, particularly the artinis won't be done by 0.21. Do you plan to create another meta issue after 0.21 for the outstanding issues? I think we could ditch the mega meta style list as everything is running pretty well now and just tackle issues as they arise.
larsoner commentedon Sep 1, 2020
Projs we can tackle at some point if people want to try using it as a means of noise suppression. Agreed we can just open PRs for readers as necessary
rob-luke commentedon Sep 1, 2020
Its great to have this ticked off. Thanks for the all the help along the road.