diff --git a/python/main.py b/python/main.py index 12ced25..b43a28d 100644 --- a/python/main.py +++ b/python/main.py @@ -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( @@ -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 @@ -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)