How to use the vedo.settings.useFXAA function in vedo

To help you get started, we’ve selected a few vedo examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github BrancoLab / BrainRender / brainrender / __init__.py View on Github external
"INTERACTIVE_MSG",
    "CAMERA",
    "DEFAULT_SCREENSHOT_NAME",
    "DEFAULT_SCREENSHOT_TYPE",
    "DEFAULT_SCREENSHOT_SCALE",
    "SCREENSHOT_TRANSPARENT_BACKGROUND",
]


# -------------------------- Set vedo shaders -------------------------- #
from vedo import settings

settings.useDepthPeeling = (
    True  # necessary for rendering of semitransparent actors
)
settings.useFXAA = True  # necessary for rendering of semitransparent actors


# ------------------------- reset default parameters file ------------------------- #
params_file = Path(os.path.expanduser("~")) / ".brainrender" / "config.yaml"
defaults = brainrender.default_variables.__dict__
comment = (
    "# Rendering options. An explanation for each parameter can be found "
    + "in the documentation or in brainrender.default_variables.py\n"
)


def reset_defaults():
    # Get all variables from defaults
    vs = {
        key: value
        for key, value in defaults.items()
github BrancoLab / BrainRender / brainrender / render.py View on Github external
"name", brainrender.DEFAULT_SCREENSHOT_NAME
        )
        self.screenshots_extension = screenshot_kwargs.pop(
            "type", brainrender.DEFAULT_SCREENSHOT_TYPE
        )
        self.screenshots_scale = screenshot_kwargs.pop(
            "scale", brainrender.DEFAULT_SCREENSHOT_SCALE
        )

        if not use_default_key_bindings:
            self.plotter.keyPressFunction = self.keypress
            self.verbose = False

        if not brainrender.SCREENSHOT_TRANSPARENT_BACKGROUND:
            vedosettings.screenshotTransparentBackground = False
            vedosettings.useFXAA = True
github BrancoLab / BrainRender / brainrender / morphology / visualise.py View on Github external
def __init__(self, *args, **kwargs):
        self.default_neuron_color = kwargs.pop(
            "default_neuron_color", "darksalmon"
        )
        show_axes = kwargs.pop("show_axes", True)
        axes_kwargs = kwargs.pop("axes_kwargs", 1)
        settings.DEFAULT_NEURITE_RADIUS = ("neurite_radius", 18)

        if axes_kwargs == 1:
            settings.useDepthPeeling = (
                False  # necessary to make the axes render properly
            )
            settings.useFXAA = False

        # Initialise scene class
        Scene.__init__(
            self, add_root=False, display_inset=False, *args, **kwargs
        )

        if show_axes:
            brainrender.SHOW_AXES = True
            if axes_kwargs == 1:
                self.plotter.axes = self._default_axes_params

            else:
                self.plotter.axes = axes_kwargs
github BrancoLab / BrainRender / brainrender / __init__.py View on Github external
# Check we have all the params
for par in __all__:
    if par in ["INTERACTIVE_MSG"]:
        continue
    if par not in params.keys():
        params[par] = defaults[par]
save_yaml(str(params_file), params, append=False, topcomment=comment)

# ------------------------- Other vedo settings ------------------------ #
settings.screeshotScale = params[
    "DEFAULT_SCREENSHOT_SCALE"
]  # Improves resolution of saved screenshots

if params["SCREENSHOT_TRANSPARENT_BACKGROUND"]:
    settings.screenshotTransparentBackground = True  # vedo for transparent bg
    settings.useFXAA = False  # This needs to be false for transparent bg
    warnings.warn(
        "BRAINRENDER - settings: screenshots are set to have transparent background. Set the parameter 'SCREENSHOT_TRANSPARENT_BACKGROUND' to False if you'd prefer a not transparent background"
    )


# Set to make it easy to import
DEFAULT_ATLAS = params["DEFAULT_ATLAS"]
BACKGROUND_COLOR = params["BACKGROUND_COLOR"]
DEFAULT_HDF_KEY = params["DEFAULT_HDF_KEY"]
DEFAULT_NEURITE_RADIUS = params["DEFAULT_NEURITE_RADIUS"]
DEFAULT_STRUCTURE_ALPHA = params["DEFAULT_STRUCTURE_ALPHA"]
DEFAULT_STRUCTURE_COLOR = params["DEFAULT_STRUCTURE_COLOR"]
DISPLAY_INSET = params["DISPLAY_INSET"]
DISPLAY_ROOT = params["DISPLAY_ROOT"]
HDF_SUFFIXES = params["HDF_SUFFIXES"]
INJECTION_DEFAULT_COLOR = params["INJECTION_DEFAULT_COLOR"]

vedo

A python module for scientific analysis and visualization of 3D objects and point clouds based on VTK and Numpy.

MIT
Latest version published 6 months ago

Package Health Score

71 / 100
Full package analysis

Similar packages