Skip to content

Instantly share code, notes, and snippets.

View lacan's full-sized avatar
🤝

Olivier Burri lacan

🤝
  • Switzerland
  • 06:15 (UTC +02:00)
View GitHub Profile
@lacan
lacan / bad_code.ijm
Last active November 2, 2021 14:18
[Bad code example] Example short code that does not have any comments or variables #fiji #macro #bestpractices
run("Set Measurements...", "area mean standard modal min limit display redirect=None decimal=3");
run("Split Channels");
selectWindow("C1-Edu+_RFP+_(2).tif")
run("Median...", "radius=5");
setAutoThreshold("Li dark");
run("Create Selection");
selectWindow("C2-Edu+_RFP+_(2).tif");
run("Restore Selection");
@lacan
lacan / Crop Dataset Around Nuclei.groovy
Created October 1, 2021 16:18
[Crop Dataset Around Nuclei] Crops an Imaris Dataset where nuclei were tracked by taking the centroid of each surface at each timepoint #groovy #imaris #cool
/**
* Split Imaris Tracked Nuclei into separate ims files
*
*
* Author: Olivier Burri EPFL SV PTECH BIOP
* for Noémie Chabot, Vastenhouw Lab
*
* Last update: 01-10-2021
*
* Dependencies: EasyXT https://github.com/BIOP
@lacan
lacan / 3D Shell Measurement.groovy
Created July 23, 2021 10:18
[3D Shell Intensities] Segments nucleus and creates concentric shells to measure the average intensity of a channel of interest #Fiji #ImageSC #Macro
// Make 3D Shell and measure intensity at given thicknesses
// By Olivier Burri, EPFL - SV - PTECH - BIOP
// As a response to an ImageSC forum post:
// https://forum.image.sc/t/help-with-shell-analysis-of-nuclei/54342
// Last update: 2021/07/23
raw = getTitle();
close("\\Others");
@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 / Demo_OMERO.ijm
Created May 26, 2021 12:27
[Demo for OMERO] This is a demo gist for OMERO #OMERO
print( "Your OMERO Server is Broken. Come back tomorrow" );
@lacan
lacan / Template matching using OpenCV.groovy
Created May 25, 2021 11:10
[Basic OpenCV Template Matching in QuPath] Testing OpenCV for Template Matching and NMS Suppression inside QuPath #qupath #opencv #imagesc
// Basic Template Matching using OpenCV with distance based NMS
// Author: Olivier Burri, EPFL - SV - PTECH - BIOP
// Inspiration:
// - https://docs.opencv.org/master/d4/dc6/tutorial_py_template_matching.html
// - https://towardsdatascience.com/non-maximum-suppression-nms-93ce178e177c
// Date: 2021-05-25
def downsample = 10
def templateClass = "Template"
def detectedClass = "Detected"
@lacan
lacan / useful_shortcuts.ijm
Last active April 28, 2021 07:57
[Useful Shortcuts ActionBar] An ActionBar that contains multiple shortcuts that are useful in Fiji #ImageJ #ActionBar #Fiji
// Action Bar description file :useful_shortcuts
// Provided by Olivier Burri for PCB-02
// Date: 20210420
// Copy this file (Do not rename it) to your Fiji installation under plugins/ActionBar
run("Action Bar","/plugins/ActionBar/useful_shortcuts.ijm");
exit();
<line>
<button> 1 line 1
label=Close All
@lacan
lacan / CombineNISPositionXMLs.groovy
Created April 6, 2021 07:58
[Combine XML Files from NIS Elements Positions] Combines multiple positions lists into a single one #Groovy #NISElements #Nikon #XML #Fiji
#@ File xmlFolder (label="Folder with XML Files to combine", style="directory")
// List all XML Files
def files = xmlFolder.list({d, f-> f ==~ /.*.xml/ } as FilenameFilter).collect{ new File( xmlFolder, it) }
// Make a result folder
resultfolder = new File( xmlFolder, "combined")
resultfolder.mkdirs()
// Get the reference from which we will append the others to
@lacan
lacan / concentric-circles.ijm
Last active March 24, 2021 17:42
[Concentric Circles Around Donut] Macro to create concentric circles based on relative distance to an outer edge for a "donut-like" shape #fiji #imagej #imagesc
/**
* Macro to create concentric circles and sectors based on relative distance to an outer edge for a "donut-like" shape
*
* Author: Olivier Burri, EPFL - SV - PTECH - BIOP
*
* For Kailie Batsche, from a request on the Image.sc forum:
* https://forum.image.sc/t/cross-sectional-analysis-cut-into-8-equal-sectors-with-three-concentric-rings/50302?u=oburri
*
* Provided under GPL3
* https://www.gnu.org/licenses/gpl-3.0.en.html
@lacan
lacan / MultiStackMontage All images.groovy
Last active January 21, 2021 13:04
[MultiStackMonage in a script] This script will use MultiStackMontage to create a montage for all open images in Fiji #Fiji #groovy #biop
// Makes a montage with the selected settings from all open images
// By Olivier Burri, EPFL - SV - BIOP
// For Matjaz Panjan, Jožef Stefan Institute
// This needs the StackMontage plugin, which is available from the PTBIOP update site
def nRows = 2
def nCols = 1
// SCRIPT START