Skip to content

Commit c13da04

Browse files
Update deleteByClassification.groovy and notDeleteByName.groovy
1 parent 312d0d9 commit c13da04

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

scripts/qupath-utils/tools/deleteByClassification.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* deleteByClassification.groovy
33
*
4-
* Delete all objects whose class correspondond to the specified one.
4+
* Delete all objects whose class correspond to the specified one.
55
* To delete objects whose class is empty, set an empty string.
66
*/
77

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/**
2+
* notDeleteByName.groovy
3+
*
4+
* Delete all annotations whose Name DO NOT correspond to the specified one.
5+
*/
6+
7+
// Define what Names to NOT delete
8+
def nameToNotDelete = ["DH", "VH"]
9+
10+
// Find objects to delete
11+
toRemove = getAnnotationObjects().findAll { !nameToNotDelete.contains(it.getName())}
12+
13+
// remove selected objects
14+
removeObjects(toRemove, true)

0 commit comments

Comments
 (0)