Skip to content

Commit d1e136f

Browse files
committed
Removed local copy of operator that had a temp fix
Signed-off-by: M Q <[email protected]>
1 parent b0f40f7 commit d1e136f

File tree

6 files changed

+22
-13
lines changed

6 files changed

+22
-13
lines changed

platforms/aidoc/restful_app/ai_spleen_seg_app/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2021-2023 MONAI Consortium
1+
# Copyright 2021-2025 MONAI Consortium
22
# Licensed under the Apache License, Version 2.0 (the "License");
33
# you may not use this file except in compliance with the License.
44
# You may obtain a copy of the License at

platforms/aidoc/restful_app/ai_spleen_seg_app/__main__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2021-2023 MONAI Consortium
1+
# Copyright 2021-2025 MONAI Consortium
22
# Licensed under the Apache License, Version 2.0 (the "License");
33
# you may not use this file except in compliance with the License.
44
# You may obtain a copy of the License at

platforms/aidoc/restful_app/ai_spleen_seg_app/app.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2021-2023 MONAI Consortium
1+
# Copyright 2021-2025 MONAI Consortium
22
# Licensed under the Apache License, Version 2.0 (the "License");
33
# you may not use this file except in compliance with the License.
44
# You may obtain a copy of the License at
@@ -14,6 +14,7 @@
1414

1515
# Required for setting SegmentDescription attributes. Direct import as this is not part of App SDK package.
1616
from pydicom.sr.codedict import codes
17+
from reporter_operator import ExecutionStatusReporterOperator
1718

1819
from monai.deploy.conditions import CountCondition
1920
from monai.deploy.core import AppContext, Application
@@ -31,7 +32,6 @@
3132
MonaiBundleInferenceOperator,
3233
)
3334
from monai.deploy.operators.stl_conversion_operator import STLConversionOperator
34-
from reporter_operator import ExecutionStatusReporterOperator
3535

3636

3737
# @resource(cpu=1, gpu=1, memory="7Gi")

platforms/aidoc/restful_app/ai_spleen_seg_app/app.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
%YAML 1.2
2-
# SPDX-FileCopyrightText: Copyright (c) 2022-2023 MONAI. All rights reserved.
2+
# SPDX-FileCopyrightText: Copyright (c) 2022-2025 MONAI. All rights reserved.
33
# SPDX-License-Identifier: Apache-2.0
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");

platforms/aidoc/restful_app/ai_spleen_seg_app/reporter_operator.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
# limitations under the License.
1111

1212
import logging
13+
1314
from monai.deploy.core import (
1415
Application,
1516
ConditionType,
@@ -18,8 +19,8 @@
1819
InputContext,
1920
IOType,
2021
Operator,
21-
OutputContext,
2222
OperatorSpec,
23+
OutputContext,
2324
)
2425

2526

platforms/aidoc/restful_app/app.py

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
1+
# Copyright 2025 MONAI Consortium
2+
# Licensed under the Apache License, Version 2.0 (the "License");
3+
# you may not use this file except in compliance with the License.
4+
# You may obtain a copy of the License at
5+
# http://www.apache.org/licenses/LICENSE-2.0
6+
# Unless required by applicable law or agreed to in writing, software
7+
# distributed under the License is distributed on an "AS IS" BASIS,
8+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9+
# See the License for the specific language governing permissions and
10+
# limitations under the License.
11+
12+
import argparse
113
import importlib
214
import logging
315
import os
416
import sys
517
import threading
618
from http import HTTPStatus
7-
import argparse
819

920
import requests
1021
from flask import Flask, jsonify, request
@@ -65,8 +76,7 @@ def app_status_callback(summary):
6576
os.environ["MONAI_INPUTPATH"] = input_folder
6677
os.environ["MONAI_OUTPUTPATH"] = output_folder
6778
os.environ["HOLOSCAN_INPUT_PATH"] = input_folder # For Holoscan-based apps
68-
os.environ["HOLOSCAN_OUTPUT_PATH"] = output_folder # For Holoscan-based apps
69-
79+
os.environ["HOLOSCAN_OUTPUT_PATH"] = output_folder # For Holoscan-based apps
7080

7181
# Dynamically import the application class from the specified module.
7282
logging.info(f"Loading application: {APP_MODULE_NAME}.{APP_CLASS_NAME}")
@@ -110,9 +120,7 @@ def process():
110120
callback_url = data.get("callback_url") # Callback URL is optional
111121

112122
# Start the processing in a background thread.
113-
thread = threading.Thread(
114-
target=run_processing, args=(input_folder, output_folder, callback_url)
115-
)
123+
thread = threading.Thread(target=run_processing, args=(input_folder, output_folder, callback_url))
116124
thread.start()
117125

118126
return jsonify({"message": "Processing started."}), HTTPStatus.ACCEPTED
@@ -136,4 +144,4 @@ def process():
136144
args = parser.parse_args()
137145
host = args.host or os.environ.get("FLASK_HOST", "0.0.0.0")
138146
port = args.port or int(os.environ.get("FLASK_PORT", 5000))
139-
app.run(host=host, port=port)
147+
app.run(host=host, port=port)

0 commit comments

Comments
 (0)