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

Disable compute-meshfile-button for volume annotations and datasets without segmentation #5648

Merged
merged 10 commits into from
Aug 4, 2021
Merged
1 change: 1 addition & 0 deletions CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.released

### Fixed
- Fix that active segment and node id were not shown in status bar when being in a non-hybrid annotation. [#5638](https://github.com/scalableminds/webknossos/pull/5638)
- Fix that "Compute Mesh File" button was enabled in scenarios where it should not be supported (e.g., when no segmentation layer exists). [#5648](https://github.com/scalableminds/webknossos/pull/5648)

### Removed
-
Expand Down
6 changes: 3 additions & 3 deletions frontend/javascripts/admin/admin_rest_api.js
Original file line number Diff line number Diff line change
Expand Up @@ -1565,14 +1565,14 @@ export function computeIsosurface(
{
data: {
// The back-end needs a small padding at the border of the
// bounding box to calculate the isosurface. This padding
// bounding box to calculate the mesh. This padding
// is added here to the position and bbox size.
position: V3.toArray(V3.sub(position, voxelDimensions)),
cubeSize: V3.toArray(V3.add(cubeSize, voxelDimensions)),
zoomStep,
// Segment to build isosurface for
// Segment to build mesh for
segmentId,
// Name of mapping to apply before building isosurface (optional)
// Name of mapping to apply before building mesh (optional)
mapping: layer.activeMapping,
mappingType: layer.activeMappingType,
// "size" of each voxel (i.e., only every nth voxel is considered in each dimension)
Expand Down
6 changes: 2 additions & 4 deletions frontend/javascripts/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,8 @@ instead. Only enable this option if you understand its effect. All layers will n
"A corruption in the current skeleton annotation was detected. Please contact your supervisor and/or the maintainers of webKnossos to get help for restoring a working version. Please include as much details as possible about your past user interactions. This will be very helpful to investigate the source of this bug.",
"tracing.merger_mode_node_outside_segment":
"You cannot place nodes outside of a segment in merger mode.",
"tracing.not_isosurface_available_to_download": [
"There is no isosurface for the active segment id available to download.",
'Click with "CTRL + Left Mouse" on the desired segment to load it\'s isosurface.',
],
"tracing.not_isosurface_available_to_download":
"There is no mesh for the active segment id available to download.",
"tracing.mesh_listing_failed":
"A precomputed mesh could not be loaded for this segment. More information was printed to the browser's console.",
"tracing.confirm_remove_fallback_layer.title":
Expand Down
2 changes: 1 addition & 1 deletion frontend/javascripts/oxalis/controller/td_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ class TDController extends React.PureComponent<Props> {
}

if (!event.shiftKey && !event.ctrlKey) {
// No modifiers were pressed. No isosurface related action is necessary.
// No modifiers were pressed. No mesh related action is necessary.
return;
}

Expand Down
6 changes: 3 additions & 3 deletions frontend/javascripts/oxalis/model/sagas/isosurface_saga.js
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ function* maybeLoadIsosurface(
} catch (exception) {
retryCount++;
ErrorHandling.notify(exception);
console.warn("Retrying isosurface generation...");
console.warn("Retrying mesh generation...");
yield* call(sleep, RETRY_WAIT_TIME * 2 ** retryCount);
}
}
Expand All @@ -340,7 +340,7 @@ function* downloadIsosurfaceCellById(cellId: number): Saga<void> {
const geometry = sceneController.getIsosurfaceGeometry(cellId);
if (geometry == null) {
const errorMessages = messages["tracing.not_isosurface_available_to_download"];
philippotto marked this conversation as resolved.
Show resolved Hide resolved
Toast.error(errorMessages[0], { sticky: false }, errorMessages[1]);
Toast.error(errorMessages, { sticky: false });
philippotto marked this conversation as resolved.
Show resolved Hide resolved
return;
}
const stl = exportToStl(geometry);
Expand All @@ -353,7 +353,7 @@ function* downloadIsosurfaceCellById(cellId: number): Saga<void> {
stl.setUint32(cellIdIndex, cellId, true);

const blob = new Blob([stl]);
yield* call(saveAs, blob, `isosurface-${cellId}.stl`);
yield* call(saveAs, blob, `mesh-${cellId}.stl`);
}

function* downloadIsosurfaceCell(action: TriggerIsosurfaceDownloadAction): Saga<void> {
Expand Down
Loading