Skip to content

Instantly share code, notes, and snippets.

View romainGuiet's full-sized avatar

romainGuiet

View GitHub Profile
@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
@lacan
lacan / Export Annotations For Stardist.groovy
Last active July 30, 2023 14:32
[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
/*
// ABOUT
Exports Annotations for StarDist (Or other Deep Learning frameworks)
// INPUTS
You need rectangular annotations that have classes "Training" and "Validation"
After you have placed these annotations, lock them and start drawing the objects inside
// OUTPUTS
----------
@romainGuiet
romainGuiet / BIOP-userProject.ijm
Last active June 16, 2021 14:26
A ImageJ macro to create a standardized "User Project" folder. #BIOP #FIJI #Macro #UserProject
#@File(label="Please select an UserName-Lab", style="directory") selected_dir
#@String() projectName
/*
* Macro to create a folder accordingly to BIOP template.
*
*
*
* git need to be installed
import ij.*
import ij.plugin.Duplicator
import ij.io.FileSaver
/**
*
* Here is a groovy script which:
* - Gets information about the current ImagePlus File (via imp.getOriginalFileInfo()),
* - Retrieves its directory
* - Creates an output subfolder