Skip to content

Commit

Permalink
implement requested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
cdfhalle committed Jan 10, 2025
1 parent 314a057 commit 4024aa3
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
6 changes: 3 additions & 3 deletions app/controllers/JobController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ class JobController @Inject()(
mergeSegments: Boolean,
volumeLayerName: Option[String],
includesProofreading: Boolean,
selectedBoundingBox: Option[String]): Action[AnyContent] =
boundingBox: Option[String]): Action[AnyContent] =
sil.SecuredAction.async { implicit request =>
log(Some(slackNotificationService.noticeFailedJobRequest)) {
for {
Expand All @@ -396,7 +396,7 @@ class JobController @Inject()(
_ <- datasetService.assertValidDatasetName(newDatasetName)
_ <- datasetService.assertValidLayerNameLax(outputSegmentationLayerName)
multiUser <- multiUserDAO.findOne(request.identity._multiUser)
_ <- Fox.runIf(!multiUser.isSuperUser && includesProofreading)(Fox.runOptional(selectedBoundingBox)(bbox =>
_ <- Fox.runIf(!multiUser.isSuperUser && includesProofreading)(Fox.runOptional(boundingBox)(bbox =>
jobService.assertBoundingBoxLimits(bbox, None)))
commandArgs = Json.obj(
"organization_id" -> organization._id,
Expand All @@ -410,7 +410,7 @@ class JobController @Inject()(
"merge_segments" -> mergeSegments,
"volume_layer_name" -> volumeLayerName,
"includes_proofreading" -> includesProofreading,
"selected_bounding_box" -> selectedBoundingBox
"bounding_box" -> boundingBox
)
job <- jobService.submitJob(command, commandArgs, request.identity, dataset._dataStore) ?~> "job.couldNotRunApplyMergerMode"
js <- jobService.publicWrites(job)
Expand Down
2 changes: 1 addition & 1 deletion conf/webknossos.latest.routes
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ POST /jobs/run/inferNuclei/:datasetId
POST /jobs/run/inferNeurons/:datasetId controllers.JobController.runInferNeuronsJob(datasetId: String, layerName: String, bbox: String, newDatasetName: String)
POST /jobs/run/inferMitochondria/:datasetId controllers.JobController.runInferMitochondriaJob(datasetId: String, layerName: String, bbox: String, newDatasetName: String)
POST /jobs/run/alignSections/:datasetId controllers.JobController.runAlignSectionsJob(datasetId: String, layerName: String, newDatasetName: String, annotationId: Option[String])
POST /jobs/run/materializeVolumeAnnotation/:datasetId controllers.JobController.runMaterializeVolumeAnnotationJob(datasetId: String, fallbackLayerName: String, annotationId: String, annotationType: String, newDatasetName: String, outputSegmentationLayerName: String, mergeSegments: Boolean, volumeLayerName: Option[String], includesProofreading: Boolean, selectedBoundingBox: Option[String])
POST /jobs/run/materializeVolumeAnnotation/:datasetId controllers.JobController.runMaterializeVolumeAnnotationJob(datasetId: String, fallbackLayerName: String, annotationId: String, annotationType: String, newDatasetName: String, outputSegmentationLayerName: String, mergeSegments: Boolean, volumeLayerName: Option[String], includesProofreading: Boolean, boundingBox: Option[String])
POST /jobs/run/findLargestSegmentId/:datasetId controllers.JobController.runFindLargestSegmentIdJob(datasetId: String, layerName: String)
POST /jobs/run/renderAnimation/:datasetId controllers.JobController.runRenderAnimationJob(datasetId: String)
GET /jobs/:id controllers.JobController.get(id: String)
Expand Down
10 changes: 5 additions & 5 deletions frontend/javascripts/admin/api/jobs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ function startSegmentationAnnotationDependentJob(
annotationType: APIAnnotationType,
mergeSegments?: boolean,
includesProofreading?: boolean,
selectedBoundingBox?: Vector6,
boundingBox?: Vector6,
): Promise<APIJob> {
const requestURL = new URL(`/api/jobs/run/${jobURLPath}/${datasetId}`, location.origin);
if (volumeLayerName != null) {
Expand All @@ -227,8 +227,8 @@ function startSegmentationAnnotationDependentJob(
if (includesProofreading != null) {
requestURL.searchParams.append("includesProofreading", includesProofreading.toString());
}
if (selectedBoundingBox) {
requestURL.searchParams.append("selectedBoundingBox", selectedBoundingBox.toString());
if (boundingBox) {
requestURL.searchParams.append("boundingBox", boundingBox.join(","));
}
return Request.receiveJSON(requestURL.href, {
method: "POST",
Expand All @@ -244,7 +244,7 @@ export function startMaterializingVolumeAnnotationJob(
annotationType: APIAnnotationType,
mergeSegments: boolean,
includesProofreading: boolean,
selectedBoundingBox?: Vector6,
boundingBox?: Vector6,
): Promise<APIJob> {
return startSegmentationAnnotationDependentJob(
"materializeVolumeAnnotation",
Expand All @@ -256,7 +256,7 @@ export function startMaterializingVolumeAnnotationJob(
annotationType,
mergeSegments,
includesProofreading,
selectedBoundingBox,
boundingBox,
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -926,8 +926,10 @@ export function MaterializeVolumeAnnotationModal({
output dataset and the output segmentation layer.
</p>
);
} else {
includesProofreading = tracing.volumes.some((v) => v.hasEditableMapping === true);
} else if (fixedSelectedLayer && "tracingId" in fixedSelectedLayer) {
includesProofreading =
tracing.volumes.find((volume) => volume.tracingId === fixedSelectedLayer.tracingId)
?.hasEditableMapping === true;
}
const jobImage =
jobNameToImagePath[jobName] != null ? (
Expand Down

0 comments on commit 4024aa3

Please sign in to comment.