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 shapely.geometry.polygon import Polygon | |
from shapely.geometry import GeometryCollection, LineString | |
def napari_shape_to_shapely(coords: np.ndarray, shape_type: str = "polygon"): | |
""" | |
Convert an individual napari shape from a shapes layer to a shapely object | |
There is no direct correspondence between a 'rectangle' in napari and a 'box' in |
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 __future__ import annotations | |
from qtpy.QtWidgets import QWidget, QFileSystemModel, QTreeView, QGridLayout, QPushButton, QFileDialog | |
from qtpy.QtCore import Qt, QModelIndex | |
import os | |
from skimage import io | |
import napari | |
class Explorer(QWidget): | |
def __init__(self, viewer:"napari.Viewer", path:str=""): |
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 napari | |
import numpy as np | |
class MtModel: | |
def __init__( | |
self, | |
npf: int = 13, | |
start: int = 3, | |
space: float = 4.0, | |
radius: float = 9.8, |