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

Import annotation from csv feature, is it still available? #526

Closed
mikejhuang opened this issue Feb 6, 2024 · 5 comments
Closed

Import annotation from csv feature, is it still available? #526

mikejhuang opened this issue Feb 6, 2024 · 5 comments

Comments

@mikejhuang
Copy link

This resource shows that once creating an annotation layer by ctrl+click new layer, there's a button to import or export annotations to csv. https://brainmaps.princeton.edu/2020/10/new-neuroglancer-feature-import-annotations-from-csv-files/
image

However, this does not show up in my present neuroglancer UI.
image

What is the current method to import annotations from a csv if it's no longer available?

@fcollman
Copy link
Contributor

fcollman commented Feb 8, 2024

This is related to a long ago fork of the seung-lab branch with mainline google. That documentation refers to the seung-lab branch. There is no GUI right now for upload/download of annotation layer annotations. You have to parse out the json in the state using the {} tool in the upper right. To create states there are some python tooling available via neuroglancer python, or pipelines build on top of it like nglui (https://pypi.org/project/nglui/).

Note annotation layers of most types can be dragged from seung-lab windows to mainline google, so a workaround is to use seung-lab branch (deployed at neuromancer-seung-import.appspot.com) and then create the annotation layer and then drag it over to a mainline neuroglancer window. Note there are more annotation features in seung-lab branch that aren't part of mainline so this only works with certain basic types of annotation features.

@mikejhuang
Copy link
Author

mikejhuang commented Feb 8, 2024

Hmmm, given that the json is converted into a web URL, do you think there is a limit to the number of annotations before the URL becomes too long for the browser to handle? I'm working with MERSCOPE cell coordinates that number in the millions. I may need to find an alternative way to perform this annotation.

Edit: I suppose it's prudent to first give it a shot. Thanks for sharing that resource.

@fcollman
Copy link
Contributor

Yes.. annotations in the json are only reasonable up to ~10K or so, and things begin breaking down in performance after that point.

Precomputed annotations can be written, I've been working on a PR #522 to make writing this format more accessible, you should give that branch a try in writing some MERSCOPE cell coordinates.

@mikejhuang
Copy link
Author

mikejhuang commented Feb 15, 2024

I added 1000 annotations using the example "python/examples/write_annotations.py" from your PR #522
The spots tend to disappear. I might need to optimize the sharding parameters more. I tried a larger chunk size but it's made things worse.

neuroglancer.and.1.more.page.-.Personal.-.Microsoft.Edge.2024-02-14.16-37-01.mp4

@fcollman
Copy link
Contributor

try adjusting where you click in the spacing lines, this will modulate how many annotations will get loaded
image

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

No branches or pull requests

2 participants