From 1eaaab2d729735dfd3595cffd4579ddb34aa28f8 Mon Sep 17 00:00:00 2001 From: Rui-Jesus Date: Fri, 7 Jun 2024 17:34:53 +0100 Subject: [PATCH] Added missing servlets and API documentation. --- .../ua/dicoogle/server/web/DicoogleWeb.java | 2 + dicoogle_web_api.yaml | 61 ++++++++++++++++++- 2 files changed, 62 insertions(+), 1 deletion(-) diff --git a/dicoogle/src/main/java/pt/ua/dicoogle/server/web/DicoogleWeb.java b/dicoogle/src/main/java/pt/ua/dicoogle/server/web/DicoogleWeb.java index b46b81826..3200676fb 100755 --- a/dicoogle/src/main/java/pt/ua/dicoogle/server/web/DicoogleWeb.java +++ b/dicoogle/src/main/java/pt/ua/dicoogle/server/web/DicoogleWeb.java @@ -228,6 +228,8 @@ public DicoogleWeb(int port) throws Exception { createServletHandler(new TrainServlet(), "/ml/train"), createServletHandler(new ListAllModelsServlet(), "/ml/model/list"), createServletHandler(new ModelinfoServlet(), "/ml/model/info"), + createServletHandler(new CacheServlet(), "/ml/cache"), + createServletHandler(new ImplementedMethodsServlet(), "/ml/provider/methods"), webpages}; // setup the server diff --git a/dicoogle_web_api.yaml b/dicoogle_web_api.yaml index e77f24ba5..cbfaaafe1 100644 --- a/dicoogle_web_api.yaml +++ b/dicoogle_web_api.yaml @@ -1138,7 +1138,7 @@ paths: $ref: '#/components/schemas/DatastoreRequest' responses: '200': - description: The datastore request was successully processed and sent to the provider + description: The datastore request was successfully processed and sent to the provider '400': description: Malformed request /ml/infer/single: @@ -1300,6 +1300,55 @@ paths: $ref: '#/components/schemas/MLModelTrainInfo' '400': description: Malformed request + /ml/cache: + post: + tags: + - Machine Learning + summary: Cache DICOM objects on a provider + operationId: mlCache + parameters: + - in: query + name: provider + description: The name of the provider, e.g "MONAI" + required: true + schema: + type: string + requestBody: + description: Contains the DICOM files to cache + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DICOMDataset' + responses: + '200': + description: The cache request was successfully processed and sent to the provider + '400': + description: Malformed request + /ml/provider/methods: + get: + tags: + - Machine Learning + summary: Retrieves the implemented methods of the machine learning interface from a provider + operationId: mlCache + parameters: + - in: query + name: provider + description: The name of the provider, e.g "MONAI" + required: true + schema: + type: string + responses: + '200': + description: A list of the implemented methods + content: + application/json: + schema: + type: array + items: + type: string + '400': + description: Malformed request components: securitySchemes: @@ -1724,6 +1773,16 @@ components: dataset: type: object description: A map where keys represent SOPInstances and the values are annotations to upload + DICOMDataset: + type: object + properties: + level: + type: string + enum: [PATIENT, STUDY, SERIES, INSTANCE] + dimUIDs: + type: array + items: + type: string TrainRequest: type: object properties: