BrainVoyager Python Developer Guide 0.9

General Document Commands

Documents represent the most essential components of BrainVoyager and many properties and methods are exposed for scripting purposes. A PyBVDoc document object will be returned by various BrainVoyager application object and document list commands, e.g. after creating or opening a document from file. The currently active document in the multi-document workspace can also be easily retrieved using the BrainVoyager application object. Here general commands exposed by the document object are described while methods that are meaningful only for specific document types (VMR, FMR, DMR) are handled in subsequent topics.

 

methods() → tuple

Description
Returns a tuple with the methods supported by the DocPyBV document object.


describe_method(str method_name) → str

Description
Returns a string with documentation for the specified method supported by the DocPyBV document object. The returned string should be printed to properly convert newline characters (e.g. > print(describe_method('name')). The printed output contains the same information displayed in the BV Notebook API Help Output pane when hovering over a BV method name or when tab-completing a method name. Note: At present help is not available for all commands.
method_name (str)
String containing the name of the method.


close()

Description
Closes the document freeing used memory. The document object is removed from the document list object and its document window is removed from the multi-document workspace.


save() → bool

Description
Saves the document to disk using its current file name and file path. If the file can not be saved, the command returns False, otherwise True. If a document has just been created, the SaveAs() function should be used (see below).


save_as(str fileName) → bool

Description
Saves the document to disk using the provided name. If the file can not be saved, the command returns False, otherwise True.
fileName (str)
String specifying the name under which the file will be stored. In case that not a full file path (folder plus file name) is provIded, the document is stored in the current directory; if a relative path is provided (e.g. "..\data\filename.vmr"), the relative path will be interpreted relative to the current directory.


remove()

Description
Removes the doucement's file representation from disk and closes the document (see above).


update_view()

Description
Updates the view window representing the calling document. This command is useful to update the visualization of a document after some processing changing its appearance.


 

Copyright © 2020 Rainer Goebel. All rights reserved.