Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add scripting methods to get the current image name #1009

Closed
petebankhead opened this issue Jul 13, 2022 · 0 comments · Fixed by #1012
Closed

Add scripting methods to get the current image name #1009

petebankhead opened this issue Jul 13, 2022 · 0 comments · Fixed by #1012
Milestone

Comments

@petebankhead
Copy link
Member

There are two places where a (user-modifiable) image name can be stored:

  • As a property of the project entry
  • As a field in the ImageServer metadata

The first is best when using a project, the second exists to provide a sensible default (since it's generally based on the original image file) and to handle cases where a project isn't being used.

When the name is set in the project, then that's the one the user generally expects to see because it's the most prominent in the UI. But when writing a script, I don't necessarily know whether it will be run in a project or not. As a result, I often find myself having to do something like this:

var entry = getProjectEntry()
var server = getCurrentServer()
var imageName = entry == null ? server.getMetadata().getName() : entry.getImageName()

There should be one or more new methods added to QP to make this less awkward.

@petebankhead petebankhead added this to the v0.4.0 milestone Jul 13, 2022
petebankhead added a commit to petebankhead/qupath that referenced this issue Jul 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant