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
/** | |
* Split a rectangle into equal parts along its longest dimension. | |
* Rotated rectangles are supported. | |
* | |
* Written for https://forum.image.sc/t/how-to-divide-annotation-roi-into-equal-dimension-bins/51563/8 | |
* | |
* @author Pete Bankhead | |
*/ | |
// Number of regions to create |
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
/** | |
* This script generates a point annotation containing randomly generated points in QuPath v0.2 or v0.3. | |
* | |
* These can optionally be constrained to fall within the selected ROI, within the entire image, | |
* or within the largest circle that falls within the entire image. | |
* | |
* For the original motivation behind this script, see https://forum.image.sc/t/digital-chalkley-point-graticule-overlay/51211 | |
* | |
* @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
/** | |
* Remove detections that have ROIs that touch the border of any annotation ROI in QuPath v0.2. | |
* | |
* Note that there are some non-obvious subtleties involved depending upon how ROIs are accessed - | |
* see the 'useHierarchyRule' option for more info. | |
* | |
* Written for https://forum.image.sc/t/remove-detected-objects-touching-annotations-border/49053 | |
* | |
* @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
/** | |
* Copy QuPath annotations across z-slices or timepoints. | |
* | |
* This is a convenience script to help (slightly) annotating in 3D or 4D images. | |
* | |
* (This hasn't been very thoroughly checked - if it doesn't seem to work for you, | |
* it might just not work... you can use the comments to discuss this) | |
* | |
* @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
/** | |
* QuPath script to visualize annotations on all z-slices, not just the current one. | |
* | |
* This is handy when annotating structures visible across z-slices, but where they might | |
* appear with better contrast in different slices. | |
* | |
* @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
/** | |
* Run cell detection using the DeepCell Kiosk ImageJ plugin from | |
* https://github.com/vanvalenlab/kiosk-imagej-plugin | |
* | |
* For authorship & license of Deep Cell see http://deepcell.org | |
* | |
* To use the script, drag the Kiosk plugin on top of QuPath to make it available as an extension. | |
* Then select a (small!) region of interest in a compatible image and run this script from QuPath's script editor. | |
* | |
* Note that the image needs to be in a compatible format - |
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
server = getCurrentServer() | |
xml = server.dumpMetadata() | |
print groovy.xml.XmlUtil.serialize(xml) |
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
/** | |
* General template for using ImageJ to detect ROIs from QuPath. | |
* | |
* Note the results of this script are terrible; it just applies a threshold per tile (calculated per tile). | |
* Its purpose is to show the process... not to do something useful in itself. | |
* | |
* However, in principle you just need to change the 'detectRois' method to something better to have something | |
* that might be worthwhile. | |
* | |
* @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
/** | |
* Update the image name in the ImageServer metadata to match with the image name in the project. | |
* | |
* This can be used (with caution!) to work around the fact that v0.2.x uses the name from the server | |
* in measurement tables when they are export - not the project. | |
* | |
* Using 'Run -> Run for project' to apply it to all images in a project. | |
* Best back up (as always) before doing anything that will change data files, but an additional | |
* safeguard here is that the original metadata can still be accessed via server.getOriginalMetadata(), | |
* and can be reset by double-clicking the 'Metadata changed' entry under the 'Image' tab. |
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
/** | |
* Import images from .qpdata files into a new project in QuPath v0.2.x. | |
* | |
* The purpose of this is to help recover data from files that were saved outside a project. | |
* It may not work for all images, but should work for most 'straightforward' examples (i.e. a single image per image file). | |
* | |
* If your .qpdata files are already part of a v0.1.2 project, use 'File -> Project... -> Import images from v0.1.2' instead. | |
* If your .qpdata files are already part of a v0.2.0 project, use 'File -> Project... -> Add images' and add the .qpproj file instead. | |
* | |
* Warning! This hasn't been very extensively tested (I always use projects from the start...). |