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
/** | |
* Add pixel classifier measurements to all cells in an image. | |
* | |
* This is intended to overcome the fact that measurements can be quite slow because they aren't parallelized. | |
* | |
* Written for QuPath v0.3.2. | |
* See https://forum.image.sc/t/qupath-measure-pixel-classifier-area-per-cell-detection-for-wsis/72701 | |
* | |
* Warning! This hasn't been extensively tested - please report any problems on the forum. | |
* |
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
/** | |
* Sum the area of detections with a specified classification. | |
* Written for QuPath v0.3.2. | |
* | |
* @author Pete Bankhead | |
*/ | |
// Define name of the class of detection objects | |
def className = 'Positive' |
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
/** | |
* Rotate all objects in an image by 180 degrees, translating them so they | |
* remain within the image. | |
* | |
* Written for QuPath v0.3.2 | |
* | |
* See https://forum.image.sc/t/overlaying-h-e-and-tissue-annotations-in-qupath/71861/3 | |
* | |
* @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
/** | |
* Export images of individual cell nuclei, with corresponding binary masks. | |
* Written for QuPath v0.3.2. | |
* | |
* See https://forum.image.sc/t/generate-bounding-box-images-and-their-corresponding-xml-json-files-with-each-separate-annotation/68119/ | |
* | |
* @author Pete Bankhead | |
*/ | |
import qupath.lib.images.servers.LabeledImageServer |
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 for QuPath v0.3.2 that loops through all available channels, | |
* displaying them in turn for 1 second. | |
* | |
* Written for https://forum.image.sc/t/how-do-i-script-qupath-to-change-the-displayed-channel/67216 | |
* | |
* @author Pete Bankhead | |
*/ | |
def viewer = getCurrentViewer() |
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 QuPath annotations in GeoJSON using calibrated pixel sizes | |
* (rather than pixel units). | |
* | |
* Written for QuPath v0.3.2 | |
* | |
* @author Pete Bankhead | |
*/ | |
// Define export directory (or null if we don't want to export, but just print the GeoJSON) |
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 add density map values to *some* detection centroids in QuPath v0.3, | |
* limited to only use a subset of the detections on the image. | |
* | |
* It does this by copying the relevant objects and adding them to a temporary ImageData. | |
* | |
* Note that this hasn't been tested very much... and assumes a 2D image. | |
* At the very least, you should use 'Measure -> Show measurement maps' as a sanity check. | |
* | |
* Written for https://forum.image.sc/t/qupath-number-of-detections-per-tile/64603/14 |
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 add density map values to detection centroids in QuPath v0.3. | |
* | |
* Note that this hasn't been tested very much... and assumes a 2D image. | |
* At the very least, you should use 'Measure -> Show measurement maps' as a sanity check. | |
* | |
* Written for https://forum.image.sc/t/qupath-number-of-detections-per-tile/64603/10 | |
* | |
* @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
/* | |
* Export annotations representing instance labels from an image. | |
* | |
* This supports exporting regions of an image (rather than the whole thing) | |
* defined using the annotation shape (i.e. rectangle) or classification. | |
* | |
* See the comments for more information, and parameters to adjust. | |
* | |
* Note that the instance labels are applied globalled, so if multiple distinct | |
* regions are export, the labels are not guaranteed to start from 1 or be consecutive |