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

Added support for ComputeSegmentIndexFile worker job #7471

Merged
merged 7 commits into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
27 changes: 27 additions & 0 deletions app/controllers/JobsController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,33 @@ class JobsController @Inject()(
} yield Ok(js)
}

def runComputeSegmentIndexJob(organizationName: String,
hotzenklotz marked this conversation as resolved.
Show resolved Hide resolved
dataSetName: String,
layerName: String,
mag: String,
agglomerateView: Option[String]): Action[AnyContent] =
sil.SecuredAction.async { implicit request =>
for {
organization <- organizationDAO.findOneByName(organizationName)(GlobalAccessContext) ?~> Messages(
"organization.notFound",
organizationName)
_ <- bool2Fox(request.identity._organization == organization._id) ?~> "job.segmentIndexFile.notAllowed.organization" ~> FORBIDDEN
dataSet <- datasetDAO.findOneByNameAndOrganization(dataSetName, organization._id) ?~> Messages(
"dataset.notFound",
dataSetName) ~> NOT_FOUND
command = JobCommand.compute_segment_index_file
commandArgs = Json.obj(
"organization_name" -> organizationName,
"dataset_name" -> dataSetName,
"segmentation_layer_name" -> layerName,
"mag" -> mag,
"agglomerate_view" -> agglomerateView
)
job <- jobService.submitJob(command, commandArgs, request.identity, dataSet._dataStore) ?~> "job.couldNotRunSegmentIndexFile"
js <- jobService.publicWrites(job)
} yield Ok(js)
}

def runInferNucleiJob(organizationName: String,
dataSetName: String,
layerName: String,
Expand Down
4 changes: 2 additions & 2 deletions app/models/job/JobCommand.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ import com.scalableminds.util.enumeration.ExtendedEnumeration
object JobCommand extends ExtendedEnumeration {
type JobCommand = Value

val compute_mesh_file, convert_to_wkw, export_tiff, find_largest_segment_id, globalize_floodfills, infer_nuclei,
infer_neurons, materialize_volume_annotation, render_animation = Value
val compute_mesh_file, compute_segment_index_file, convert_to_wkw, export_tiff, find_largest_segment_id,
globalize_floodfills, infer_nuclei, infer_neurons, materialize_volume_annotation, render_animation = Value
}
2 changes: 2 additions & 0 deletions conf/messages
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ initialData.organizationsNotEmpty=There are already organizations present in the
job.couldNotRunCubing = Failed to start WKW conversion job.
job.couldNotRunTiffExport = Failed to start Tiff export job.
job.couldNotRunComputeMeshFile = Failed to start mesh file computation job.
job.couldNotRunComputeSegmentIndexFile = Failed to start segment index 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.
Expand All @@ -310,6 +311,7 @@ job.edgeLengthExceeded = An edge length of the selected bounding box is too larg
job.inferNuclei.notAllowed.organization = Currently nuclei inferral is only allowed for datasets of your own organization.
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.segmentIndexFile.notAllowed.organization = Calculating segment index 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.materializeVolumeAnnotation.notAllowed.organization = Materializing volume annotations is only allowed for datasets of your own organization.
job.noWorkerForDatastore = Processing jobs are not available for the datastore this dataset belongs to.
Expand Down
1 change: 1 addition & 0 deletions conf/webknossos.latest.routes
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ GET /jobs
GET /jobs/status controllers.JobsController.status()
POST /jobs/run/convertToWkw/:organizationName/:dataSetName controllers.JobsController.runConvertToWkwJob(organizationName: String, dataSetName: String, scale: String)
POST /jobs/run/computeMeshFile/:organizationName/:dataSetName controllers.JobsController.runComputeMeshFileJob(organizationName: String, dataSetName: String, layerName: String, mag: String, agglomerateView: Option[String])
POST /jobs/run/computeSegmentIndexFile/:organizationName/:dataSetName controllers.JobsController.runComputeSegmentIndexJob(organizationName: String, dataSetName: String, layerName: String, mag: String, agglomerateView: Option[String])
POST /jobs/run/exportTiff/:organizationName/:dataSetName controllers.JobsController.runExportTiffJob(organizationName: String, dataSetName: String, bbox: String, layerName: Option[String], mag: Option[String], annotationLayerName: Option[String], annotationId: Option[String], asOmeTiff: Boolean)
POST /jobs/run/inferNuclei/:organizationName/:dataSetName controllers.JobsController.runInferNucleiJob(organizationName: String, dataSetName: String, layerName: String, newDatasetName: String)
POST /jobs/run/inferNeurons/:organizationName/:dataSetName controllers.JobsController.runInferNeuronsJob(organizationName: String, dataSetName: String, layerName: String, bbox: String, newDatasetName: String)
Expand Down