From 6e06012cd61d45047cbdd2d515970fbf08e06624 Mon Sep 17 00:00:00 2001 From: Youri K Date: Mon, 22 Jul 2019 15:18:00 +0200 Subject: [PATCH 01/12] add support for hybrid tracings with given nml --- app/controllers/TaskController.scala | 8 +++++--- conf/messages | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/controllers/TaskController.scala b/app/controllers/TaskController.scala index cb5ac525af8..ebf48f39acf 100755 --- a/app/controllers/TaskController.scala +++ b/app/controllers/TaskController.scala @@ -154,7 +154,7 @@ class TaskController @Inject()(annotationService: AnnotationService, params <- JsonHelper.parseJsonToFox[NmlTaskParameters](jsonString) ?~> "task.create.failed" taskTypeIdValidated <- ObjectId.parse(params.taskTypeId) ?~> "taskType.id.invalid" taskType <- taskTypeDAO.findOne(taskTypeIdValidated) ?~> "taskType.notFound" ~> NOT_FOUND - _ <- bool2Fox(taskType.tracingType == TracingType.skeleton) ?~> "task.create.fromFileVolume" + _ <- bool2Fox(taskType.tracingType == TracingType.skeleton || taskType.tracingType == TracingType.hybrid) ?~> "task.create.fromFileVolume" project <- projectDAO .findOneByName(params.projectName) ?~> Messages("project.notFound", params.projectName) ~> NOT_FOUND _ <- Fox.assertTrue(userService.isTeamManagerOrAdminOf(request.identity, project._team)) @@ -162,8 +162,10 @@ class TaskController @Inject()(annotationService: AnnotationService, .extractFromFiles(inputFiles.map(f => (new File(f.ref.path.toString), f.filename))) .parseResults skeletonSuccesses <- Fox.serialCombined(parseResults)(_.toSkeletonSuccessFox) ?~> "task.create.failed" - result <- createTasks(skeletonSuccesses.map(s => - (buildFullParams(params, s.skeletonTracing.get, s.fileName, s.description), s.skeletonTracing, None))) + fullParams = skeletonSuccesses.map(s => + (buildFullParams(params, s.skeletonTracing.get, s.fileName, s.description), s.skeletonTracing)) + volumeBaseOpts <- createTaskVolumeTracingBases(fullParams.map(_._1), request.identity._organization) + result <- createTasks((fullParams zip volumeBaseOpts).map(t => (t._1._1, t._1._2, t._2))) } yield { result } diff --git a/conf/messages b/conf/messages index 3f15a3fd840..4bee27ca6b6 100644 --- a/conf/messages +++ b/conf/messages @@ -221,7 +221,7 @@ task.create.success=Task successfully created task.create.failed=Failed to create Task task.create.limitExceeded=Cannot create more than 1000 tasks in one request. task.create.needsEitherSkeletonOrVolume=Each task needs to either be skeleton or volume. -task.create.fromFileVolume=Task creation with file upload is only supported for skeleton task types. +task.create.fromFileVolume=Task creation with file upload is not supported for volume task types. task.finished=Task is finished task.assigned=You got a new task task.tooManyOpenOnes=You already have too many open tasks From b511f6032904688ee5ba81d6b2deba8a329aa43b Mon Sep 17 00:00:00 2001 From: Philipp Otto Date: Mon, 22 Jul 2019 18:11:32 +0200 Subject: [PATCH 02/12] allow to create hybrid task types; add baseAnnotationId field to bulk script upload --- frontend/javascripts/admin/api_flow_types.js | 6 +++--- frontend/javascripts/admin/task/task_create_bulk_view.js | 9 +++++++-- .../javascripts/admin/tasktype/task_type_create_view.js | 5 ++++- .../javascripts/admin/tasktype/task_type_list_view.js | 7 ++++--- 4 files changed, 18 insertions(+), 9 deletions(-) diff --git a/frontend/javascripts/admin/api_flow_types.js b/frontend/javascripts/admin/api_flow_types.js index ae84d543146..ce666f7ace2 100644 --- a/frontend/javascripts/admin/api_flow_types.js +++ b/frontend/javascripts/admin/api_flow_types.js @@ -238,6 +238,8 @@ export const APIAnnotationTypeEnum = Enum.make({ export type APIAnnotationType = $Keys; +export type TracingType = "skeleton" | "volume" | "hybrid"; + export type APITaskType = { +id: string, +summary: string, @@ -246,11 +248,9 @@ export type APITaskType = { +teamName: string, +settings: APISettings, +recommendedConfiguration: ?RecommendedConfiguration, - +tracingType: "skeleton" | "volume", + +tracingType: TracingType, }; -export type TracingType = "skeleton" | "volume" | "hybrid"; - export type TaskStatus = { +open: number, +active: number, +finished: number }; type APIScriptTypeBase = { diff --git a/frontend/javascripts/admin/task/task_create_bulk_view.js b/frontend/javascripts/admin/task/task_create_bulk_view.js index 6b628d7aa46..1c8324091c6 100644 --- a/frontend/javascripts/admin/task/task_create_bulk_view.js +++ b/frontend/javascripts/admin/task/task_create_bulk_view.js @@ -136,6 +136,7 @@ class TaskCreateBulkView extends React.PureComponent { const depth = parseInt(words[17]); const projectName = words[18]; const scriptId = words[19] || undefined; + const baseAnnotationId = words[20] || undefined; // BoundingBox is optional and can be set to null by using the format [0, 0, 0, 0, 0, 0] const boundingBox = @@ -163,6 +164,7 @@ class TaskCreateBulkView extends React.PureComponent { editPosition: [x, y, z], editRotation: [rotX, rotY, rotZ], isForAnonymous: false, + baseAnnotationId, }; } @@ -265,7 +267,10 @@ class TaskCreateBulkView extends React.PureComponent { dataSet, taskTypeId,{" "} experienceDomain, minExperience, x, y, z, rotX, rotY, rotZ, instances,{" "} team, minX, minY, minZ, width, height, depth,{" "} - project [, scriptId] + project [, scriptId, baseAnnotationId] +
+ If you want to define some (but not all) of the optional values, please list all + optional values and use null for the ones you do not want to set.

@@ -289,7 +294,7 @@ class TaskCreateBulkView extends React.PureComponent { })(