py4cytoscape.notebook.notebook_show_image

notebook_show_image(filename, type='PNG', sandbox_name=None, network=None, base_url='http://127.0.0.1:1234/v1', *, overwrite_file=True)[source]

Show a pre-existing image file in notebook output.

Upload an existing image file to the notebook file system and display the image.

Parameters
  • filename (str) – Full path or path relative to current working directory, in addition to the name of the file. File must already exist, and will be transferred to the notebook file system and displayed. Extension is automatically added based on the type argument.

  • type (str) – Type of image to export, e.g., PNG (default), JPEG, PDF, SVG, PS (PostScript).

  • sandbox_name (str) – Name of sandbox containing file. None means “the current sandbox”.

  • network (str or SUID or None) – Name or SUID of the network or view. Default is the “current” network active in Cytoscape. If a network view SUID is provided, then it is validated and returned.

  • base_url (str) – Ignore unless you need to specify a custom domain, port or version to connect to the CyREST API. Default is http://127.0.0.1:1234 and the latest version of the CyREST API supported by this version of py4cytoscape.

  • overwrite_file (bool) – False allows Cytoscape show a message box before overwriting the file if the file already exists; True allows Cytoscape to overwrite it without asking

Returns

iPython.display.Image class instance

Return type

object

Raises
  • CyError – if network doesn’t exist or the file cannot be written

  • requests.exceptions.RequestException – if can’t connect to Cytoscape or Cytoscape returns an error

Examples

>>> notebook_show_image('myimage.jpg', overwrite_file=False)
>>> notebook_show_image('imagex', type='JPG')