Render#

class brainrender.render.Render(plotter=None)[source]#

Bases: object

Methods

close()

Close the vedo Plotter window.

export(savepath, **kwargs)

Export the scene to a .html file for online rendering.

keypress(key)

Handle key presses during interactive rendering.

render([interactive, camera, zoom, resetcam])

Render the scene.

screenshot([name, scale])

Take a screenshot of the current view and save it to file.

Attributes

axes_indices

axes_lookup

axes_names

is_rendered

plotter

close()[source]#

Close the vedo Plotter window.

Return type:

None

export(savepath, **kwargs)[source]#

Export the scene to a .html file for online rendering.

Parameters:
  • savepath (str | Path) – Path to the output .html file.

  • **kwargs (Any) – Additional arguments forwarded to render.

Returns:

Absolute path of the saved file.

Return type:

str

Raises:

ValueError – If savepath does not have a .html suffix.

keypress(key)[source]#

Handle key presses during interactive rendering.

  • s: take a screenshot

  • q / Esc: close the window

  • c: print current camera parameters

Parameters:

key (str) – Key identifier string from vedo.

Return type:

None

render(interactive=None, camera=None, zoom=None, resetcam=False, **kwargs)[source]#

Render the scene.

Parameters:
  • interactive (bool | None) – If None, falls back to settings.INTERACTIVE. When True, execution pauses so the user can interact with the scene.

  • camera (str | dict | None) – Camera name or parameter dict. Falls back to settings.DEFAULT_CAMERA if None.

  • zoom (float | None) – Camera zoom level. Falls back to the atlas default if None.

  • resetcam (bool) – Reset the camera between renders.

  • **kwargs (Any) – Additional arguments forwarded to self.plotter.show.

Return type:

None

screenshot(name=None, scale=None, **kwargs)[source]#

Take a screenshot of the current view and save it to file.

Screenshots are saved in screenshots_folder (see Scene).

Parameters:
  • name (str | None) – Output filename. Defaults to a timestamped .png if None. Unsupported extensions are silently replaced with .png.

  • scale (float | None) – Resolution multiplier. Values above 1 increase resolution. Falls back to settings.SCREENSHOT_SCALE if None.

  • **kwargs (Any) – Additional arguments forwarded to render.

Returns:

Absolute path of the saved screenshot.

Return type:

str