Skip to content

Commit fc7d7e2

Browse files
committed
Session file path fix
1 parent 0410384 commit fc7d7e2

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

python/main.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ def export_classes(classes: list[str]) -> None:
523523
fps = list(output_fp.rglob("*.dcm"))
524524
session_classes = classes
525525
session_classes.remove("background")
526-
session_fp = Path("./tmp/session-data/session.json")
526+
session_fp = Path("./tmp/session-data/clean/de-identified-files/session.json")
527527
with session_fp.open() as file:
528528
session_file = json.load(file)
529529
for entry_key in session_file:
@@ -603,7 +603,7 @@ async def align_classes(classes: list[str]) -> None:
603603

604604
@app.post("/session", name="session")
605605
async def handle_session_button_click(session_dict: dict[str, Any]) -> None:
606-
session_fp = Path("./tmp/session-data/session.json")
606+
session_fp = Path("./tmp/session-data/clean/de-identified-files/session.json")
607607
with session_fp.open("w") as file:
608608
json.dump(session_dict, file)
609609

@@ -1088,7 +1088,7 @@ def export_session(
10881088
self, # noqa: ANN101
10891089
session: dict[str, dict[str, str]],
10901090
) -> None:
1091-
session_fp = Path(self.clean_data_dp + "/session.json")
1091+
session_fp = Path("./tmp/session-data/clean/de-identified-files/session.json")
10921092
with session_fp.open("w") as file:
10931093
json.dump(session, file)
10941094

@@ -1111,7 +1111,7 @@ def dicom_deidentifier( # noqa: PLR0912, PLR0915
11111111
if session_filepath is None or not Path(session_filepath).is_file():
11121112
session = {}
11131113
else:
1114-
with Path("./tmp/session-data/session.json").open() as file:
1114+
with Path("./tmp/session-data/clean/de-identified-files/session.json").open() as file:
11151115
session = json.load(file)
11161116
if Path("./tmp/session-data/user-options.json").is_file():
11171117
with Path("./tmp/session-data/user-options.json").open() as file:
@@ -1212,9 +1212,9 @@ async def handle_submit_button_click(user_options: UserOptionsClass) -> list[Any
12121212
with user_fp.open("w") as file:
12131213
json.dump(user_options, file)
12141214
session, dicom_pair_fps = dicom_deidentifier(
1215-
session_filepath="./tmp/session-data/session.json",
1215+
session_filepath="./tmp/session-data/clean/de-identified-files/session.json",
12161216
)
1217-
session_fp = Path("./tmp/session-data/session.json")
1217+
session_fp = Path("./tmp/session-data/clean/de-identified-files/session.json")
12181218
with session_fp.open("w") as file:
12191219
json.dump(session, file)
12201220
if user_options["annotation"]: # type: ignore[index]

0 commit comments

Comments
 (0)