Skip to content

Instantly share code, notes, and snippets.

View votti's full-sized avatar
🎯
Focusing

Vito Zanotelli votti

🎯
Focusing
View GitHub Profile
@votti
votti / cmap_to_bw.py
Created June 14, 2021 17:07
Convert a colormap to BW based on the lightness component of LAB
from skimage import color
def cmap_to_bw(cmap, minlight = 60):
"""
Converts a hex colormap to a colormap of contrasting black and white colors.
Args:
cmap: a colormap as iterable of hex values, eg bokeh.palettes.plasma(10)
minlight: a threshold for the lightness
"""
cols = [tuple(int(h[i+1:i+3], 16)/256 for i in (0, 2, 4)) for h in cmap]
@votti
votti / cp318_environment.yml
Created November 1, 2019 15:17
Working Cellprofiler 3.1.8 conda environment
# run: conda env create -f cp318_environment.yml
# run: conda env update -f cp318_environment.yml
# activate: conda activate cellprofiler318
name: cellprofiler318
# in order of priority: highest (top) to lowest (bottom)
channels:
- anaconda
- goodman # mysql-python for mac
- bioconda
- cyclus # java-jdk for windows
@votti
votti / imc_ome_cropping_example.ipynb
Created June 3, 2019 10:55
IMC ome cropping example
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@votti
votti / adjust_label_example.ipynb
Created October 24, 2018 14:40
Shows how the AdjustText package can be used together with plotnine
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@votti
votti / notes.md
Created May 24, 2018 14:17
Random notes
@votti
votti / compensate_imc_txt_file.Rmd
Last active February 9, 2018 08:33
Example how to compensate imc .txt files using CATALYST
---
title: ".txt file image compensation"
author: 'Vito Zanotelli et al.'
output:
html_document:
df_print: paged
keep_md: true
---
# Aim
This shows how to compensate a .txt file using CATALYST