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

Extremely long class list prevents exiting QuPath #626

Closed
petebankhead opened this issue Oct 23, 2020 · 3 comments
Closed

Extremely long class list prevents exiting QuPath #626

petebankhead opened this issue Oct 23, 2020 · 3 comments
Labels
Milestone

Comments

@petebankhead
Copy link
Member

Bug report

Describe the bug
QuPath has major problems if the list of available classifications is too long.

See https://forum.image.sc/t/extremely-long-class-list-prevents-exiting-qupath/44381 for details.

Expected behavior
QuPath closes elegantly, and retrieves the class list when restarted.

Additional context
Presumably we hit the 8192 character limit of what can be stored in preferences.

Note that this also impacts byte arrays (since they use Base64 encoding).

Options include:

  • Use the user directory instead (but this might not be set)
  • Encode the preferences in a different way, e.g. across multiple entries if needed
@petebankhead
Copy link
Member Author

A script like the following can be used to replicate the problem:

guiscript=true

def pathClasses = []
for (int i = 0; i < 500; i++) {
    pathClasses << getPathClass('Another class ' + i)
}

getQuPath().getAvailablePathClasses().clear()
getQuPath().getAvailablePathClasses().addAll(pathClasses)

@petebankhead
Copy link
Member Author

The fix will only save classification lists to the preferences if they can fit. Otherwise, the classification list can still be retrieved from a project in the future - but won't be stored in the preferences.

@petebankhead petebankhead added this to the v0.3.0 milestone Mar 22, 2021
@petebankhead
Copy link
Member Author

Fixed in #635 - will be included in v0.3.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant