-
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
Disable compute-meshfile-button for volume annotations and datasets without segmentation #5648
Disable compute-meshfile-button for volume annotations and datasets without segmentation #5648
Conversation
…ithout segmentation layer
title = "Computation jobs are not enabled for this webKnossos instance."; | ||
} else if (this.props.hasVolume) { | ||
title = | ||
"Meshes cannot be computed for volume annotations. Please open this dataset in view mode to compute a mesh file"; |
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.
Why should view
mode help here? View
mode will not convert the volume annotation into a segmentation, right?
Also, if the toast supports HTML links, this should be a clickable link.
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.
Why should view mode help here? View mode will not convert the volume annotation into a segmentation, right?
I changed the tooltip to Meshes cannot be precomputed for volume annotations. However, you can open this dataset in view mode to precompute meshes for the dataset's segmentation layer.
. I hope this makes it clearer?
Also, if the toast supports HTML links, this should be a clickable link.
It's a tooltip, so, no clickable link possible..
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.
This assumes that there is a segmentation layer to begin with in view
mode. Depending on your dataset this is not the case. I am not sure if this already considered for this conditional. If so, than I guess its fine.
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.
Yeah, this case is already handled.
return ( | ||
<Menu> | ||
<Menu.Item onClick={startComputingMeshfile} disabled={disabled}> | ||
<Tooltip title={title}>Compute Mesh File</Tooltip> |
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 am also not a big fan of the button title. What is a mesh file
? This is very technical. How about something more descriptive. "Computes Mesh for (whole) dataset" or "Pre-compute meshes for all segments" or "Compute all meshes". Or any such combination.
I find it hard to find the difference between the button "Compute Mesh" and "Compute Mesh File". Likely the other button should be called something like "Compute for Mesh for (active) Segment" or "Compute single mesh" or "compute temporay mesh" ...
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.
@normanrz Any comments?
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 don't have a strong opinion re mesh file
.
I agree that meshes vs isosurfaces is quite confusing. They are essentially the same but have different names.
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 changed the button labels to:
- Precompute Meshes (tooltip: Precompute meshes for all segments of this dataset so that meshes for segments can be loaded quickly afterwards from a mesh file.)
- Load Precomputed Mesh
- Compute Mesh (ad hoc)
I hope this makes it clearer. I also hide the "Compute Mesh (ad hoc)" button automatically, if a mesh file is already available (since there is no benefit in using the ad-hoc part).
I agree that meshes vs isosurfaces is quite confusing. They are essentially the same but have different names.
I went through the code and changed the last user-facing "isosurface" bits to "mesh", but there were quite rare (mainly, in the download/reload buttons of the mesh list). I hope I caught them all.
}; | ||
|
||
const getComputeMeshFileButton = () => { | ||
const { disabled, title } = getComputeMeshFileTooltipInfo(); |
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.
Do theses till tip infos apply to the "Compute Mesh" button as well? I think they do, right? A single mesh also needs a segmentation layer and won't work with volume annotations.
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.
Now, the ad-hoc mesh button also has a tooltip. It needed slightly different code (e.g., it doesn't depend on jobsEnabled
) and wording.
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.
@hotzenklotz @philippotto I am a bit confused here, should the ad-hoc isosurface computation really be disabled for volume annotations? There exists the /volume/:tracingId/isosurface
request in the tracingstore, which is now inaccessible?
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.
Oh, good catch. I'll open a PR to fix this.
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.
For the record, fixed by @philippotto’s PR #5689 – thanks for the quick reaction! 🚀
On a more high-level note: Do we really want to show these button if the can not do anything, i.e. the "error" toasts? Alternatively, we could not show the buttons at all and have the "error"/help texts directly in the segmentation tab/pane. Not sure how I feel about that though... |
…w ad-hoc loading button if mesh file is active
This might feel better, but I think, the disabled buttons convey quite well what the user can expect if the conditions are met. If we decide to change this, we should do this in a different PR and focus on the polish. The current PR was only meant as a hotfix for scenarios where meshes are simply not supported. |
@daniel-wer feel free to review now :) I'm sorry that the PR got quite big. The last commit (26cedef) is the major contributor to this. In that commit, I extracted some code from the huge |
…able-compute-mesh-for-volume-annotation
@philippotto Could you annotate your testing instructions with when the button should be enabled or disabled? This would help me to review and test this PR :) |
Sure, just updated it! |
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.
Works exactly as described and the tooltip explanations are very helpful and descriptive 👍
URL of deployed dev instance (used for testing):
Steps to test:
Issues: