How to use the napari.utils.status_messages.format_float function in napari

To help you get started, we’ve selected a few napari 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 napari / napari / napari / layers / surface / surface.py View on Github external
    @gamma.setter
    def gamma(self, value):
        self.status = format_float(value)
        self._gamma = value
        self._update_thumbnail()
        self.events.gamma()
github napari / napari / napari / layers / surface / surface.py View on Github external
def contrast_limits(self, contrast_limits):
        self._contrast_limits_msg = (
            format_float(contrast_limits[0])
            + ', '
            + format_float(contrast_limits[1])
        )
        self.status = self._contrast_limits_msg
        self._contrast_limits = contrast_limits
        if contrast_limits[0] < self._contrast_limits_range[0]:
            self._contrast_limits_range[0] = copy(contrast_limits[0])
        if contrast_limits[1] > self._contrast_limits_range[1]:
            self._contrast_limits_range[1] = copy(contrast_limits[1])
        self._update_thumbnail()
        self.events.contrast_limits()
github napari / napari / napari / layers / image / image.py View on Github external
def iso_threshold(self, value):
        self.status = format_float(value)
        self._iso_threshold = value
        self._update_thumbnail()
        self.events.iso_threshold()
github napari / napari / napari / layers / points / points.py View on Github external
def edge_width(self, edge_width: Union[None, float]) -> None:
        self._edge_width = edge_width
        self.status = format_float(self.edge_width)
        self.events.edge_width()
        self.events.highlight()
github napari / napari / napari / layers / shapes / shapes.py View on Github external
def edge_width(self, edge_width):
        self._edge_width = edge_width
        if self._update_properties:
            index = self.selected_data
            for i in index:
                self._data_view.update_edge_width(i, edge_width)
        self.status = format_float(self.edge_width)
        self.events.edge_width()
github napari / napari / napari / layers / base / base.py View on Github external
def opacity(self, opacity):
        if not 0.0 <= opacity <= 1.0:
            raise ValueError(
                'opacity must be between 0.0 and 1.0; ' f'got {opacity}'
            )

        self._opacity = opacity
        self._update_thumbnail()
        self.status = format_float(self.opacity)
        self.events.opacity()
github napari / napari / napari / layers / labels / labels.py View on Github external
def brush_size(self, brush_size):
        self._brush_size = int(brush_size)
        self.cursor_size = self._brush_size / self.scale_factor
        self.status = format_float(self.brush_size)
        self.events.brush_size()
github napari / napari / napari / layers / shapes / shapes.py View on Github external
def opacity(self, opacity):
        if not 0.0 <= opacity <= 1.0:
            raise ValueError(
                'opacity must be between 0.0 and 1.0; ' f'got {opacity}'
            )

        self._opacity = opacity
        if self._update_properties:
            index = self.selected_data
            for i in index:
                self._data_view.update_opacity(i, opacity)
        self.status = format_float(self.opacity)
        self.events.opacity()
github napari / napari / napari / layers / points / points.py View on Github external
def size(self, size: Union[None, float]) -> None:
        self._size = size
        if self._update_properties and len(self.selected_data) > 0:
            for i in self.selected_data:
                self.sizes[i, :] = (self.sizes[i, :] > 0) * size
            self.refresh()
        self.status = format_float(self.size)
        self.events.size()
github napari / napari / napari / layers / image / image.py View on Github external
def gamma(self, value):
        self.status = format_float(value)
        self._gamma = value
        self._update_thumbnail()
        self.events.gamma()