-
Notifications
You must be signed in to change notification settings - Fork 24
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
isosurfaces for volume tracings #4567
Conversation
…surface-for-volume-tracing
…surface-for-volume-tracing
...nossos-datastore/app/com/scalableminds/webknossos/datastore/services/IsosurfaceService.scala
Outdated
Show resolved
Hide resolved
Finally, I to the time to work on this issue. 😌 I added a button to the 3d viewport that is only visible if the isosurface feature is enabled. The isosurface saga now also tracks the cell ids of cells that got annotated between reloads. A reload will only reload the cells that got annotated. Still existing problems:
|
@philippotto just fixed it :D |
@philippotto The frontend is ready to receive your awesome feedback 🎉 |
…surface-for-volume-tracing
Very cool! What's the state in the back-end? Maybe you could update the PR description a bit, so that there is some explanation about the future and that current state is clear :) |
I think the backend is working but I am not sure whether the code is reviewed and cleaned up. @youri-k Do you know more about this? |
I think the backend is good for review 🙂 @fm3 could you have a look? |
Unfortunately, the CI doesn't pass, as the smoke test repeatedly fails. Is this related to the back-end changes? |
Yes, this is a backend related problem. I'm working on it. |
Really cool to see the isosurfaces for own annotations 👍 However, testing didn't went totally smooth for me. Here are my observations:
Probably out of scope for this PR, but I'm starting to think that we should probably list all the isosurfaces explicitly in the "meshes" tab. Then, we could have functionality for reloading, removing etc. very transparently. Something like this: Maybe it makes sense to combine this with a general segment tab, so that all segments are listed (and when you click it you jump to it). And if you want, you can activate the isosurface rendering for one particular cell. Also see #4667. However, a first version of this feature could simply list the cells for which isosurfaces have been loaded (that should be rather easy to do). What do you think? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I applied your feedback for the frontend @philippotto. Could you please check the newest changes?
Cool stuff! I'll look through the code to give feedback in a bit, @MichaelBuessemeyer! What's the status of volume (or hybrid) annotations with fallback segmentation? Since this will be the new default soon, there should also be isosurface support. However, I couldn't get it to work? It's probably also not trivial, since the back-end can only compute isosurfaces for volume tracings or for segmentation layers, but not for the overlay via fallbacks, right? @youri-k We probably need to discuss this in person together with @youri-k, when he's back again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! This already looks very good 🕺 Just left some mostly minor feedback :)
let shouldBeRemoved = true; | ||
for (const [, position] of isoSurfacePositions) { | ||
// Reload the Isosurface. | ||
yield* call(ensureSuitableIsosurface, null, position, cellId, shouldBeRemoved); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd add a comment which explains that no redundant work will be done, since the isosurface-loading-code always checks whether a request has already been performed. I myself just stumbled here a bit, since the code requests a new isosurface for each position in the three-d-map, even though ensureSuitableIsosurface
will also traverse the 3D space. However, your approach is still very correct (since multiple seeds might still be necessary to reconstruct everything). I'd just add the comment so that the next reader does not stumble here :)
yield _takeEvery("TRIGGER_ISOSURFACE_DOWNLOAD", downloadActiveIsosurfaceCell); | ||
yield _takeEvery("IMPORT_ISOSURFACE_FROM_STL", importIsosurfaceFromStl); | ||
yield _takeEvery("REMOVE_ISOSURFACE", removeIsosurface); | ||
yield _takeEvery("REFRESH_ISOSURFACES", refreshIsosurfaces); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the refresh button is clicked, I think it would also make sense to fetch the isosurfaces at the current position (as a seed) with the cell id at that position. That way, the button can also be used to render the very first isosurface without needing to know about shift+click.
I had a discussion with Florian and Norman and we agreed for this version of the feature to simply follow this logic: if the current tracing uses a fallback segmentation layer, fetch the isosurfaces from the datastore (i.e, the traced data gets ignored completely) and if there's no fallback layer, use the tracingstore. @MichaelBuessemeyer Could you make sure that the logic explained above is implemented? Also see my other PR feedback :) |
@fm3 Could you also review the back-end code in case you haven't done it already? :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Backend mostly looks good to me, I added some small comments.
I like the holder structure :)
...-datastore/app/com/scalableminds/webknossos/datastore/services/BinaryDataServiceHolder.scala
Outdated
Show resolved
Hide resolved
...tore/app/com/scalableminds/webknossos/tracingstore/controllers/VolumeTracingController.scala
Outdated
Show resolved
Hide resolved
...nossos-datastore/app/com/scalableminds/webknossos/datastore/services/IsosurfaceService.scala
Show resolved
Hide resolved
…surface-for-volume-tracing
@philippotto I thin I covered all your feedback |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent 👍 Works well for me :)
Now, only the back-end's feedback needs to be integrated, I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had another look and merged the master. I’d say backend LGTM now! Let’s do a quick final round of testing after the CI is done, then this should be good to go. Edit: did some testing, seemed to work :) I agree with philippotto that progress/overview UI would be beneficial, though.
This PR makes it possible to fetch isosurfaces from the backend in volume tracings. An isosurface can be loaded by using
ctrl + leftMouse
. This PR adds a button to the 3d viewport that makes it possible to reload the fetched isosurfaces whose annotation changed.URL of deployed dev instance (used for testing):
Steps to test:
ctrl + leftMouse
in one of the plane viewports. The isosurface should be loaded. Then change the annotation of that cell and use the reload button in the top right corner of the 3d viewport. The isosurface should be erased and the reloaded to the newest version.Issues:
[ ] Updated (unreleased) migration guide if applicable[ ] Updated documentation if applicable[ ] Adapted wk-connect if datastore API changes