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.Action
The
MovieGifAction
allows 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
CanvasPanel
to generate the animated GIF for.
-
destroy
()[source]¶ Must be called when this
MovieGifAction
is no longer neded. Removes some property listeners.
-
__selectedOverlayChanged
(*a)¶ Called when the
DisplayContext.selectedOverlay
changes. 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
wx
idle
loop- Parameters
overlayList – The
OverlayList
displayCtx – The
DisplayContext
panel – 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.