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
| /** | |
| * A basic GUI to help monitor memory usage in QuPath. | |
| * | |
| * This helps both to find & address out-of-memory troubles by | |
| * 1. Showing how much memory is in use over time | |
| * 2. Giving a button to clear the tile cache - which can be | |
| * using up precious memory | |
| * 3. Giving quick access to control the number of threads used | |
| * for parallel processing | |
| * |
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
| /** | |
| * QuPath script to calculate areas (e.g. of tumor) based upon classified cells only. | |
| * | |
| * It works by using a distance transform applied to binary images generated from the | |
| * objects of each class, and then assigns each pixel to the closest object. | |
| * | |
| * Having done this, new annotations are generated for these regions. | |
| * | |
| * WARNINGS! | |
| * - This will remove *all* previous annotations & replace them with new annotations |
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 combine results tables exported by QuPath. | |
| * | |
| * This is particularly intended to deal with the fact that results tables of annotations can produce results | |
| * with different column names, numbers and orders - making them awkward to combine later manually. | |
| * | |
| * It prompts for a directory containing exported text files, and then writes a new file in the same directory. | |
| * The name of the new file can be modified - see the first lines below. | |
| * | |
| * Note: This hasn't been tested very extensively - please check the results carefully, and report any problems so they |
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
| /* | |
| * QuPath v0.1.2 has some bugs that make exporting annotations a bit annoying, specifically it doesn't include the 'dot' | |
| * needed in the filename if you run it in batch, and it might put the 'slashes' the wrong way on Windows. | |
| * Manually fixing these afterwards is not very fun. | |
| * | |
| * Anyhow, until this is fixed you could try the following script with Run -> Run for Project. | |
| * It should create a new subdirectory in the project, and write text files containing results there. | |
| * | |
| * @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 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 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
| /** | |
| * 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 |
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
| /** | |
| * Request an image from QuPath as an (ImageJ) ImagePlus. | |
| * The aim is to avoid the (arbitrary) size threshold in v0.1.2 of QuPath. | |
| * | |
| * @author Pete Bankhead | |
| */ | |
| import ij.IJ | |
| import qupath.imagej.gui.IJExtension | |
| import qupath.imagej.helpers.IJTools |
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
| /** | |
| * Demonstration of how to use ImageJ + QuPath to detect stained regions in | |
| * a brightfield image. | |
| * | |
| * @author Pete Bankhead | |
| */ | |
| import ij.CompositeImage | |
| 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
| /** | |
| * Create a region annotation with a fixed size in QuPath, based on the current viewer location. | |
| * | |
| * @author Pete Bankhead | |
| */ | |
| import qupath.lib.objects.PathAnnotationObject | |
| import qupath.lib.objects.classes.PathClassFactory | |
| import qupath.lib.roi.RectangleROI | |
| 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
| /** | |
| * Script to export binary masks corresponding to all annotations of an image, | |
| * optionally along with extracted image regions. | |
| * | |
| * Note: Pay attention to the 'downsample' value to control the export resolution! | |
| * | |
| * @author Pete Bankhead | |
| */ | |
| import qupath.lib.images.servers.ImageServer |