Dr. Mowinckel's


  << Back to blog  

ggseg3d - creating interactive brain segmentation plots with plotly

Dec 6, 2019 | 3 minutes read

Looking through my blogposts, I realised I’ve never written about my colleague Didac and my package for 3d mesh plots of brain atlases using plotly. I’ve already showed some functionality from out {ggseg}-package, in the introductory blogpost and follow-up on animating it.

I guess it’s extra timely to do it now, as we recently split the mesh-plot function off the main {ggseg}-package and into it’s own package, and also did some re-writing of core-functionality of the package. Like the {ggseg}-package, {ggseg3d} is made to plot brain atlas data. In Neuroimaging, it is quite common to use these pre-defined areas of the brain, defined through functional or structural qualitites. Since the brain has three dimensions, we thought it would be neat to actually have a plot where you would actually look at the brain at all angles, and also be able to interact with it.

So started my long and arduous search for tri-surface mesh plots, and plotly became the obvious candidate. I had little to no experience with plotly, or with mesh-plots, so it was a real struggle. But I’m happy I stuck with it, and managed to make a tool that I now am really proud of. There are still lots of things to improve, but I believe the core-funcitonality is in place now, and everything else is a bonus!

Get 3d-plotting

{ggseg3d} can be installed from our works github account, using remotes


And off the bat, it should be fairly easy to use, or atleast make the first plot.