Neuroimaging.jl
Neuroimaging.jl copied to clipboard
Add standard 3D brain and head visualisation
I remember seeing a head/brain visualisation on one of the plotting library demos, this can be a nice basis.
The data should be carefully selected as a standard head model from one of the well published sources with well described coordinates etc.
Here a couple options I'm looking into:
- The big brain project: Scientific data, with flexible licensing: BY-NC-SA (https://ftp.bigbrainproject.org/bigbrain-ftp/License.txt) Disadvantage: might be too much data, so we'd have to adapt it.
- Using MNE's brain model: The licensing is not specific to the 3D models in the package. I cannot find the model, but it's pretty ugly anyway. The main advantage is that it's used within a close community of developers and researchers.
- Fieldtrip's brain model: The ft_sourceplot function provides a 3D model. It's Prettier than MNE's, and fieldtrip is GPLv3.
- Using a sphere. Simple, but gets the job done. EEGLab's approach.
MNE uses freesurfer under the hood. I think this may be the best option too, as freesurfer is widely used. Could you add that to your consideration list too? Then we could use the fsaverage https://surfer.nmr.mgh.harvard.edu/fswiki/FsAverage file for a generic brain visualisation (that's what MNE does).
Thanks for keeping me posted on your thoughts, that will definitely save us duplicating on effort.
This may be useful... https://github.com/dfsp-spirit/NeuroFormats.jl
Actually more that useful!
You are faster than my internet connection! I'm still downloading what I think is FSAverage from the BBP.
Looking at the NeuroFormats package, it looks like an option that will allow us to expand the work here as needed, starting with the FSaverage model, right? It looks to me like the best option. I'll be working on adding an example that uses it.
It looks to me like the best option. I'll be working on adding an example that uses it.
Awesome, thanks for looking in to it. Throw out any questions as you hit snags etc.
One example that might be easy (famous last words) to start with is plotting the brain, and then overlaying some electrodes on it. I am not sure the best API, but if you could do something like...
plot(brain)
plot!(electrodes)
or something. But I leave it to you to suggest an API. Each electrode has a coordinate and name, so all the info should be available in theory (may be tricky in practice though).
https://github.com/rob-luke/Neuroimaging.jl/blob/321b7c468c4e79c9abe1958f5bd1f4b3c50557a8/src/types/Sensors/Sensors.jl#L30-L34
Full disclosure here, I'm a heavy MNE user and on the steering council. So I may be bias to the MNE way, so feel free to push me to something Julian when required.
What also might be useful for you to know when going down this path is how to add a downloader for the required files. You can do something like...
https://github.com/rob-luke/Neuroimaging.jl/blob/321b7c468c4e79c9abe1958f5bd1f4b3c50557a8/src/datasets/datasets.jl#L10-L19
Posting this as a reference: this is the stl for the 3D surface obtained from the Big Brain Project at https://ftp.bigbrainproject.org/bigbrain-ftp/BigBrainRelease.2015/3D_Surfaces/Apr7_2016/stl/. It looks asymmetrical and not at all like an average (the case of FSAverage).
I see as a great advantage that you work and have lots of experience with MNE. We can try to exploit the advantages provided by Julia, with the experience and design patters of a stable and reliable library.