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
/** | |
* Groovy script to convert a binary image into one in which every foreground pixel | |
* has a value equal to the area of the (8-connected) region containing it. | |
* | |
* Why? | |
* | |
* Well, this gives a way to apply an area-based threshold quickly and intuitively. | |
* Simply set a threshold on the area map, and apply it to create a new binary image. | |
* | |
* Created by Pete on 22/11/2016. |
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
/** | |
* Testing different methods of accessing pixel values from | |
* an ImageProcessor within ImageJ1. | |
* | |
* (Personally, I prefer getf(x, y)....) | |
* | |
* Created by Pete on 23/11/2016. | |
*/ | |
import ij.process.* |
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
/** | |
* Export a thumbnail image, with and without an overlay, using QuPath. | |
* | |
* For tissue microarrays, the scripting code written by the 'File -> Export TMA data' | |
* command is probably more appropriate. | |
* | |
* However, for all other kinds of images where batch export is needed this script can be used. | |
* | |
* @author Pete Bankhead | |
*/ |
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
/** | |
* Simple script to assign metadata values to TMA cores according to row. | |
* | |
* @author Pete Bankhead | |
*/ | |
import qupath.lib.scripting.QP | |
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
/* | |
* Assign a selected annotation to be a child of whichever TMA core contains its centroid. | |
* | |
* This can be useful whenever an annotation is drawn *slightly* overlapping the core, | |
* and so is not automatically assigned to be a child of the core - but it should be. | |
* | |
* @author Pete Bankhead | |
*/ | |
// Ensure annotation is selected! |
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
// Change this to reflect the path to QuPath! | |
// Here, I'm using a Mac. | |
// Note: I copied all native libraries (*.dylib, *.jnilib) into Fiji.app/lib/macos so that they could be found. | |
def pathQuPath = "/Users/pete/Desktop/QuPath.app/Contents/Java/" | |
// Get the Groovy classloader | |
def cl = this.class.classLoader | |
// Figure out where the main QuPath Jars are to be found | |
def dirBase = new File(pathQuPath) |
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
// Prompt to get sigma values for the Difference of Gaussians filtering | |
Dialog.create("Choose filter sizes for DoG filtering"); | |
Dialog.addNumber("Gaussian sigma 1", 1); | |
Dialog.addNumber("Gaussian sigma 2", 2); | |
Dialog.show(); | |
sigma1 = Dialog.getNumber(); | |
sigma2 = Dialog.getNumber(); | |
// Get the current image | |
idOrig = getImageID(); |
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
// Note: This sets the class according to spot/cluster location, | |
// but does not try to set meaningful colors at this point | |
// Get all spots/clusters | |
def clusters = getObjects({p -> p.class == qupath.imagej.detect.cells.SubcellularDetection.SubcellularObject.class}) | |
// Loop through all clusters | |
for (c in clusters) { | |
// Find the containing cell | |
def cell = c.getParent() |
OlderNewer