Skip to content

Instantly share code, notes, and snippets.

View romainGuiet's full-sized avatar

romainGuiet

View GitHub Profile
run("Close All");
roiManager("reset");
// ring thickness
step = 10 ;
// prepare a test image
setForegroundColor(255, 255, 255);
setBackgroundColor(0, 0, 0);
newImage("Shape", "8-bit black", 512, 512, 1);
makePolygon(258,122,171,192,115,272,167,430,232,350,229,302,289,338,324,300,329,236,411,160);
@romainGuiet
romainGuiet / fake_StarDist3D.groovy
Created February 5, 2021 12:22
a fake StarDist3D combining StarDist2D+TrackMate+LaRoME
#@File image_path
#@RoiManager rm
#@ CommandService command
#@ Double (label="Nuclei Proba. Threshold", value=0.5) threshold_proba_nuc
#@ Double (label="Nuclei min. intensity (A.U.)", value=10) minInt_nuc
#@Integer (label="Max Frame Gap") frameGap
#@Double (label="Linking Max Distance") linkDistance
#@Integer (label="Gap Closing Max Distance") gapClosingDistance
// authors : olvier.burri & romain.guiet (at) epfl.ch
@romainGuiet
romainGuiet / test_optionDisableSmoothing.ijm
Created January 15, 2021 07:47
For the review of the article (https://f1000research.com/articles/9-1380). A macro to test the option "disable smoothing" of the plugin "Process>Subtract Background..."
run("Close All");
run("Blobs (25K)");
img1 = getImageID();
run("Invert LUT");
run("32-bit");
rename("On_disableSmoothing");
run("Duplicate...", "title=Off_disableSmoothing");
img2 = getImageID();
@romainGuiet
romainGuiet / ijs-EasyXT-Filter_detectedSpots.groovy
Last active December 18, 2020 06:28
An example script to show how to filter spots after the detection. #Fiji #EasyXT-Fiji #Imaris #BIOP
name_spots = "pinkySpots";
name_filtered_spots = name_spots+"-filtered";
rt = new ResultsTable()
rt.reset()
// Here teh script expect to find the demo.ims file in the folder Fiji>Plugins>BIOP
def plugins_dir = IJ.getDirectory("plugins")
def biop_dir = new File(plugins_dir , "BIOP")
ims_name = "HeLa_H2B-mcherry_Tubline-EGFP_mitochondria-MitoTracker_reduced.ims"
@romainGuiet
romainGuiet / image_fig.ijm
Last active December 7, 2020 06:42
A imagej macro to create the image from Figure 3, https://f1000research.com/articles/9-1380/v1
oneOval = 1 ;
//size_Array = newArray(1,5,10,20,50,100);
size_Array = newArray(7,9,11,15,20,25,50);
int_Array = newArray(5,10,20,50,100,150,250);
Array.getStatistics(size_Array, size_Array_min, size_Array_max, size_Array_mean, size_Array_stdDev);
//print(size_Array_max);
@romainGuiet
romainGuiet / image_and_pointList_toXML.ijm
Created November 18, 2020 14:16
#macro #xml #LabelImg #ZeroCostDL4Mic #BIOP
/*
* Romain Guiet
* EPFL
* Nov 2020
*
* adapted from : https://raw.githubusercontent.com/bvernay/ImageJ-Macros/master/xml_annotations_tools/roiTOXML.ijm
* Bertrand Vernay
* Imaging Centre IGBMC
* [email protected]
* September 2020
@romainGuiet
romainGuiet / ilastik4fiji.ijm
Created November 6, 2020 10:13
a minimal example of ilastik called from fiji. https://go.epfl.ch/ilastik-tuto-2020 #BIOP #fiji #macro #ilastik
#@ File projectFile
imageName = getTitle();
run("Run Pixel Classification Prediction", "projectfilename="+projectFile+
" inputimage=["+imageName+"]"+
" pixelclassificationtype=Probabilities");
@romainGuiet
romainGuiet / closeOthers.groovy
Last active August 9, 2024 11:19
groovy command equivalent to 'close("\\others")' in macro language. #BIOP #Groovy #Macro
// https://forum.image.sc/t/macro-function-close-others-in-groovy/44630
// Using ID as proposed by @imagejan
import ij.WindowManager
#@ ImagePlus imp
WindowManager.getIDList()
.findAll{ it != imp.getID() }
.each{ WindowManager.getImage(it).close() }
null // suppress result processing by SciJava
@romainGuiet
romainGuiet / ijs-export_lif_zprojAvailable.groovy
Last active November 15, 2024 15:56
A groovy script usable in FIJI to export images of a lif file (should work with other bioformats supported format). User can specify the series to export using comma (1,2,3) or a range using dash (1-5) , or nothing to export all series #BIOP #FIJI #groovy #export #bioformats
#@ File image_path
#@ String seriesNbr
#@ String (choices={"max","avg","sum","none"}) zProj
import org.apache.commons.io.FilenameUtils
import ij.*
import ij.plugin.ZProjector
import ij.io.FileSaver
@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