rob-luke / Neuroimaging.jl

Neuroimaging in Julia
https://rob-luke.github.io/Neuroimaging.jl
BSD 3-Clause "New" or "Revised" License
48 stars 11 forks source link

Add standard 3D brain and head visualisation #135

Open rob-luke opened 3 years ago

rob-luke commented 3 years ago

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.

abcsds commented 2 years ago

Here a couple options I'm looking into:

rob-luke commented 2 years ago

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.

rob-luke commented 2 years ago

This may be useful... https://github.com/dfsp-spirit/NeuroFormats.jl

rob-luke commented 2 years ago

Actually more that useful!

image

abcsds commented 2 years ago

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.

rob-luke commented 2 years ago

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

rob-luke commented 2 years ago

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.

rob-luke commented 2 years ago

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

abcsds commented 2 years ago

image 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.