Skip to content

Instantly share code, notes, and snippets.

View lesolorzanov's full-sized avatar
:shipit:

Leslie Evelyn Solorzano lesolorzanov

:shipit:
  • Uppsala, Sweden
View GitHub Profile
@lesolorzanov
lesolorzanov / qupathgeojson.groovy
Last active December 5, 2023 14:19
Save qupath geojson
/*
Author: LESLIE SOLORZANO (do not erase name)
if you make changes then add your name but
don't delete mine to make it look like it's yours.
*/
def annotations = getAnnotationObjects()
def imageData = getCurrentImageData()
def name = GeneralTools.getNameWithoutExtension(imageData.getServer().getMetadata().getName())
def path = "/home/leslie/Downloads/"+name+".json"
@lesolorzanov
lesolorzanov / utils.py
Created March 18, 2021 19:30
some utilities for displaying colorfull cores
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)
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)):
@lesolorzanov
lesolorzanov / QuPathImportAnnotations.groovy
Last active December 9, 2020 10:25
Importig Annotation path objects after classifying outside of QuPath
// 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
@lesolorzanov
lesolorzanov / alpha.py
Last active July 14, 2019 22:33
Draw alpha levels blender
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:
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<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"
@lesolorzanov
lesolorzanov / OSD-D3.js
Last active November 9, 2022 06:28
OSD+D3 create and drag elements
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){
@lesolorzanov
lesolorzanov / isosurfacespots.m
Created January 9, 2017 11:07
Iso surface from image
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;
@lesolorzanov
lesolorzanov / screens.m
Created January 9, 2017 11:05
Enhances spots and creates gimplike screen version
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';