Skip to content

Instantly share code, notes, and snippets.

View romainGuiet's full-sized avatar

romainGuiet

View GitHub Profile
@romainGuiet
romainGuiet / BIOPLib.ijm
Last active August 29, 2015 14:11
A library of macro functions usefull for ActionBars (created using the ActionBar plugin ). Made at EPFL, BIOP, Olivier Burri, Romain Guiet.
// BIOP Functions Library v1.0
/*
* Returns the name of the parameters window, as we cannot use global variables,
* we just define a function that can act as a global variable
*/
function getWinTitle() {
win_title= toolName();
// If something is already open, keep it as-is.
if(!isOpen(win_title)) {
@romainGuiet
romainGuiet / Temporal-Color_Code_BIOP.ijm
Created May 20, 2016 09:23
A lightly modified version of Fiji.app\plugins\Scripts\Image\Hyperstacks\Temporal-Color_Code.ijm so it stops before projection, so you keep a colored stack
/*
************* Temporal-Color Coder *******************************
Color code the temporal changes.
Kota Miura (miura@embl.de)
Centre for Molecular and Cellular Imaging, EMBL Heidelberg, Germany
If you publish a paper using this macro, please acknowledge.
@romainGuiet
romainGuiet / rotateLineAroundCenter.ijm
Created March 14, 2019 08:58
ImageJ macro language : Around a fixed point, get the x,y corrdinates of the points rotating around the center at a defined distance
/*
* Use of the custom function rotateLine(...)
* Around a fixed point, get the x,y corrdinates
* of the points rotating around the Center at a defined distance
*
*/
selectWindow("blobs.gif");
// Center Point coordinates
@romainGuiet
romainGuiet / multi_DoG.ijm
Created March 30, 2019 08:41
An ImageJ macro language script to perform multi_DoG
title = getTitle;
close("\\Others");
roiManager("Reset");
sigma1 = newArray(1,2,3,4,5,10);
for (i = 0 ; i < lengthOf(sigma1) ; i++) {
selectWindow(title);
run("Duplicate...", "title=gb1");
run("Gaussian Blur...", "sigma="+sigma1[i]);
@romainGuiet
romainGuiet / make_ROIs_from_labels.ijm
Created July 3, 2019 09:23
an ImageJ macro to make ROIs from image with labels
roiManager("reset");
getStatistics(area, mean, min, max, std, histogram);
for (i = 1; i <= max; i++) {
setThreshold(i, i);
run("Create Selection");
Roi.setName(IJ.pad(i,6))
roiManager("Add");
}
@romainGuiet
romainGuiet / unzip.py
Last active October 29, 2019 13:32
Export zip file content in current working directory
archive_name = "models.zip"
import os
import zipfile
# retrieve the pat of the current directory (bash command uses !...)
path=!pwd
path = path[0]
# create the archive path using path and archive_name
@romainGuiet
romainGuiet / postprocessing.txt
Created December 3, 2019 14:08
Postprocessing macro for DeepImageJ using StarDist model
name=getTitle();
run("Make Substack...", "channels=1");
rename("Predicted object probability");
proba_ID = getImageID();
run("Fire");
selectWindow(name);
run("Make Substack...", "channels=2-33");
@romainGuiet
romainGuiet / qps-export_annotations_as_ijROIs.groovy
Last active December 20, 2019 11:31
QuPath script (qps) to export the image annotations as a ROIset.zip in a '/ROI Sets' folder. The ROIset.zip saving/naming convention respect the ImageJ's BIOPLib.ijm (from PTBIOP update site).
// = CODE DESCRIPTION =
// Image annotations are saved as a ROIset.zip in a '/ROI Sets' folder, so they can be re-open in Image-j
// The ROIset.zip saving/naming convention respect the ImageJ's BIOPLib.ijm (from PTBIOP update site).
//
// == INPUTS ==
// A QuPath project, with annotations.
//
// == OUTPUTS ==
// The annotations are saved as a ROIset.zip in a '/ROI Sets' folder,
//
@romainGuiet
romainGuiet / LabelImageToRoiManager.groovy
Created January 14, 2020 10:09
Add ROIs to ImageJ roiManager from an image with labels.
// adapted from https://gist.github.com/NicoKiaru/ae00117cd6d33fea500d2867a5e669d9
//
// = CODE DESCRIPTION =
// Add ROIs to ImageJ roiManager from an image with labels.
//
// == INPUTS ==
// A label image, grey or RGB.
//
// == OUTPUTS ==
// Rois in ImageJ roiManager.
@romainGuiet
romainGuiet / qps-export_3D_labels.groovy
Last active June 11, 2020 09:41
a prototype groovy script to export 3D labels from QuPath annotation
/* QuPath-Script to export annotations to label tif images (e.g. to be used for stardist)
Use "Run for project" to export annotations for all images within a QuPath project
Afterwards both images and mask tiffs will be stored in the project subfolder
ground_truth
├── images
└── masks