nipy / PySurfer

Cortical neuroimaging visualization in Python
https://pysurfer.github.io/
BSD 3-Clause "New" or "Revised" License
239 stars 98 forks source link

Transparent rending with noisy particles #266

Closed solleo closed 5 years ago

solleo commented 5 years ago

Hi all,

I tried to visualize an inverse solution using a default option:

brain = stc.plot(subject=subj, surface='inflated', hemi='rh', time_viewer=False, initial_time=time_max)

and got this kind of image: all_tsss_hp0 5Hz_notch50sHz_cor_ave-rh stc

I've tried various options and noticed that with Transparent=True the binarized curvature mapping is rendered in front of the dSPM map. With Transparent=False the dSPM map was correctly rendered (without black dots/edges sticking out).

I'm using NVIDIA Quadro P400 (driver v415.27) on Ubuntu 16.04.6 LTS.

I just wonder if anyone has experienced a similar thing before?

mwaskom commented 5 years ago

Sounds like https://github.com/nipy/PySurfer/issues/258

solleo commented 5 years ago

Thanks! It wasn't really the same issue as in #258 though: backface_culling didn't fix it. But it was solved by adjusting force_opaque = True

snapshot

Now, I know this is not really a PySurfer question, but could someone please point where I should read to know how to scriptize this? I think there should be some way to access the surface object handle, but I'm not familiar with mayavi....

+EDIT: Oh well, after some time, I found that <_f> attributes have handles of scenes, and mayavi script generator also gave me a hint, so I finally figured out how to do this:

brain.brain_matrix[0][0]._f.children[1].children[0].children[0].children[0].actor.actor.force_opaque = True

This solves my issue, so I'm closing it.