Skip to content

Instantly share code, notes, and snippets.

View kwolbachia's full-sized avatar

Kevin Terretaz kwolbachia

  • CRBM - CNRS
  • Montpellier
View GitHub Profile
@Svidro
Svidro / !Coding helper scripts for QuPath
Last active October 15, 2024 05:58
Coding helper scripts for QuPath
Collections of scripts harvested mainly from Pete, but also picked up from the forums
If you are starting with 0.2.0m4+ START HERE: https://petebankhead.github.io/qupath/2019/08/21/scripting-in-v020.html
TOC
Access objects in other project images.groovy - in later versions of 0.2.0M#, access the hierarchies of other images
Access other project images or data.groovy
Access project metadata.groovy - interact with user defined, per image metadata. Useful for sorting projects.
@ekatrukha
ekatrukha / 3D_tilt_stack_v1.ijm
Created February 7, 2019 18:03
ImageJ macro making a tilted movie out of Z-stack
//ImageJ macro making a tilted movie out of stack
//uses shear transform + rotation
//Eugene Katrukha katpyxa at gmail.com
requires("1.48h");
sTitle=getTitle();
sMovieTitle=sTitle+"_tilt_movie";
setBatchMode(true);
//Dialog
@mutterer
mutterer / Better_Wand_Tool.ijm
Last active January 4, 2024 17:42
Better Wand Tool
macro "Better Wand Tool - C000T0f10BT7f10WTff10T" {
if (!isOpen("ROI Manager")) run("ROI Manager...");
smoothness= call('ij.Prefs.get','bwt.selectSmoothness',3);
getCursorLoc(x, y, z, flags);
id=getImageID;
setBatchMode(1);
run("Select None");
run("Duplicate...","title=a");
run("Gaussian Blur...", "radius="+smoothness);
id2=getImageID;
@mutterer
mutterer / makeLut_.ijm
Created May 28, 2021 09:33
creates a linear lookup table between color a and color b
run("Boats");
makeLut("#009100","#ccff42");
function makeLut(a,b) {
a = Color.toArray(a);
b = Color.toArray(b);
reds=newArray(256);
greens=newArray(256);
blues=newArray(256);
for (i=0;i<reds.length;i++) {
@mutterer
mutterer / warhiants.ijm
Last active July 18, 2021 22:53
ImageJ macro that creates a montage with hue shifted image copies.
// emoji from https://emojipedia.org/
url="https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/120/whatsapp/273/face-with-medical-mask_1f637.png";
hues=8;
open(url);
setBatchMode(1);
run("Duplicate...","title=temp");
Color.setForeground("blue");floodFill(0, 0);
run("Size...", "width="+Image.width+" height="+Image.height+" depth="+hues+" constrain average interpolation=Bilinear");
run("HSB Stack");
Stack.getDimensions(width, height, channels, slices, frames);
@mutterer
mutterer / 2D_Gaussian_Fit_Tool.ijm
Last active November 29, 2022 17:40
2D_Gaussian_Fit_Tool.ijm
var r =6;
macro "2D Gaussian Fit Tool - C00cT0f16GTbf16f" {
setBatchMode(1);
getCursorLoc(x, y, z, f);
while (f&16>0) {
Overlay.clear;
getCursorLoc(x, y, z, f);
makeRectangle(x-r,y-r,2*r,2*r);