Skip to content

Commit

Permalink
remove globalize floodfill backend code
Browse files Browse the repository at this point in the history
  • Loading branch information
fm3 committed Jun 26, 2023
1 parent 5ed31bf commit 52eb857
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 48 deletions.
39 changes: 0 additions & 39 deletions app/controllers/JobsController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -185,45 +185,6 @@ class JobsController @Inject()(jobDAO: JobDAO,
}
}

def runGlobalizeFloodfills(
organizationName: String,
dataSetName: String,
fallbackLayerName: String,
annotationId: String,
annotationType: String,
newDatasetName: String,
volumeLayerName: Option[String]
): Action[AnyContent] =
sil.SecuredAction.async { implicit request =>
log(Some(slackNotificationService.noticeFailedJobRequest)) {
for {
organization <- organizationDAO.findOneByName(organizationName)(GlobalAccessContext) ?~> Messages(
"organization.notFound",
organizationName)
_ <- bool2Fox(request.identity._organization == organization._id) ?~> "job.globalizeFloodfill.notAllowed.organization" ~> FORBIDDEN
userAuthToken <- wkSilhouetteEnvironment.combinedAuthenticatorService.findOrCreateToken(
request.identity.loginInfo)
dataSet <- dataSetDAO.findOneByNameAndOrganization(dataSetName, organization._id) ?~> Messages(
"dataSet.notFound",
dataSetName) ~> NOT_FOUND
command = JobCommand.globalize_floodfills
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,
"annotation_type" -> annotationType,
"new_dataset_name" -> newDatasetName,
"volume_layer_name" -> volumeLayerName
)
job <- jobService.submitJob(command, commandArgs, request.identity, dataSet._dataStore) ?~> "job.couldNotRunGlobalizeFloodfills"
js <- jobService.publicWrites(job)
} yield Ok(js)
}
}

def runExportTiffJob(organizationName: String,
dataSetName: String,
bbox: String,
Expand Down
8 changes: 1 addition & 7 deletions app/models/job/Job.scala
Original file line number Diff line number Diff line change
Expand Up @@ -354,12 +354,6 @@ class JobService @Inject()(wkConf: WkConf,
"Volume Annotation Merged",
"Your volume annotation has been successfully merged with the existing segmentation. The result is available as a new dataset in your dashboard."
))
case JobCommand.globalize_floodfills =>
Some(
genericEmailTemplate(
"Globalize Flood Fill",
"The flood fill operations have been extended to the whole dataset. The result is available as a new dataset in your dashboard."
))
case JobCommand.compute_mesh_file =>
Some(
genericEmailTemplate(
Expand All @@ -368,7 +362,7 @@ class JobService @Inject()(wkConf: WkConf,
))
case _ => None
}) ?~> "job.emailNotifactionsDisabled"
// some jobs, e.g. "globalize flood fill"/"find largest segment ideas", do not require an email notification
// some jobs, e.g. "find largest segment ideas", do not require an email notification
_ = Mailer ! Send(emailTemplate)
} yield ()

Expand Down
1 change: 0 additions & 1 deletion conf/webknossos.latest.routes
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,6 @@ POST /jobs/run/computeMeshFile/:organizationName/:dataSetName
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)
POST /jobs/run/globalizeFloodfills/:organizationName/:dataSetName controllers.JobsController.runGlobalizeFloodfills(organizationName: String, dataSetName: String, fallbackLayerName: String, annotationId: String, annotationType: String, newDatasetName: String, volumeLayerName: Option[String])
POST /jobs/run/materializeVolumeAnnotation/:organizationName/:dataSetName controllers.JobsController.runMaterializeVolumeAnnotationJob(organizationName: String, dataSetName: String, fallbackLayerName: String, annotationId: String, annotationType: String, newDatasetName: String, outputSegmentationLayerName: String, mergeSegments: Boolean, volumeLayerName: Option[String])
POST /jobs/run/findLargestSegmentId/:organizationName/:dataSetName controllers.JobsController.runFindLargestSegmentIdJob(organizationName: String, dataSetName: String, layerName: String)
GET /jobs/:id controllers.JobsController.get(id: String)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,6 @@ class EditableMappingService @Inject()(
remoteFallbackLayer: RemoteFallbackLayer,
userToken: Option[String]): Fox[EditableMappingInfo] =
for {
before <- Fox.successful(Instant.now)
closestMaterializedWithVersion <- getClosestMaterialized(editableMappingId, desiredVersion)
updatedEditableMappingInfo: EditableMappingInfo <- if (desiredVersion == closestMaterializedWithVersion.version)
Fox.successful(closestMaterializedWithVersion.value)
Expand Down

0 comments on commit 52eb857

Please sign in to comment.