This file contains hidden or 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 sys, asyncio, random, threading, datetime | |
from qtpy.QtWidgets import QApplication, QProgressBar | |
from asyncqt import QEventLoop, QThreadExecutor | |
app = QApplication(sys.argv) | |
loop = QEventLoop(app) | |
asyncio.set_event_loop(loop) | |
progress = QProgressBar() |
This file contains hidden or 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 PyQt5.QtWidgets import ( | |
QPushButton, | |
QComboBox, | |
QTabWidget, | |
QHBoxLayout, | |
QFileDialog, | |
QDialogButtonBox, | |
QWidget, | |
QSlider, | |
) |
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 hidden or 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
# Volker Hilsenstein | |
# BSD-3 license | |
import numpy as np | |
import skimage.morphology | |
from rotating_calipers import min_max_feret | |
def get_min_max_feret_from_labelim(label_im, labels=None): | |
""" given a label image, calculate the oriented | |
bounding box of each connected component with |
This file contains hidden or 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 paramiko | |
k = paramiko.RSAKey.from_private_key_file("/Users/whatever/Downloads/mykey.pem") | |
c = paramiko.SSHClient() | |
c.set_missing_host_key_policy(paramiko.AutoAddPolicy()) | |
print "connecting" | |
c.connect( hostname = "www.acme.com", username = "ubuntu", pkey = k ) | |
print "connected" | |
commands = [ "/home/ubuntu/firstscript.sh", "/home/ubuntu/secondscript.sh" ] | |
for command in commands: | |
print "Executing {}".format( command ) |
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 hidden or 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 hidden or 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 time | |
import napari | |
import numpy as np | |
from napari.qt import thread_worker | |
from qtpy.QtWidgets import QPushButton, QVBoxLayout, QWidget | |
PROPNAME_ACQUIRED = "acquired" | |
#def generate_point_grid(nx=500, ny=100, dx=20, dy=20): # starting to lag with current napari master | |
def generate_point_grid(nx=1500, ny=100, dx=20, dy=20): # still working with Martin's branch |
This file contains hidden or 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 time | |
import napari | |
import numpy as np | |
from napari.qt import thread_worker | |
from qtpy.QtWidgets import QPushButton, QVBoxLayout, QWidget | |
# Point property for MALDI points | |
PROPNAME_ACQUIRED = "acquired" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.