Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save petebankhead/a473b817eac36caabdffc21daf93231d to your computer and use it in GitHub Desktop.
Save petebankhead/a473b817eac36caabdffc21daf93231d to your computer and use it in GitHub Desktop.
Export annotations for a project in QuPath
/*
* 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
*/
def name = getProjectEntry().getImageName() + '.txt'
def path = buildFilePath(PROJECT_BASE_DIR, 'annotation results')
mkdirs(path)
path = buildFilePath(path, name)
saveAnnotationMeasurements(path)
print 'Results exported to ' + path
@rakiyasaid
Copy link

Hi Pete,
I used this script fr my thesis and I want to cite it. Whats the best way to write the citation?

@rakiyasaid
Copy link

Hi Pete,

How do I cite this script?

RAkiya

@petebankhead
Copy link
Author

HI @rakiyasaid, the main thing is to cite the QuPath paper: https://qupath.readthedocs.io/en/latest/docs/intro/citing.html

This script is really short and just calls methods that exist in QuPath - because it is so simple, I don't think it really requires separate citation but if you like you can use the webpage URL.

@rakiyasaid
Copy link

rakiyasaid commented Oct 3, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment