Skip to content

Instantly share code, notes, and snippets.

View lacan's full-sized avatar
🤝

Olivier Burri lacan

🤝
View GitHub Profile
@lacan
lacan / FWHM.ijm
Last active May 4, 2023 11:06
[1D Full Width At Half Maximum] This computes the Full Width at Half Maximum FWHM in an image for anz line profile drawn on the image and added to the ROI manager #fiji #imageJ #BIOP #FWHM
/**
* Calculate 1D Full Width at half Maximum of a single line or a series of lines added to the ROI Manager
* Created by Olivier Burri and Romain Guiet, BioImaging & Optics Platform (BIOP)
* Last Update: 2020.10.21
*
* Due to the simple nature of this code, no copyright applies
*
* Installation
* ------------
* From within Fiji Please use "Plugins > Macros > Install" and select this file
@lacan
lacan / Cluster detections by distance and different classes.groovy
Last active April 25, 2023 10:44
[Cluster detections by distance and different classes] Clusters detections with different classifications into clusters based on distance #qupath #groovy
// Define Clusters based on distance and from cells with different classifications
// This script works for images wehre multiple cell signals are segmented as detections
// The detections must be children of annotations objects
// And then a clustering step is used to get multi-classification cells
// The clustering results are provided as circles withg name "Cluster" so you can filter from the original detections
// Works in QuPAth 0.4.3
//
// @author Olivier Burri
// @date 20230425
@lacan
lacan / Threshold_HDAB_regions_using_ImageJ.groovy
Last active February 17, 2023 11:33
[Threshold HDAB regions using ImageJ] Uses ImageJ's Thresholder to create a selection that gets passed to QuPath as an Annotation or Detection #QuPath #ImageJ #Groovy
import java.awt.Color
import ij.process.ColorProcessor
import ij.process.AutoThresholder
import ij.plugin.filter.ThresholdToSelection
import ij.IJ
// modified from :
// https://petebankhead.github.io/qupath/scripting/2018/03/08/script-imagej-to-qupath.html
// This scripts allow threholding of a color deconvoltuion channel ('DAB', 'Hematoxylin',...)
@lacan
lacan / Export Contiguous Fields.groovy
Last active February 15, 2023 06:20
[Operetta Export Contiguous Fields] Uses Flood filling on the fields to find which ones are direct neighbors and exports each as a separate ImagePlus. Example #Operetta #Fiji #Groovy #BIOP
// This script was created for Anna Hamacher, as per an internal discussion on the ImageSC forum
// that stemmed from https://forum.image.sc/t/viewing-slide-scans-from-operetta-perkin-elmer-cls-as-overview-montage-images/52942/13?u=oburri
// Code by Olivier Burri, EPFL - SV - PTECH - BIOP
// Edited by Anna Hamacher
// Last edition: July 2022
#@ File dir (label="Images Folder", style="directory")
#@Integer downsample (label="Downsample Factor", value=1)
#@String z_projection_method (label = "Projection Type", choices = {"No Projection", "Average Intensity", "Max Intensity", "Min Intensity", "Sum Slices", "Standard Deviation", "Median"} )
#@File outputDir (label="Output directory", style="directory")
@lacan
lacan / Assess_Bleach.ijm
Created January 25, 2023 09:57
[Quickly Assess Bleaching] Quick tool for assessing bleaching in Fiji from a copied XY data table from ZEN or LAS-X #Fiji #Macro #Bleaching #ZEN #LASX
macro "Assess Bleaching [F2]" {
// Measure Half time and relate it to number of frames
run("Close All");
// Get the contents of the clipboard as text
text = String.paste;
// Split the lines and then the rows so as to get the X and Y coordinates
line = split(text, "\n");
n = line.length;
@lacan
lacan / curvature_radius.bsh
Last active October 13, 2022 15:18
Curvature radius simple calculation for ImageJ/fiji #Fiji #Beanshell #Curvature #ImageJ
/*
* Simple script that takes a selection and computes the curvature radius for the whole perimeter of the shape.
*
* By Olivier Burri,
* BioImaging and Optics Platform, BIOP
* Ecole Polytechnique Fédérale de Lausanne (EPFL)
* Last update: May 2017
*
*
*/
@lacan
lacan / Complex Workflow Demo.groovy
Created September 29, 2022 09:01
[Complex Workflow Demo] A demonstration of how a a QuPath workflow can become a script for complex analysis of multiplex data #QuPath #workflow #demo
// This workflow represents the end result that can be obtain by following Dr. Sara McArdle's "Running a complex project in QuPath" tutorial at https://www.youtube.com/watch?v=7AvuzAgHk5o
// @author Olivier Burri
// Prepare the image type
setImageType('FLUORESCENCE')
// Clean up the current image data, as we assume we will be starting from scratch
clearAllObjects()
// Directly create detections from a previously created pixel classifier called "Ck"
@lacan
lacan / Convert Images Using QuPath.groovy
Created September 6, 2022 07:56
[Convert Images to Pyramids using QuPath in Parallel] this is pretty fast and works for RGB images. To run in Fiji #fiji #qupath #ome-tiff
#@ File imagesDirectory (label="Directory with images", style="directory")
#@ String extension (label="Image extension", value="tif")
#@ String quPathExe (label="Path to QuPath Executable", value="C:/QuPath-0.3.2/QuPath-0.3.2 (console).exe")
import groovyx.gpars.GParsPool
def folder = imagesDirectory
def convertedFolder = new File( folder.getParent(), "converted")
convertedFolder.mkdirs()
@lacan
lacan / Data_To_Midi.groovy
Created August 24, 2022 09:23
[Data to MIDI sound] Use results from a Results table as notes to form a melody #midi #imagej
#@ File saveLocation (label="Location of MIDI save file")
/**
* Testing Spots to Sound using MIDI
* Each hit is given a unique note based on some metric and intensity is related to volume
*
* = AUTHOR INFORMATION =
* Code written by Olivier Burri, EPFL - SV - PTECH - BIOP
* for Samuel Vernon, McCabe Lab
* 2022.08.23
@lacan
lacan / TrackMate-StarDist.groovy
Created March 9, 2022 15:23
[TrackMate with Custom StarDist Model] Run TrackMate from a script and save the results. #fiji #stardist #trackmate
/**
* Use StarDist in TrackMate from the latest version and export results
* Using a custom StarDist Model
* Author: Olivier Burri, EPFL SV PTECH BIOP
* Last Modification: March 2022
*
* Due to the simple nature of this code, no copyright is applicable
*
*/