fsleyes.actions.moviegif¶
This module provides the MovieGifAction, which allows the user
to save animated gifs. The makeGif() function can also be used to
programmatically generate animated gifs.
-
class
fsleyes.actions.moviegif.MovieGifAction(overlayList, displayCtx, panel)[source]¶ Bases:
fsleyes.actions.base.ActionThe
MovieGifActionallows the user to save an animated gif of the currently selected overlay in aCanvasPanel, according to the current movie mode settings.-
__init__(overlayList, displayCtx, panel)[source]¶ Create a
MovieGifAction.- Parameters
overlayList – The
OverlayList.displayCtx – The
DisplayContext.panel – The
CanvasPanelto generate the animated GIF for.
-
destroy()[source]¶ Must be called when this
MovieGifActionis no longer neded. Removes some property listeners.
-
__selectedOverlayChanged(*a)¶ Called when the
DisplayContext.selectedOverlaychanges. Enables/disables this action based on whether a movie can be played (seeCanvasPanel.canRunMovie()).
-
__doMakeGif()¶ Prompts the user to select a file to save the movie to, and then generates the movie via
makeGif().
-
__module__= 'fsleyes.actions.moviegif'¶
-
-
fsleyes.actions.moviegif.makeGif(overlayList, displayCtx, panel, filename, progfunc=None, onfinish=None)[source]¶ Save an animated gif of the currently selected overlay, according to the current movie mode settings.
Note
This function will return immediately, as the animated GIF is generated on the
wxidleloop- Parameters
overlayList – The
OverlayListdisplayCtx – The
DisplayContextpanel – The
CanvasPanel.filename – Name of file to save the movie to
progfunc – Function which will be called after each frame is saved.
onfinish – Function which will be called after all frames have been saved.