Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can you post your code to read a DICOM file and save into a 16-bit TIF file? #7

Open
wjtan99 opened this issue Jan 30, 2021 · 4 comments

Comments

@wjtan99
Copy link

wjtan99 commented Jan 30, 2021

I just want to make sure I get all the details of your approach.
Thanks a lot.

@mr7495
Copy link
Owner

mr7495 commented Jan 30, 2021

Hello

For Writing:
import pydicom as dicom
import PIL.Image as pil_image
ds = dicom.dcmread("DICOM Address")
pixels = ds.pixel_array
im = pil_image.fromarray( pixels)
im.save('TIFF address')

For Reading:
img = cv2.imread('TIFF Address',cv2.IMREAD_UNCHANGED )

@wjtan99
Copy link
Author

wjtan99 commented Jan 30, 2021

Thanks a lot for your fast response.

@wjtan99 wjtan99 closed this as completed Jan 30, 2021
@wjtan99 wjtan99 reopened this Feb 2, 2021
@wjtan99
Copy link
Author

wjtan99 commented Feb 2, 2021

Hi, do you do any other preprocessing before you save it into tif image? I use a different DICOM dataset and train with your code. The validation accuracy cannot exceed 0.6.
Thanks.

@mr7495
Copy link
Owner

mr7495 commented Feb 3, 2021

Hello; no the original images just were converted to TIFF for easy usage and then would have been used for training the models.
Did you use ResNet50V2+FPN model?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants