Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Display many points layers | |
""" | |
import numpy as np | |
import napari | |
from time import time | |
data = [] | |
for i in range(50): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from ..utils.events import EmitterGroup | |
class Extent: | |
"""Extent object holding minimum and maximum values of data. | |
Parameters | |
---------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TransformChain(ListModel, Transform): | |
def __init__(self, transforms=[]): | |
super().__init__( | |
basetype=Transform, | |
iterable=transforms, | |
lookup={str: lambda q, e: q == e.name}, | |
) | |
def __call__(self, coords): | |
return tz.pipe(coords, *self) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def generate_3D_path_meshes_2D(path, p=(0, 0, 1)): | |
"""Generates list of mesh vertices and triangles from a path | |
Parameters | |
---------- | |
path : (N, D) array | |
Vertices specifying the path where D is 2 or 3. | |
p : 3-tuple, optional | |
orthogonal vector for segment calculation in 3D. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def _get_viewer_thumbnail(self): | |
"""Creat an overall thumbnail based on the layer thumbnails.""" | |
thumbnail = np.zeros(layers.Layer._thumbnail_shape, dtype=np.uint8) | |
for layer in self.layers[::-1]: | |
if layer.blending == 'translucent': | |
f_dest = thumbnail[..., 3][..., None] / 255 | |
f_source = 1 - layer.thumbnail[..., 3][..., None] / 255 | |
elif layer.blending == 'additive': | |
f_dest = thumbnail[..., 3][..., None] / 255 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Interactive test for range slider. | |
""" | |
# starts the QT event loop | |
from napari._qt.range_slider.range_slider import QVRangeSlider | |
from napari.util import app_context | |
with app_context(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from skimage import data | |
from skimage.color import rgb2gray | |
from napari import Viewer | |
from napari.util import app_context | |
# THIS WILL NOT WORK UNTIL THERE IS SEPARATION BETWEEN MODEL AND VIEW! | |
def test_dims_and_ranges(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is in interactive test | |
from time import sleep | |
import threading | |
from napari.components import Dims | |
from napari.components._dims._constants import DimsMode | |
from napari.components._dims.view import QtDims | |
from napari.util import app_context |
NewerOlder