@@ -2010,7 +2010,7 @@ def save_single_image(self, filename, row=-1, col=-1):
2010
2010
mlab .draw (brain ._f )
2011
2011
mlab .savefig (filename , figure = brain ._f )
2012
2012
2013
- def save_image (self , filename ):
2013
+ def save_image (self , filename , mode = 'rgb' , antialiased = False ):
2014
2014
"""Save view from all panels to disk
2015
2015
2016
2016
Only mayavi image types are supported:
@@ -2020,6 +2020,12 @@ def save_image(self, filename):
2020
2020
----------
2021
2021
filename: string
2022
2022
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)
2023
2029
2024
2030
Due to limitations in TraitsUI, if multiple views or hemi='split'
2025
2031
is used, there is no guarantee painting of the windows will
@@ -2028,7 +2034,7 @@ def save_image(self, filename):
2028
2034
a Mayavi figure to plot instead of TraitsUI) if you intend to
2029
2035
script plotting commands.
2030
2036
"""
2031
- misc .imsave (filename , self .screenshot ())
2037
+ misc .imsave (filename , self .screenshot (mode , antialiased ))
2032
2038
2033
2039
def screenshot (self , mode = 'rgb' , antialiased = False ):
2034
2040
"""Generate a screenshot of current view
0 commit comments