Automatically plotting and saving numerous stc files

Hi,

I need to save numerous plots of source estimates. I have a loop over the
epochs I need to plot, and in each loop I use

brainobject = stc.plot(...)
brainobject.save(...)
brainobject.close()

However, this doesn't seem to work unless I have a graphical desktop open
or am working directly at a workstation. If I execute the code through a
terminal, it fails because the visualization cannot run.

Furthermore, if I am running the code from a Python IDE (Pycharm) and the
TVTK viewer window is minimized, the image saved is a screenshot of the
part of the screen that's within the boundaries of the box where the TVTK
viewer window would be if it were maximized, instead of an image of the
brain.

Is there a way to get around these issues, so that I can automatically plot
and save many brain images without needing to use a GUI or IDE?

Thank you and Best Regards,
Gladia
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20170201/9ccf6d89/attachment.html

Hi Gladia,

You can try to run it in headless mode using xvfb
<https://en.wikipedia.org/wiki/Xvfb>. You'll need to play around with it a
bit to make it work though.

Mainak