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

[Feature Request]: Support DICOM image #261

Open
dnth opened this issue Aug 29, 2023 · 0 comments
Open

[Feature Request]: Support DICOM image #261

dnth opened this issue Aug 29, 2023 · 0 comments

Comments

@dnth
Copy link
Collaborator

dnth commented Aug 29, 2023

Feature Name

Native DICOM image support

Feature Description

Images in medical datasets are usually stored in .dcm format which includes other metadata.

To get pixel values from .dcm image, first install the libraries:

pip install pydicom pylibjpeg

Here's a code snippet to get the pixel values from a .dcm image.

import pydicom
dicom_file_path = "1000.dcm"
dicom_image = pydicom.dcmread(dicom_file_path)
pixel_data = dicom_image.pixel_array

import matplotlib.pyplot as plt
plt.imshow(pixel_data, cmap=plt.cm.gray)
plt.show()

image

Data from Kaggle RSNA challenge.

Contact Information [Optional]

No response

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

No branches or pull requests

1 participant