Skip to content

Instantly share code, notes, and snippets.

View kephale's full-sized avatar

Kyle I S Harrington kephale

View GitHub Profile
@kephale
kephale / solution.py
Last active March 19, 2024 16:10
pix2pix album solution
###album catalog: cellcanvas
# based on https://github.com/IvanHCenalmor/DL4MicEverywhere/blob/main/notebooks/ZeroCostDL4Mic_notebooks/pix2pix_DL4Mic/configuration.yaml
# and https://github.com/betaseg/solutions/blob/main/solutions/io.github.betaseg/cellsketch-plot/solution.py
import shutil
from album.runner.api import setup
###album catalog: cellcanvas
# based on https://github.com/IvanHCenalmor/DL4MicEverywhere/blob/main/notebooks/ZeroCostDL4Mic_notebooks/pix2pix_DL4Mic/configuration.yaml
# and https://github.com/betaseg/solutions/blob/main/solutions/io.github.betaseg/cellsketch-plot/solution.py
import shutil
from album.runner.api import setup
@kephale
kephale / hs_err_pid9714.log
Created March 9, 2024 22:49
sciview fatal error report
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00000002bf89d8b0, pid=9714, tid=34051
#
# JRE version: OpenJDK Runtime Environment Zulu21.32+17-CA (21.0.2+13) (build 21.0.2+13-LTS)
# Java VM: OpenJDK 64-Bit Server VM Zulu21.32+17-CA (21.0.2+13-LTS, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, bsd-aarch64)
# Problematic frame:
# C [libMoltenVK.dylib+0x3d8b0]
#
@kephale
kephale / mrc_neuroglancer.py
Last active February 6, 2024 18:06 — forked from aganders3/mrc_neuroglancer.py
A script to open an MRC file (generally CryoET data) and host it for viewing with Neuroglancer
# open an MRC file (optionally using mmap) and host it using Neuroglancer as a LocalVolume
# usage: python -m mrc_neuroglancer.py --mrcfile <filename> [--mmap] [--bind-address ADDRESS]
#
# requirements may be installed from PyPI:
# neuroglancer
# mrcfile
import argparse
import signal
@kephale
kephale / zebrahub_test.py
Created October 3, 2023 18:00
zerbahub test
from ome_zarr.io import parse_url
from ome_zarr.reader import Reader
def open_zebrahub():
# url = "https://public.czbiohub.org/royerlab/zebrahub/imaging/single-objective/ZSNS002.ome.zarr/"
url = "https://public.czbiohub.org/royerlab/zebrahub/imaging/single-objective/ZSNS001.ome.zarr/"
# read the image data
parse_url(url, mode="r").store
@kephale
kephale / kishimisu_animation.py
Created September 26, 2023 14:31
napari port of a cool shadertoy example by kishimisu
"""
This is based on the shader: https://www.shadertoy.com/view/mtyGWy
Originally written by kishimisu
Adapted to napari by Kyle Harrington, kyle@kyleharrington.com
At the time of the port the license was not explicitly licensed, so it uses the default shadertoy license:
Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
"""
import numpy as np
import vispy.color
@kephale
kephale / conda-nesoi.txt
Created August 9, 2023 17:20
nesoi environment on 2023 - 08 - 09
# packages in environment at /Users/kharrington/mambaforge/envs/nesoi:
#
# Name Version Build Channel
absl-py 1.4.0 pypi_0 pypi
accelerate 0.20.3 pypi_0 pypi
accessible-pygments 0.0.4 pyhd8ed1ab_0 conda-forge
aiobotocore 2.4.2 pyhd8ed1ab_0 conda-forge
aiofiles 22.1.0 pyhd8ed1ab_0 conda-forge
aiohttp 3.8.4 py310h8e9501a_0 conda-forge
aioitertools 0.11.0 pyhd8ed1ab_0 conda-forge
This file has been truncated, but you can view the full file.
[[[1.0, 116.92097388271767, -4.598420288671646, -23.936646678532615], [1.0, 103.68266355573473, -49.87195901553477, -44.583228015516625], [1.0, 108.41945798490976, -46.27169108620969, -4.9600873358340465], [1.0, -116.920973882711, -4.598420288672241, -23.936646678532103], [1.0, -103.68266355573468, -49.8719590155349, -44.583228015516156], [1.0, -108.41945798491003, -46.27169108620932, -4.9600873358329585], [1.0, -82.54865504023867, -83.08064643634603, -22.96365139711661], [1.0, -42.79281708169038, -107.89146235845863, -36.602685956108836], [1.0, -45.81604452552704, -108.3093635596831, -6.9700256303034545], [1.0, 109.13583187842107, 38.62528020965843, 35.74370111240102], [1.0, 88.25946878169624, 77.47336660034851, 12.38253808285129], [1.0, 111.45673143285693, 38.23197562393818, -4.955896052733908], [1.0, -100.26280550519328, -41.97138499460798, -81.60187539067188], [1.0, -83.93552968584551, -70.36400230500367, -78.71280877892383], [1.0, -74.75559083692049, -61.47333040118816, -113.2499607458118], [1.0, 42.7109
"""Visualizing optical flow in napari.
Adapted from the scikit-image gallery [1]_.
In napari, we can show the flowing vortex as an additional dimension in the
image, visible by moving the slider. We can also take advantage of the reverse
Phi illusion [2]_ to simulate a vortex continuously flowing in one direction.
To do this, we repeat the two vortex frames with inverted contrast at the end.
When using the slider Play button, we perceive a continously flowing vortex
aligned with the displayed vector field.
@kephale
kephale / output.log
Created May 15, 2023 14:58
Output from a run of nesoi/examples/mandelbrot_vizarr.py during development of progressive loading
Python 3.10.8 | packaged by conda-forge | (main, Nov 22 2022, 08:25:13) [Clang 14.0.6 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import logging
... import sys
... import heapq
... from typing import Tuple, Union
...
... import dask.array as da
... import napari
... import numpy as np