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
/** | |
* Script to set cell intensity sub-classifications based on an arbitrary number | |
* of thresholds. | |
* | |
* Note: Because QuPath's dynamic measurements only care about negative/positive or | |
* negative/1+/2+/3+, any further classifications (e.g. 4+, 5+) won't be part of the | |
* summary scores (e.g. H-score or even Positive %)! | |
* Be warned and be careful! | |
* | |
* For 3 thresholds or fewer, the built-in setCellIntensityClassifications method is preferable. |
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
/** | |
* A script to simplify the ROIs of all selected annotation objects. | |
* | |
* @author Pete Bankhead | |
*/ | |
import qupath.lib.gui.QuPathGUI | |
import qupath.lib.objects.PathAnnotationObject | |
import qupath.lib.roi.PolygonROI | |
import qupath.lib.roi.ShapeSimplifierAwt |
OlderNewer