Skip to content

Instantly share code, notes, and snippets.

@petebankhead
Created September 20, 2018 13:02
Show Gist options
  • Select an option

  • Save petebankhead/a8113a5258191e79bae5fae017e0bc57 to your computer and use it in GitHub Desktop.

Select an option

Save petebankhead/a8113a5258191e79bae5fae017e0bc57 to your computer and use it in GitHub Desktop.
Remove very tiny annotation objects in QuPath
// 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment