-6

I am trying to use the Inception V3 model on a set of medical data images. The problem is the data is in DICOM format and can't be used with the Image classifier. Can anyone please let me know how to use the DICOM files directly with the Inception V3 classifier.

P.s. - I learnt to use the classifier by a tutorial provided by TensorFlow and am relatively new at this.

Amit Joshi
  • 15,448
  • 21
  • 77
  • 141
vikadia7x
  • 9
  • 2
  • 1
    Not familiar with most of the terms in your question, but if you are on Linux, you probably have **ImageMagick** and can convert DICOM images to JPEG with `convert input.dcm output.jpg`. – Mark Setchell Jun 06 '17 at 21:15
  • I don't think your question has anything to do with tensorflow, by the way, pydicom is what you are looking for – Jie.Zhou Jun 07 '17 at 03:28

1 Answers1

-1
import os
import dicom
import matplotlib.image as image

os.chdir("path/to/dicom.dcm")
dicom_file = dicom.read_file("dicom.dcm")
dicom_array = dicom_file.pixel_array
image.imsave("dicom.jpg", dicom_array)
dhmallon
  • 34
  • 3