Skip to content

Commit 4cde694

Browse files
committed
Hotfix for mypy errors
1 parent 3bdc864 commit 4cde694

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

python/main.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ async def conversion_info(dicom_pair_fp: list[str]) -> dict: # type: ignore[typ
391391
retain_aspect_ratio=True,
392392
)
393393
raw_buf = BytesIO()
394-
Image.fromarray(raw_img).save(raw_buf, format="PNG")
394+
Image.fromarray(raw_img).save(raw_buf, format="PNG") # type: ignore[no-untyped-call]
395395
raw_img_base64 = base64.b64encode(raw_buf.getvalue()).decode("utf-8")
396396
cleaned_dcm = pydicom.dcmread(dicom_pair_fp[1])
397397
cleaned_img = image_preprocessing(
@@ -401,7 +401,7 @@ async def conversion_info(dicom_pair_fp: list[str]) -> dict: # type: ignore[typ
401401
retain_aspect_ratio=True,
402402
)
403403
cleaned_buf = BytesIO()
404-
Image.fromarray(cleaned_img).save(cleaned_buf, format="PNG")
404+
Image.fromarray(cleaned_img).save(cleaned_buf, format="PNG") # type: ignore[no-untyped-call]
405405
cleaned_img_base64 = base64.b64encode(cleaned_buf.getvalue()).decode("utf-8")
406406
if cache_bbox_img(dcm_hash=dcm_hash) is None:
407407
bboxes_dicom_img = raw_img_base64
@@ -518,7 +518,7 @@ def export_classes(classes: list[str]) -> None:
518518
output_fp = Path(user_input["output_dcm_dp"])
519519
fps = list(output_fp.rglob("*.dcm"))
520520
session_classes = classes
521-
session_classes.remove('background')
521+
session_classes.remove("background")
522522
session_fp = Path("./tmp/session-data/session.json")
523523
with session_fp.open() as file:
524524
session_file = json.load(file)
@@ -1082,7 +1082,7 @@ def export_processed_file(
10821082
Path(self.clean_dicom_dp).mkdir(parents=True)
10831083
if bbox_img is not None:
10841084
bbox_img_fp = self.out_dp + "/" + self.input_dicom_hash + "_bbox" + ".png"
1085-
Image.fromarray(bbox_img).save(bbox_img_fp)
1085+
Image.fromarray(bbox_img).save(bbox_img_fp) # type: ignore[no-untyped-call]
10861086
cache_bbox_img(self.input_dicom_hash)
10871087
clean_dicom_fp = self.clean_dicom_dp + "/" + self.input_dicom_hash + ".dcm"
10881088
dcm.save_as(clean_dicom_fp)

0 commit comments

Comments
 (0)