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

Add frontend and backend part for job to materialize a volume annotation #6086

Merged
merged 39 commits into from
May 9, 2022
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
435f2f1
add frontend and backend part for job to apply merger mode tracing
MichaelBuessemeyer Feb 28, 2022
ee1f591
renaming variable
MichaelBuessemeyer Feb 28, 2022
4f7dcb0
Merge branch 'master' of github.com:scalableminds/webknossos into add…
MichaelBuessemeyer Mar 21, 2022
db2998a
add annotation type as job parameter and make layer names more readable
MichaelBuessemeyer Mar 21, 2022
719a98a
fix layer selection for merger mode job modal
MichaelBuessemeyer Mar 22, 2022
c2190cd
add job output dataset name to start job modals
MichaelBuessemeyer Mar 31, 2022
a9fb85e
add output dataset name to nuclei & neuron & merger mode job params
MichaelBuessemeyer Mar 31, 2022
7f045f5
Merge branch 'master' of github.com:scalableminds/webknossos into add…
MichaelBuessemeyer Mar 31, 2022
d0be7b9
refactor starting modal for flood fills to use the same root componen…
MichaelBuessemeyer Mar 31, 2022
60a5acf
Merge branch 'master' into add-apply-merger-mode-job
MichaelBuessemeyer Apr 4, 2022
c252d40
Apply suggestions from code review
MichaelBuessemeyer Apr 5, 2022
7512f3a
Merge branch 'master' of github.com:scalableminds/webknossos into add…
MichaelBuessemeyer Apr 5, 2022
0aa7e31
apply pr feedback
MichaelBuessemeyer Apr 5, 2022
9d16876
Merge branch 'add-apply-merger-mode-job' of github.com:scalableminds/…
MichaelBuessemeyer Apr 5, 2022
7688824
disable jobs
MichaelBuessemeyer Apr 5, 2022
28a66f9
update docs
MichaelBuessemeyer Apr 25, 2022
b81be12
apply pr feedback
MichaelBuessemeyer Apr 25, 2022
77d6e32
Merge branch 'master' of github.com:scalableminds/webknossos into add…
MichaelBuessemeyer Apr 25, 2022
cd5d318
add changelog entry
MichaelBuessemeyer Apr 25, 2022
485c2d3
Update docs/volume_annotation.md
MichaelBuessemeyer Apr 27, 2022
7601d6f
only show merger mode job button whe jobs are enabled
MichaelBuessemeyer Apr 27, 2022
ef24b0a
Merge branch 'master' into add-apply-merger-mode-job
MichaelBuessemeyer Apr 27, 2022
5d3a7e9
add output segmentation layer name as user input field to apply merge…
MichaelBuessemeyer Apr 28, 2022
04e4f96
add segmentation output layer name to apply merger mode job api call
MichaelBuessemeyer May 2, 2022
2d740f7
Merge branch 'master' of github.com:scalableminds/webknossos into add…
MichaelBuessemeyer May 2, 2022
740efd6
make merger job available for volume annotation without skeletons
MichaelBuessemeyer May 4, 2022
4ec2dc9
Merge branch 'master' of github.com:scalableminds/webknossos into add…
MichaelBuessemeyer May 4, 2022
a810b43
fix returnLink of materialize job
MichaelBuessemeyer May 5, 2022
0bbbe0d
make materialize volume anotation job better compatible with volume …
MichaelBuessemeyer May 5, 2022
310375f
update doc images and add merge with fallback layer section to docs
MichaelBuessemeyer May 5, 2022
9f6a3e7
Apply suggestions from code review
MichaelBuessemeyer May 5, 2022
c02083c
apply review feedback
MichaelBuessemeyer May 5, 2022
edff465
Merge branch 'master' into add-apply-merger-mode-job
fm3 May 9, 2022
b43250b
Update docs/volume_annotation.md
MichaelBuessemeyer May 9, 2022
4d9ca99
Merge branch 'master' into add-apply-merger-mode-job
MichaelBuessemeyer May 9, 2022
4af34cf
apply pr feedback
MichaelBuessemeyer May 9, 2022
dad50a8
Merge branch 'master' of github.com:scalableminds/webknossos into add…
MichaelBuessemeyer May 9, 2022
b581c4b
Merge branch 'add-apply-merger-mode-job' of github.com:scalableminds/…
MichaelBuessemeyer May 9, 2022
89bb93f
rephrase commennt to make it clearer
MichaelBuessemeyer May 9, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.released
[Commits](https://github.com/scalableminds/webknossos/compare/22.05.1...HEAD)

### Added
- Added a long-running job that applies the merging done via a merger mode tracing to a new output dataset. The job is accessible via a button next to the merger mode button once the merger mode is active. [#6086](https://github.com/scalableminds/webknossos/pull/6086)
- Added support to stream zarr files using the corresponding [zarr spec](https://zarr.readthedocs.io/en/stable/spec/v2.html#storage). [#6144](https://github.com/scalableminds/webknossos/pull/6144)

### Changed
Expand Down
67 changes: 58 additions & 9 deletions app/controllers/JobsController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,10 @@ class JobsController @Inject()(jobDAO: JobDAO,
} yield Ok(js)
}

def runInferNucleiJob(organizationName: String, dataSetName: String, layerName: Option[String]): Action[AnyContent] =
def runInferNucleiJob(organizationName: String,
dataSetName: String,
layerName: String,
newDatasetName: String): Action[AnyContent] =
sil.SecuredAction.async { implicit request =>
log(Some(slackNotificationService.noticeFailedJobRequest)) {
for {
Expand All @@ -142,6 +145,7 @@ class JobsController @Inject()(jobDAO: JobDAO,
"organization_name" -> organizationName,
"dataset_name" -> dataSetName,
"layer_name" -> layerName,
"new_dataset_name" -> newDatasetName,
"webknossos_token" -> RpcTokenHolder.webKnossosToken,
)
job <- jobService.submitJob(command, commandArgs, request.identity, dataSet._dataStore) ?~> "job.couldNotRunNucleiInferral"
Expand All @@ -153,7 +157,8 @@ class JobsController @Inject()(jobDAO: JobDAO,
def runInferNeuronsJob(organizationName: String,
dataSetName: String,
layerName: String,
bbox: String): Action[AnyContent] =
bbox: String,
newDatasetName: String): Action[AnyContent] =
sil.SecuredAction.async { implicit request =>
log(Some(slackNotificationService.noticeFailedJobRequest)) {
for {
Expand All @@ -167,6 +172,7 @@ class JobsController @Inject()(jobDAO: JobDAO,
commandArgs = Json.obj(
"organization_name" -> organizationName,
"dataset_name" -> dataSetName,
"new_dataset_name" -> newDatasetName,
"layer_name" -> layerName,
"webknossos_token" -> RpcTokenHolder.webKnossosToken,
"bbox" -> bbox,
Expand All @@ -180,10 +186,11 @@ class JobsController @Inject()(jobDAO: JobDAO,
def runGlobalizeFloodfills(
organizationName: String,
dataSetName: String,
newDataSetName: Option[String],
layerName: Option[String],
annotationId: Option[String],
annotationType: Option[String],
fallbackLayerName: String,
annotationId: String,
annotationType: String,
newDatasetName: String,
volumeLayerName: Option[String]
): Action[AnyContent] =
sil.SecuredAction.async { implicit request =>
log(Some(slackNotificationService.noticeFailedJobRequest)) {
Expand All @@ -201,11 +208,13 @@ class JobsController @Inject()(jobDAO: JobDAO,
commandArgs = Json.obj(
"organization_name" -> organizationName,
"dataset_name" -> dataSetName,
"new_dataset_name" -> newDataSetName,
"layer_name" -> layerName,
"fallback_layer_name" -> fallbackLayerName,
"webknossos_token" -> RpcTokenHolder.webKnossosToken,
"user_auth_token" -> userAuthToken.id,
"annotation_id" -> annotationId,
"annotation_type" -> annotationType,
"user_auth_token" -> userAuthToken.id,
"new_dataset_name" -> newDatasetName,
"volume_layer_name" -> volumeLayerName
)
job <- jobService.submitJob(command, commandArgs, request.identity, dataSet._dataStore) ?~> "job.couldNotRunGlobalizeFloodfills"
js <- jobService.publicWrites(job)
Expand Down Expand Up @@ -258,4 +267,44 @@ class JobsController @Inject()(jobDAO: JobDAO,
}
}

def runMaterializeVolumeAnnotationJob(organizationName: String,
dataSetName: String,
fallbackLayerName: String,
annotationId: String,
annotationType: String,
newDatasetName: String,
outputSegmentationLayerName: String,
mergeSegments: Boolean,
volumeLayerName: Option[String]): Action[AnyContent] =
sil.SecuredAction.async { implicit request =>
log(Some(slackNotificationService.noticeFailedJobRequest)) {
for {
organization <- organizationDAO.findOneByName(organizationName) ?~> Messages("organization.notFound",
organizationName)
_ <- bool2Fox(request.identity._organization == organization._id) ?~> "job.applyMergerMode.notAllowed.organization" ~> FORBIDDEN
dataSet <- dataSetDAO.findOneByNameAndOrganization(dataSetName, organization._id) ?~> Messages(
"dataSet.notFound",
dataSetName) ~> NOT_FOUND
userAuthToken <- wkSilhouetteEnvironment.combinedAuthenticatorService.findOrCreateToken(
request.identity.loginInfo)
command = "materialize_volume_annotation"
commandArgs = Json.obj(
"organization_name" -> organizationName,
"dataset_name" -> dataSetName,
"fallback_layer_name" -> fallbackLayerName,
"webknossos_token" -> RpcTokenHolder.webKnossosToken,
"user_auth_token" -> userAuthToken.id,
"annotation_id" -> annotationId,
"output_segmentation_layer_name" -> outputSegmentationLayerName,
"annotation_type" -> annotationType,
"new_dataset_name" -> newDatasetName,
"merge_segments" -> mergeSegments,
"volume_layer_name" -> volumeLayerName
)
job <- jobService.submitJob(command, commandArgs, request.identity, dataSet._dataStore) ?~> "job.couldNotRunApplyMergerMode"
js <- jobService.publicWrites(job)
} yield Ok(js)
}
}

}
2 changes: 1 addition & 1 deletion app/models/job/Job.scala
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ case class Job(
}
case "export_tiff" =>
Some(s"$dataStorePublicUrl/data/exports/${_id.id}/download")
case "infer_nuclei" | "infer_neurons" =>
case "infer_nuclei" | "infer_neurons" | "materialize_volume_annotation" =>
returnValue.map { resultDatasetName =>
s"/datasets/$organizationName/$resultDatasetName/view"
}
Expand Down
2 changes: 2 additions & 0 deletions conf/messages
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,7 @@ job.couldNotRunComputeMeshFile = Failed to start mesh file computation job.
job.couldNotRunNucleiInferral = Failed to start nuclei inferral job.
job.couldNotRunNeuronInferral = Failed to start neuron inferral job.
job.couldNotRunGlobalizeFloodfills = Failed to start job for globalizing floodfills.
job.couldNotRunApplyMergerMode = Failed to start job to apply merger mode tracing.
job.disabled = Long-running jobs are not enabled for this webKnossos instance.
jobs.worker.notFound = Could not find this worker in the database.
job.export.fileNotFound = Exported file not found. The link may be expired.
Expand All @@ -356,6 +357,7 @@ job.inferNuclei.notAllowed.organization = Currently nuclei inferral is only allo
job.inferNeurons.notAllowed.organization = Currently neuron inferral is only allowed for datasets of your own organization.
job.meshFile.notAllowed.organization = Calculating mesh files is only allowed for datasets of your own organization.
job.globalizeFloodfill.notAllowed.organization = Globalizing floodfills is only allowed for datasets of your own organization.
job.applyMergerMode.notAllowed.organization = Applying merger mode tracings is only allowed for datasets of your own organization.

agglomerateSkeleton.failed=Could not generate agglomerate skeleton.

Expand Down
Loading