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
#!/usr/bin/env bash | |
source ~/.bashrc | |
git clone https://github.com/mpicbg-csbd/stardist | |
my_venvs_create stardist_env | |
my_venvs_activate stardist_env | |
pip install tifffile==2019.7.2 # as newer versions somehow wont install on noto | |
pip install stardist |
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 colorsys import rgb_to_hls, hls_to_rgb | |
def _rgb2hls(im): | |
return np.stack(np.vectorize(rgb_to_hls)(*im.transpose(2,0,1)/256), axis=-1) | |
def _hls2rgb(im): | |
return (255*np.stack(np.vectorize(hls_to_rgb)(*im.transpose(2,0,1)), axis=-1)).astype(np.uint8) | |
def invert(img): |
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 csbdeep.utils import normalize | |
def norm_minmse(gt, x, normalize_gt=True): | |
""" | |
normalizes and affinely scales an image pair such that the MSE is minimized | |
Parameters | |
---------- | |
gt: ndarray |
NewerOlder