@@ -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,15 +2020,23 @@ 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
2030
+ Notes
2031
+ -----
2024
2032
Due to limitations in TraitsUI, if multiple views or hemi='split'
2025
2033
is used, there is no guarantee painting of the windows will
2026
2034
complete before control is returned to the command line. Thus
2027
2035
we strongly recommend using only one figure window (which uses
2028
2036
a Mayavi figure to plot instead of TraitsUI) if you intend to
2029
2037
script plotting commands.
2030
2038
"""
2031
- misc .imsave (filename , self .screenshot ())
2039
+ misc .imsave (filename , self .screenshot (mode , antialiased ))
2032
2040
2033
2041
def screenshot (self , mode = 'rgb' , antialiased = False ):
2034
2042
"""Generate a screenshot of current view
@@ -2040,11 +2048,8 @@ def screenshot(self, mode='rgb', antialiased=False):
2040
2048
mode: string
2041
2049
Either 'rgb' or 'rgba' for values to return
2042
2050
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)
2048
2053
2049
2054
Returns
2050
2055
-------
0 commit comments