This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Complex Format EXPORT MACRO | |
* By Olivier Burri @ EPFL - SV - PTECH - BIOP | |
* Given a folder, extracts all series inside all multi-file files with given extension in new folders | |
* Last edit: 13.02.2017 | |
*/ | |
////////////////////// SET PARAMETERS ////////////////////// | |
//////////////////////////////////////////////////////////// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Reduce Detection size to create new cell objects and add measurements | |
* @author Olivier Burri | |
* @date 20240212 | |
*/ | |
// By how much should the existing detections be reduced to create the new "nucleus" | |
def erosionDistancePx = -5 | |
// Should the intensities be measured on a downsampled image? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#@ ImagePlus image | |
#@ Integer ( label = "Channel to correct (in case of multichannel images)", value = 1 ) ch_correct | |
#@ Integer ( label = "Reference Slice", value = 1 ) ref_slice | |
#@ Boolean ( label = "Use Manual Normalization Parameters Below", value = false ) is_normalize | |
#@ Integer ( Label = "Minimum" ) the_min | |
#@ Integer ( Label = "Maximum" ) the_max | |
// This variable will help us at the end to add the normalized channel back | |
def all_images = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Resave image as a pyramidal ome.tiff at the desired downsample and bit depth | |
// @author Olivier Burri | |
// 16-bit magic trick inspired from | |
// https://forum.image.sc/t/software-recommendations-converting-a-32bit-ome-tiff-to-an-8bit-ome-tiff/43043 | |
// But did not use scaling parameter | |
// ****** PARAMETERS ********* | |
// Output downsample (1 for full-resolution) | |
def outputDownsample = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// DISCLAIMER: The algorithm was taken from a ChatGPT prompt "What is the Groovy implementation of the 2D Relative Neighborhood Graph Algorithm" | |
// It is merey an alpha version of the code and has not been thorougly tested at all, nor has the code been optimized. | |
// The original prompt has been slightly modifided to make better use of ImageJ methods to display the graph | |
// Create a list of points for testing | |
def rand = new Random() | |
// Or to make it reproducible | |
//def rand = new Random( 1000 ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#@File originalDir (label="Directory with original VSI Files", style="directory") | |
#@File csvFile (label="CSV File with full VSI file path in columns 1 and new name in column 2") | |
#@String sep (label="CSV separator", value=";") | |
/* | |
* Rename VSI images based on CSV reference file | |
*/ | |
println sep | |
def csvImages = csvFile.readLines()*.split(sep) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Update QuPath URIs | |
* After the migration of our EPFL servers from svfasX to sv-nas1.rcp, some projects fail to open in a timely manner, | |
* especially under Windows when the full path to the server is used (instead of a networked drive). | |
* The reason seems to be that QuPath is waiting for a response from the server, and the timeouts are long, so it takes a | |
* really long time before the "Update URIs" window pops up | |
* | |
* This script aims to assist in fixing that by at least changing the host name (svfasX) to a valid host (sv-nas1.rcp) | |
* that way, QuPath will immediately either find or fail to find the file, restoring normal behavior | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Example creating a dialog to run tasks in a script. | |
// We need to discern between headless and non-headless manually so far | |
// @author Olivier Burri | |
// | |
import qupath.lib.plugins.CommandLinePluginRunner | |
import qupath.lib.gui.PluginRunnerFX | |
// Define the runner, in this case we will not use it but it is quite powerful | |
def runner |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
// 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 | |
---------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Hough Transform to find circles, | |
// Author: Olivier Burri, from a request of the Image.sc forum: | |
// https://forum.image.sc/t/find-circles-with-incomplete-boundaries/42357 | |
// Due to the simple nature of this code, no copyright applies | |
#@ImagePlus image | |
#@Double hough_threshold (value=0.55) | |
// SOme housekeeping |
NewerOlder