Skip to content

Commit 5d8d6d8

Browse files
API Brain.save_image(): expose image parameters
1 parent cd2c11c commit 5d8d6d8

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

surfer/viz.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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,6 +2020,12 @@ 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
20242030
Due to limitations in TraitsUI, if multiple views or hemi='split'
20252031
is used, there is no guarantee painting of the windows will
@@ -2028,7 +2034,7 @@ def save_image(self, filename):
20282034
a Mayavi figure to plot instead of TraitsUI) if you intend to
20292035
script plotting commands.
20302036
"""
2031-
misc.imsave(filename, self.screenshot())
2037+
misc.imsave(filename, self.screenshot(mode, antialiased))
20322038

20332039
def screenshot(self, mode='rgb', antialiased=False):
20342040
"""Generate a screenshot of current view

0 commit comments

Comments
 (0)