This file contains hidden or 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 idFile ( label="'Index.idx.xml' file" ) | |
#@ File saveFolder ( label="Save Folder", style="directory" ) | |
// Define stitching parameters. Nothing here is flexible but feel free to try | |
def params = new mpicbg.stitching.StitchingParameters() | |
params.channel1 = 0; | |
params.channel2 = 0; | |
params.timeSelect = 0; | |
params.checkPeaks = 5; | |
params.fusionMethod = 0 |
This file contains hidden or 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 image_dir1 ( label="First directory", style="directory" ) | |
#@ File image_dir2 ( label="Second directory", style="directory" ) | |
#@ Boolean save_plot ( label="Save plot?" ) | |
#@ Boolean save_data ( label="Save Data points?" ) | |
#@ String threshold_method (label="Threshold method", choices={"Fixed 1/7", "Half-bit", "Three sigma"}) | |
import ch.epfl.biop.frc.FRC | |
import ch.epfl.biop.frc.FRC.ThresholdMethod | |
import ij.IJ |
This file contains hidden or 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
// Reference: https://forum.image.sc/t/basic-macro-help-rois-to-svg/7861/3 | |
#@ File svgFile ("style=save") | |
svg = "<?xml version=\"1.0\" ?><svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:jfreesvg='http://www.jfree.org/jfreesvg/svg' width='"+getWidth()+"' height='"+getHeight()+"'>\n"; | |
n = roiManager("count"); | |
for (j = 0; j < n; j++){ | |
roiManager("select", j); | |
getSelectionCoordinates(x, y); | |
text = "<path d='m"; |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
// Define Clusters based on distance and from cells with different classifications | |
// This script works for images wehre multiple cell signals are segmented as detections | |
// The detections must be children of annotations objects | |
// And then a clustering step is used to get multi-classification cells | |
// The clustering results are provided as circles withg name "Cluster" so you can filter from the original detections | |
// Works in QuPAth 0.4.3 | |
// | |
// @author Olivier Burri | |
// @date 20230425 |
This file contains hidden or 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) |
NewerOlder