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
| /** | |
| * Script to open the QuPath extensions directory. | |
| * This is handy if you want to add/remove extensions manually. | |
| * | |
| * Since it depends on java.awt.Desktop, it may not be supported on all platforms. | |
| * | |
| * @author Pete Bankhead | |
| */ | |
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
| /** | |
| * Script to update cell measurement names for a multichannel fluorescence image | |
| * to incorporate actual stored channel names, rather than the defaults of | |
| * 'Channel 1', 'Channel 2' etc. | |
| * | |
| * @author Pete Bankhead | |
| */ | |
| import qupath.lib.scripting.QPEx |
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
| /** | |
| * Demo script showing a simple method of assigning classifications for a multichannel fluorescence image. | |
| * | |
| * Note that at the time of writing, this requires the most recent (pre-release) QuPath version. | |
| * See https://petebankhead.github.io for more information. | |
| * | |
| * The channel names here refer to the sample image 'LuCa-7color_[13860,52919]_1x1component_data.tif' | |
| * from Perkin Elmer, after running 'Update measurement names.groovy' script. | |
| * | |
| * The original image is part of Bio-Formats demo data, under Creative Commons Attribution 4.0 International License |
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
| /** | |
| * Helper script for QuPath to find objects with one or more classifications. | |
| * | |
| * @author Pete Bankhead | |
| */ | |
| // Insert as many or few classifications here as required | |
| selectObjects {checkForClassifications(it.getPathClass(), 'CD8', 'FoxP3')} | |
| print 'Selected ' + getSelectedObjects().size() |
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
| /** | |
| * Flip the ROIs for QuPath objects (usually annotations) vertically or horizontally. | |
| * | |
| * This creates new objects that are then added to the current image hierarchy. | |
| * | |
| * This also shows the method by which any arbitrary AffineTransform may be | |
| * applied to an object by scripting. | |
| * | |
| * Note: This version is updated for QuPath v0.2. | |
| * |
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
| /** | |
| * Script to help with annotating tumor regions, separating the tumor margin from the center. | |
| * | |
| * Here, each of the margin regions is approximately 500 microns in width. | |
| * | |
| * NOTE: This version has been updated for v0.2.0-m6 and to use Java Topology Suite. | |
| * | |
| * @author Pete Bankhead | |
| */ |
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
| /** | |
| * Export an image thumbnail & overlay as separate images. | |
| * | |
| * The overlay is written as PNG with transparent background. | |
| * | |
| * @author Pete Bankhead | |
| */ | |
| import qupath.lib.regions.RegionRequest |
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
| /** | |
| * Set a MeasurementMapper in QuPath v0.2 to control the display in a script. | |
| * | |
| * Revised version of a script for v0.1.2. | |
| * | |
| * @author Pete Bankhead | |
| */ | |
| import qupath.lib.gui.tools.MeasurementMapper |
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
| getTMACoreList().each { | |
| it.clearMetadata() | |
| } | |
| fireHierarchyUpdate() |
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
| // Remove really tiny objects (here, with areas <= 1 pixel.... and also lines) | |
| // They can be created when using the wand/brush & subtracting almost all of a region (for example) | |
| tinyAreas = getAnnotationObjects().findAll { | |
| return !it.isPoint() && it.getROI().getArea() <= 1 | |
| } | |
| print 'Number of objects to remove: ' + tinyAreas.size() | |
| removeObjects(tinyAreas, true) |