visual-layer / fastdup

fastdup is a powerful free tool designed to rapidly extract valuable insights from your image & video datasets. Assisting you to increase your dataset images & labels quality and reduce your data operations costs at an unparalleled scale.
Other
1.52k stars 74 forks source link

[Feature Request]: Support DICOM image #261

Open dnth opened 10 months ago

dnth commented 10 months ago

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