Produce 3D interactive ROI images with python

I am looking for a way to produce interactive 3D images that can visualize ROIS within a glass brain and can store these interactive images as .html objects (or some other format that allows me to store them permanently on disk). Is there any python implementation that would help me to achieve this?

I found the brainR package (see the related paper and this example provided by the author) which does exactly what I need but couldn’t get it to work even after a couple of hours (+ it’s written in R and it would be awesome if I could write one single python script that does the analysis, creates the ROI-images and outputs them as .html objects).

I also found out that someone created a dash application that can render 3D brains but this application is not a library but really only produces a predefined set of 3D images.Most closely related functions in Python are found in the nilearn.plotting module but they are not capable to produce 3D-glass brain outputs.

Possibly related questions and links:

Seems like niivue is aiming to achieve this, if I am not mistaken? Pinging @Chris_Rorden here.

Hello Johannes,

I realize that this is quite old but since you bumped it 2 years after your initial question and it also still comes up on the first page of google when searching for this problem, I hope replying 3 1/2 years after the question was posted is acceptable.

I suggest to use nilearn.plotting.view_img(). Though it is not a glass brain plot, it is interactive. You can manipulate the input image by creating your own 3d image, custom background and color map. Let me know if that is what you had in mind.