Skip to content

Commit

Permalink
Hotfix for mypy errors
Browse files Browse the repository at this point in the history
  • Loading branch information
fl0wxr committed Apr 2, 2024
1 parent 8735a72 commit ff4a845
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions python/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ async def conversion_info(dicom_pair_fp: list[str]) -> dict: # type: ignore[typ
retain_aspect_ratio=True,
)
raw_buf = BytesIO()
Image.fromarray(raw_img).save(raw_buf, format="PNG")
Image.fromarray(raw_img).save(raw_buf, format="PNG") # type: ignore[no-untyped-call]
raw_img_base64 = base64.b64encode(raw_buf.getvalue()).decode("utf-8")
cleaned_dcm = pydicom.dcmread(dicom_pair_fp[1])
cleaned_img = image_preprocessing(
Expand All @@ -347,7 +347,7 @@ async def conversion_info(dicom_pair_fp: list[str]) -> dict: # type: ignore[typ
retain_aspect_ratio=True,
)
cleaned_buf = BytesIO()
Image.fromarray(cleaned_img).save(cleaned_buf, format="PNG")
Image.fromarray(cleaned_img).save(cleaned_buf, format="PNG") # type: ignore[no-untyped-call]
cleaned_img_base64 = base64.b64encode(cleaned_buf.getvalue()).decode("utf-8")
if cache_bbox_img(dcm_hash=dcm_hash) is None:
bboxes_dicom_img = raw_img_base64
Expand Down Expand Up @@ -990,7 +990,7 @@ def export_processed_file(
Path(self.clean_dicom_dp).mkdir(parents=True)
if bbox_img is not None:
bbox_img_fp = self.out_dp + "/" + self.input_dicom_hash + "_bbox" + ".png"
Image.fromarray(bbox_img).save(bbox_img_fp)
Image.fromarray(bbox_img).save(bbox_img_fp) # type: ignore[no-untyped-call]
cache_bbox_img(self.input_dicom_hash)
clean_dicom_fp = self.clean_dicom_dp + "/" + self.input_dicom_hash + ".dcm"
dcm.save_as(clean_dicom_fp)
Expand Down

0 comments on commit ff4a845

Please sign in to comment.