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

Point annotations - missing #125

Closed
ds2268 opened this issue Feb 23, 2022 · 9 comments
Closed

Point annotations - missing #125

ds2268 opened this issue Feb 23, 2022 · 9 comments

Comments

@ds2268
Copy link
Contributor

ds2268 commented Feb 23, 2022

I am running a project where pathologists are using point-wise annotations to select particular cells of interest. When clicking on the cells in a fast manner, lots of the cells are not marked and are missed. This is due to HistomicsUI sensitivity to the actual clicking -> it detects that you are trying to move the slide (by the slightest amount) and not to click. Is there some workaround where we can make some "safety margin", that when you are using annotation tools, that it's more sensitive towards putting the annotation there instead of moving the slide around - if the movement detected is really small and annotation tools are selected, put the annotation instead, or both?

Any ideas? This is a real bottleneck in speed, especially when using a stylus pen for making the annotations.

@manthey
Copy link
Contributor

manthey commented Feb 23, 2022

We use the GeoJS library for handling this, and the mapInteractor class allows this to be adjusted. Specifically, from the HistomicsUI client, if you have a reference to the viewer object, this is an instance of the GeoJS map class. From that, you can do something like:

let currentOptions = viewer.interactor.options();
currentOptions.click.cancelOnMove = 10;  // a click can move up to 10 pixels before it is considered a move
viewer.interactor.options(currentOptions)

The default value for cancelOnMove is true, which is any movement is considered a move and not a click. false would be purely time-based to distinguish between clicks and moves. See https://opengeoscience.github.io/geojs/apidocs/geo.mapInteractor.html.

@ds2268
Copy link
Contributor Author

ds2268 commented Feb 24, 2022

That would be exactly what I need @manthey! Can you please point me in HistomicsUI code, where should I put this exactly? Thanks!

Is this here:

this.viewerWidget.on('g:imageRendered', () => {

basically just add the settings (as you provided) in this render callback?

@manthey
Copy link
Contributor

manthey commented Feb 24, 2022

@ds2268
Copy link
Contributor Author

ds2268 commented Feb 24, 2022

When I add it like this:

image

...and restart the DSA and run devops/build.sh ... I lose all the plugins in the HistomicsView - I can just see the image and the header.

@manthey
Copy link
Contributor

manthey commented Feb 24, 2022

I left out some parenthesis. interactor is actually a function that returns the map interactor:

let currentOptions = viewer.interactor().options();
currentOptions.click.cancelOnMove = 10;  // a click can move up to 10 pixels before it is considered a move
viewer.interactor().options(currentOptions)

Without that you probably have an exception in the javascript console.

@ds2268
Copy link
Contributor Author

ds2268 commented Feb 24, 2022

Thanks! Seems to work now - I have exactly no JS experience, so I am doing it a bit blindly :). The clicking seems to be better now but will do a test again with the stylus pen and report. Then you can also consider that as a "standard" feature, or at least to be configurable somewhere if deemed useful in the real world.

@ds2268
Copy link
Contributor Author

ds2268 commented Feb 25, 2022

@manthey when you are doing point annotations the points (all of them, including previous ones) are rendered again when you add a new one. It also seems like they are not getting re-rendered after every point added, but every 2,3, X points, as you notice the blink/flash of re-rendering all of them. This makes the labeling process very slow under a high number of points. This can happen when you are labeling manually and come up with thousands of points, but even sooner if you use a semi-automated approach and you add/correct some of them. This makes the process extremely slow.

I noticed that only annotations (i.e. points) under the same annotation file are getting re-rendered. Can I somehow stop re-rendering when adding points under the SAME annotation file and how? Seems like that re-rendering under the current (selected) annotation file is not needed, if others (from other annotation files) are visualized also, without rendering. Thanks!

@manthey
Copy link
Contributor

manthey commented May 31, 2022

@ds2268 -- can you check if girder/large_image#871 has fixed the rerendering you were seeing? If you install from dockers, you may need to wait a little bit for new docker images to be published with the changes.

@manthey
Copy link
Contributor

manthey commented Jun 29, 2022

I think this is fully resolved by recent changes. Please reopen if it isn't.

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