Skip to content
Snippets Groups Projects
Commit 3a3acf49 authored by Andrey Aristov's avatar Andrey Aristov
Browse files

initial commit

parent 295b4d2e
No related branches found
No related tags found
1 merge request!5fix testing and stuff
Pipeline #73958 failed
%% Cell type:code id:11936ce3-3ddd-4aa3-b907-740aefc2973b tags:
``` python
from napari import Viewer, run
from napari.layers import Image, Layer
from qtpy.QtWidgets import QWidget, QVBoxLayout, QLabel, QListWidget
from magicgui.widgets import create_widget
from matplotlib.backends.backend_qtagg import (
FigureCanvas, NavigationToolbar2QT as NavigationToolbar)
from matplotlib.figure import Figure
```
%% Cell type:code id:d97699e5-db36-46f4-95b9-a56191256ed4 tags:
``` python
class SamplePlugin(QWidget):
def __init__(self, viewer: Viewer):
super().__init__()
self.viewer = viewer
self.select_image = create_widget(annotation=Image)
self.select_mask = create_widget(annotation=Layer)
self.canvas = FigureCanvas(Figure(figsize=(5,5)))
self.ax = self.canvas.figure.subplots()
self.ax.plot([0, 5, 6], [2, 7, 14])
layout = QVBoxLayout()
layout.addWidget(self.select_image.native)
layout.addWidget(self.select_mask.native)
layout.addWidget(self.canvas)
self.setLayout(layout)
def reset_choices(self, event=None):
self.select_image.reset_choices(event)
self.select_mask.reset_choices(event)
```
%% Cell type:code id:df3e9175-ab4f-41da-be36-9e06402ff404 tags:
``` python
viewer = Viewer()
plugin = SamplePlugin(viewer)
viewer.window.add_dock_widget(plugin)
run()
```
%% Output
AICSImageIO: Reader will load image in-memory: False
AICSImageIO: Reader will load image in-memory: False
%% Cell type:code id:4e69ca83-6eb3-41ad-97eb-f18f80223e8c tags:
``` python
viewer.layers[2].data.min().compute()
```
%% Output
0
%% Cell type:code id:c42db7a0-5937-4f7a-9d6e-64de0108b72b tags:
``` python
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment