Skip to content

Instantly share code, notes, and snippets.

Avatar
🤝

Olivier Burri lacan

🤝
View GitHub Profile
@lacan
lacan / Parallel_HistrogramEqualize_All_Slices
Last active Nov 3, 2020
[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
#@ 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
@lacan
lacan / Local_Thickness_Parallel.groovy
Last active Oct 22, 2020
[Run Fiji Local Thickness in Parallel] this script can crop blob-like objects in an image using `Find Maxima` and runs `Local Thickness` on each cropped image. #fiji #imagej #imagesc #localthickness #BIOP
View Local_Thickness_Parallel.groovy
/**
* This script computes local thickness on binary images which (optionally) contain an ROI to be analyzed
* The goal is to run local thickness in parallel to detect blob like structures that are quite far apart from each other.
* To achieve this, we scale down the original image, blur it, detect maxima
* Each maxima is then used as the center of a box to crop the original image
* Each cropped image is processed in parallel for local thickness
* Reply to an Image.sc forum post: https://forum.image.sc/t/local-thickness-run-time/42143/
* Licensed under BSD 3 license
* Copyright Olivier Burri 2020
* Copyright 2020 Olivier Burri
@lacan
lacan / CountSpots1NearSpots0.groovy
Created Jul 6, 2020
Fiji Spot Counting Example
View CountSpots1NearSpots0.groovy
// Script for computing distances from modern spot counter ROIs in Fiji
// Created by Olivier Burri, EPFL BioImaging & Optics Platform, EPFL - BIOP
// ( for @Gabriel on the image.sc forum
// https://forum.image.sc/t/distance-based-colocalization-of-multi-point-tool-points-in-fiji-imagej/39855?u=oburri
// Due to the simple nature of this code, no license applies
#@ImagePlus imp
#@Double distance (label="Distance [um]", value=20)
// Get ROIs
@lacan
lacan / Export Annotations For Stardist.groovy
Last active Nov 15, 2020
[QuPath Script To Export Annotations For Stardist] this script will take rectangular annotations in QuPath and export them and their containing objects as images and masks for deep neural netowrk training #qupath #stardist #BIOP
View Export Annotations For Stardist.groovy
/*
// ABOUT
Exports Annotations for StarDist (Or other Deep Learning frameworks)
// REQUIREMENTS
You will need to install the BIOP Extension for QuPath which contains methods needed to run this code
https://github.com/BIOP/qupath-biop-extensions/releases/tag/v2.0.0
// INPUTS
@lacan
lacan / BigStitcher_Flip_Axes.groovy
Last active Oct 28, 2019
[BigStitcher Flip Axes] Implements the Flip Axes Command from BigStitcher in a Macro Recordable Way #SPIM #BigStitcher #Fiji #Groovy
View BigStitcher_Flip_Axes.groovy
/**
* Implements the Flip Axes Command from BigStitcher
*
* Recommendation is to place this file in
* [FIJI Folder]/plugins/Scripts/Plugins/BigStitcher/Custom Scripts
*
* By Olivier Burri for Kai Schleicher,
* https://forum.image.sc/t/bigstitcher-flip-axes-in-headless-mode/30557?u=oburri
* BSD 3 License
*
@lacan
lacan / find_delaunay_neighbors_distance_demo.ijm
Last active Dec 8, 2018
[Neighbors from Delaunay] Find Average Neighbor Distance From Delaunay Triangulation Demo #ImageJ #Fiji #Macro
View find_delaunay_neighbors_distance_demo.ijm
/**
* Demo of using Delaunay triangulation to find average inter-neighbor distances
* In reply to ImageJ forum post:
* http://forum.imagej.net/t/measuring-distance-to-neigbours/10712
*
* Olivier Burri, EPFL BIOP (BioImaging And Optics Platform)
* May 1st 2018
*
* Provided as-is under Creative Commons Attribution 4.0 International License
* https://creativecommons.org/licenses/by/4.0/
@lacan
lacan / Histogram_Matching_Parallel.groovy
Last active Oct 22, 2020
[Parallel Histogram Matching for Stacks] #Groovy #Fiji #ImageJ
View Histogram_Matching_Parallel.groovy
//@File (label="Directory with file(s)", style="directory" ) theDir
//@Integer (Label="Channel To Correct") ch_correct
//@Boolean (label="Use Normalization Parameters Below") is_normalize
//@Integer (Label="Minimum") the_min
//@Integer (Label="Maximum") the_max
/**
* Image stack equalizer for image folder
*
* The purpose of this script is to use the histogram of the first slice of the first image
You can’t perform that action at this time.