Skip to content

Instantly share code, notes, and snippets.

Avatar
🤝

Olivier Burri lacan

🤝
View GitHub Profile
@lacan
lacan / Demo_OMERO.ijm
Created May 26, 2021
[Demo for OMERO] This is a demo gist for OMERO #OMERO
View Demo_OMERO.ijm
print( "Your OMERO Server is Broken. Come back tomorrow" );
@lacan
lacan / Template matching using OpenCV.groovy
Created May 25, 2021
[Basic OpenCV Template Matching in QuPath] Testing OpenCV for Template Matching and NMS Suppression inside QuPath #qupath #opencv #imagesc
View Template matching using OpenCV.groovy
// 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 Apr 28, 2021
[Useful Shortcuts ActionBar] An ActionBar that contains multiple shortcuts that are useful in Fiji #ImageJ #ActionBar #Fiji
View useful_shortcuts.ijm
// 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 Apr 6, 2021
[Combine XML Files from NIS Elements Positions] Combines multiple positions lists into a single one #Groovy #NISElements #Nikon #XML #Fiji
View CombineNISPositionXMLs.groovy
#@ 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 Mar 24, 2021
[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
View concentric-circles.ijm
/**
* 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 Jan 21, 2021
[MultiStackMonage in a script] This script will use MultiStackMontage to create a montage for all open images in Fiji #Fiji #groovy #biop
View MultiStackMontage All images.groovy
// 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
@lacan
lacan / Parallel_HistrogramEqualize_All_Slices.groovy
Last active Jun 2, 2021
[Parallel Histrogram-Based Normalization] This performs Histogram Based Normalization on all slices of an open stack based on the selected reference slice #fiji #imageJ #histogram #BIOP
View Parallel_HistrogramEqualize_All_Slices.groovy
#@ ImagePlus image
#@ Integer ( label = "Channel to correct (in case of multichannel images)", value = 1 ) ch_correct
#@ Integer ( label = "Reference Slice", value = 1 ) ref_slice
#@ Boolean ( label = "Use Manual Normalization Parameters Below", value = false ) is_normalize
#@ Integer ( Label = "Minimum" ) the_min
#@ Integer ( Label = "Maximum" ) the_max
// This variable will help us at the end to add the normalized channel back
def all_images = []
@lacan
lacan / FWHM.ijm
Created Nov 3, 2020
[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
View FWHM.ijm
/**
* 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 / FlatField_And_Stitch.groovy
Last active Oct 22, 2020
[Flatfield correction followed by stitching] Performs a flatfield correction and stitching from Raw LIF, CZI and LSM files using plugins in Fiji #Fiji #Stitching #Groovy #Flatfield #LIF #LSM #CZI #BIOP
View FlatField_And_Stitch.groovy
/*
* Flatfield correction followed by stitching
*
* It is often the case that tiled microscopy images contain artifacts due to uneven illumination.
* This is due to the shape of the illumination, the quality of the optics and the size of the field of view, but
* losses of up to 50% can be seen between the periphery and the center of a field of view. This loss usually follows
* a parabolic function, but is not necessarily centered, causing artifacts when stitching tiled acquisitions
*
* While many methods exist to compensate for this, the simplest consists in acquiring a 'flat field' image by
* taking a homogeneous sample (Chroma slides or even better, dye solutions [https://www.ncbi.nlm.nih.gov/pubmed/18173639]) and acquiring it for each channel of the dataset
@lacan
lacan / HoughIncompleteCirclesSEM.ijm
Created Sep 3, 2020
[Use of Hough Transform to locate incomplete circles in images] This script segments SEM images containing pores and tries to fit circles to the result
View HoughIncompleteCirclesSEM.ijm
// Hough Transform to find circles,
// Author: Olivier Burri, from a request of the Image.sc forum:
// https://forum.image.sc/t/find-circles-with-incomplete-boundaries/42357
// Due to the simple nature of this code, no copyright applies
#@ImagePlus image
#@Double hough_threshold (value=0.55)
// SOme housekeeping