@@ -2010,7 +2010,7 @@ def save_single_image(self, filename, row=-1, col=-1):
20102010 mlab .draw (brain ._f )
20112011 mlab .savefig (filename , figure = brain ._f )
20122012
2013- def save_image (self , filename ):
2013+ def save_image (self , filename , mode = 'rgb' , antialiased = False ):
20142014 """Save view from all panels to disk
20152015
20162016 Only mayavi image types are supported:
@@ -2020,15 +2020,23 @@ def save_image(self, filename):
20202020 ----------
20212021 filename: string
20222022 path to new image file
2023+ mode: string
2024+ Either 'rgb' (default) to render solid background, or 'rgba' to
2025+ include alpha channel for transparent background
2026+ antialiased: bool
2027+ Antialias the image (see mlab.screenshot() for details; default
2028+ False)
20232029
2030+ Notes
2031+ -----
20242032 Due to limitations in TraitsUI, if multiple views or hemi='split'
20252033 is used, there is no guarantee painting of the windows will
20262034 complete before control is returned to the command line. Thus
20272035 we strongly recommend using only one figure window (which uses
20282036 a Mayavi figure to plot instead of TraitsUI) if you intend to
20292037 script plotting commands.
20302038 """
2031- misc .imsave (filename , self .screenshot ())
2039+ misc .imsave (filename , self .screenshot (mode , antialiased ))
20322040
20332041 def screenshot (self , mode = 'rgb' , antialiased = False ):
20342042 """Generate a screenshot of current view
@@ -2040,11 +2048,8 @@ def screenshot(self, mode='rgb', antialiased=False):
20402048 mode: string
20412049 Either 'rgb' or 'rgba' for values to return
20422050 antialiased: bool
2043- Antialias the image (see mlab.screenshot() for details)
2044- row : int
2045- row index of the brain to use
2046- col : int
2047- column index of the brain to use
2051+ Antialias the image (see mlab.screenshot() for details; default
2052+ False)
20482053
20492054 Returns
20502055 -------
0 commit comments