Skip to content

Instantly share code, notes, and snippets.

View romainGuiet's full-sized avatar

romainGuiet

View GitHub Profile
#@ File(style="directory") dir
frames = 3
IJ.run("Close All", "");
ArrayList<ImagePlus> imps = new ArrayList<>(frames);
dir.eachFile {
//println(it)
@romainGuiet
romainGuiet / random_boxes_in_annotation.groovy
Last active August 21, 2025 08:54
The script expects to find a "Tissue" annotation (optionally this annotation can be generated it via a PixelClassifier, line 40 ) , and then creates defined nbr of boxes in the annotation. #biop #qupath
// Change the name of the tissue classifier here if needed
def tissueFinder = "Tissue"
// Which Name should they have ?
// if annotation with the same name exist they will be deleted
def annotation_name = "Analysis"
@romainGuiet
romainGuiet / thresholds_familiy.ijm
Created June 17, 2025 11:18
show that different thresholds can output similar results
// clear the environment
run("Close All");
roiManager("Reset");
//open an image
run("Fly Brain (1MB)");
// make it composite, duplicate one slice and get information
run("Make Composite");
run("Duplicate...", "duplicate channels=1 slices=27");
getDimensions(width, height, channels, slices, frames);
@romainGuiet
romainGuiet / thresholds.ijm
Created June 17, 2025 11:11
thresholds on gel image
// clear the environment
run("Close All");
run("Clear Results")
roiManager("Reset");
// Set the measurements of intererest
run("Set Measurements...", "area mean standard min limit display redirect=None decimal=3");
run("Gel (105K)");
rename("Original");
@romainGuiet
romainGuiet / BIOP_Flatfield_And_Stitch.groovy
Created June 16, 2025 14:56
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
#@File(label="Multiposition Files Directory",style="directory") image_directory
#@String(value="Select a file for flat field correction or write none", visibility="MESSAGE") textFF
#@File(label="Flatfield Stack File") ff_file
#@int(label="Downsample Factor", style = "slider", min = 1, max = 16, stepSize = 1) downsample
#@Boolean(label="Perform Stitching") is_do_stitch
#@Boolean(label="Compute Overlap") is_compute
#@Boolean(label="Keep Original Bit Depth") is_keep_bit_depth
#@String(label="Macro Mode",choices={"Fuse and display","Write to disk"}) output_type
#@Boolean(label="Save final stitched as *.ids (if write to disk)") save_Stiched_asIDS
#@Boolean(label="Delete temporary files (if write to disk)") delete_temp_files
@romainGuiet
romainGuiet / biop-basic_template.ijm
Created May 5, 2025 09:10
biop-basic template ijm #biop #fiji
// @String(label="Macro Mode",choices={"Current Image","Current Folder"}) modeChoice
// @String(value="Parameters for Detection", visibility="MESSAGE") textDetection
// @Integer(label="Channel for detection",value=1) detection_chNbr
// @Integer(label="Gaussian Blur sigma",value=1) detection_gBlur
// @Integer(label="Find Maxima noise tolerance",value=100) detection_noiseTol
// @Integer(label="Clear False Positive cutoff - 0 to disable",value=200) detection_meanCutOff
// @String(value="Parameters for Measurements", visibility="MESSAGE") textMeasurements
@romainGuiet
romainGuiet / Stitch_Correction.bsh
Created April 9, 2025 12:32 — forked from lacan/Stitch_Correction.bsh
[Stitching with Flatfield Correction] Takes a folder as input and processed all multiseries files there using a provided flatfield file #Beanshell #Stitching #Fiji #ImageJ #BIOP
//@File(label="Multiposition Files Directory",style="directory") image_directory
//@String(value="Select a file for flat field correction or write none", visibility="MESSAGE") textFF
//@File(label="Flatfield Correction File", value="none") ff_file
//@int(label="Downsample Factor", style = "slider", min = "1", max = "16", stepSize = "1") downsample
//@Boolean(label="Compute Overlap") is_compute
//@String(label="Macro Mode",choices={"Fuse and display","Write to disk"}) output_type
//@LogService log
import ij.IJ;
import loci.formats.ImageReader;
@romainGuiet
romainGuiet / make_cells_from_cytos_and_nuclei.groovy
Created October 7, 2024 09:16
A QuPath script to make cell objects from lists of cytos and nuclei
cytos = getDetectionObjects().findAll{it.getPathClass() == getPathClass('cells')}
nuclei = getDetectionObjects().findAll{it.getPathClass() == getPathClass('nuclei')}
print cytos
print nuclei
// Combine cytos and nuclei detections to create cell objects
def cells = cytos.collect{ cyto ->
cell_nucs = nuclei.findAll{ nuc -> cyto.getROI().contains( nuc.getROI().getCentroidX() , nuc.getROI().getCentroidY() )}
if ( !cell_nucs.isEmpty() ) {
#@ ImagePlus imp
#@ Double tolerance
nT = imp.getNFrames()
imp.getStack().
means_vals = (1..nT).collect{
imp.setT(it)
return imp.getStatistics().mean
}
@romainGuiet
romainGuiet / Seurat.groovy
Last active August 20, 2025 14:05
make detection of a define size
/* = CODE DESCRIPTION =
* This QuPath script fills thae image Annotations objects with circular detections objects of a user defined diameter.
* In combination with "Measure > Show measurements maps" it can be helpfull to quickly create meaningful heatmaps.
*
* == INPUTS ==
* Annotation(s) and RegionOfInterest diamater (in microns)
*
* == OUTPUTS ==
* circular detections objects of a user defined diameter
*