Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
I may be slow to respond.

Leslie Evelyn Solorzano zloysmiertniy

💭
I may be slow to respond.
View GitHub Profile
@zloysmiertniy
zloysmiertniy / utils.py
Created Mar 18, 2021
some utilities for displaying colorfull cores
View utils.py
import matplotlib.pyplot as plt
from matplotlib.colors import ListedColormap
import pandas as pd
import numpy as np
import seaborn as sns
def plotUMAP(indf,colx,coly,colz,color_col=None,s=5,marker=".",frac=1,linewidths=0,xlim=[-4.0, 15.0],ylim=[-4.0, 15.0],edgecolors=None):
fig=plt.figure(figsize=(9,3),dpi=500)
cycled = [colx,coly,colz,colx]
adf=indf.sample(frac=frac)
View cleanobj.py
import json
import matplotlib.pyplot as plt
import numpy as np
class NumpyEncoder(json.JSONEncoder):
""" Custom encoder for numpy data types """
def default(self, obj):
if isinstance(obj, (np.int_, np.intc, np.intp, np.int8,
np.int16, np.int32, np.int64, np.uint8,
np.uint16, np.uint32, np.uint64)):
@zloysmiertniy
zloysmiertniy / QuPathImportAnnotations.groovy
Last active Dec 9, 2020
Importig Annotation path objects after classifying outside of QuPath
View QuPathImportAnnotations.groovy
// Title: Importig Annotation path objects after classifying outside of QuPath
// Author: Leslie Solorzano
// Date: 9 dec 2020
import qupath.lib.objects.PathObjects
import qupath.lib.roi.ROIs
import qupath.lib.regions.ImagePlane
import qupath.lib.io.GsonTools
import qupath.lib.geom.Point2
import qupath.lib.objects.classes.PathClass
@zloysmiertniy
zloysmiertniy / alpha.py
Last active Jul 14, 2019
Draw alpha levels blender
View alpha.py
location="/home/leslie/Documents/alphaamd/"
imgs=["cells2little.png"]
def drawboxesat(pdx, iw, ih, q):
step=1/q
for x in range(iw):
for y in range(ih):
intensity=pdx[(x,y)][0]
if intensity==0:
View mergiwild.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View iwild.html
<html>
<head>
<script src="https://d3js.org/d3.v4.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.8.0/p5.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="/home/leslie/Downloads/iWildCam_2019_iNat_Idaho.json"></script>
<script src="/home/leslie/Downloads/iWildCam_2019_CCT_Bboxes.json"></script>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css"
@zloysmiertniy
zloysmiertniy / OSD-D3.js
Last active Apr 4, 2018
OSD+D3 create and drag elements
View OSD-D3.js
var exampleapp={
starCount:0,
OSDviewer: null,
init: function(){
var OSDviewer = OpenSeadragon(this.OSDOptions);
this.OSDviewer=OSDviewer;
this.OSDsvgov=this.OSDviewer.svgOverlay();
var click_handler= function(event) {
if(event.quick){
View isosurfacespots.m
close all
clear all
fname ='C:\Users\Administrator\Documents\Leslie\Uppsala\registered161101\crops\b1-2-0001-1757-1887-White Top Hat.tif';
info = imfinfo(fname);
num_images = numel(info);
w =info.Width;
h= info.Height;
@zloysmiertniy
zloysmiertniy / screens.m
Created Jan 9, 2017
Enhances spots and creates gimplike screen version
View screens.m
clear all;
base=5;
if(base==1)
b3=imread('MAX_base_1_ch3.tif');
b4=imread('MAX_base_1_ch4.tif');
b5=imread('MAX_base_1_ch5.tif');
b6=imread('MAX_base_1_ch6.tif');
finalname='b1-color.tif';
View voxelsimagetiff.py
from PIL import Image
import numpy
im=Image.open('C:/Users/Administrator/Documents/Leslie/Uppsala/registered161101/crops/b1-2-0001-1757-1887-White Top Hat.tif')
def makeMaterial(name, diffuse, specular, alpha):
mat = bpy.data.materials.new(name)
mat.diffuse_color = diffuse
mat.diffuse_shader = 'LAMBERT'
mat.diffuse_intensity = 1.0