Skip to content

Instantly share code, notes, and snippets.

View romainGuiet's full-sized avatar

romainGuiet

View GitHub Profile
@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 July 5, 2023 09:15
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
*
@romainGuiet
romainGuiet / RUN_mulitpleParam_Cellpose.groovy
Created March 16, 2022 13:48
A groovy script to batch test param for cellpose
#@File file_path
IJ.run("Close All", "");
// the folder containing the lif
dir = file_path.getParent()
// a subfolder to save images
output_dir = new File( dir ,"outputRom1PC")
output_dir.mkdir()
@romainGuiet
romainGuiet / make_3D_labels.groovy
Created October 27, 2021 13:53
Convert a Labels image to Measurements image (requires morpholibJ)
#@ImagePlus imp // imp should be a 3D label image
#@String stat_name // morpholibJ output table after Analyze Regions 3D
// using morpholibJ , update site : IJPB-plugins
IJ.run("Analyze Regions 3D", "voxel_count volume surface_area mean_breadth sphericity euler_number bounding_box centroid equivalent_ellipsoid ellipsoid_elongations max._inscribed surface_area_method=[Crofton (13 dirs.)] euler_connectivity=6");
// Duplicate the imp and make it 32-bit
imp_label = imp.duplicate();
IJ.run(imp_label, "32-bit", "");