Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python open dicom file

import pydicom as dicom
import matplotlib.pylab as plt

# specify your image path
image_path = 'data/train_images/sample.dcm'
ds = dicom.dcmread(image_path)

plt.imshow(ds.pixel_array)
Comment

PREVIOUS NEXT
Code Example
Python :: datetime python timezone 
Python :: find matches between two lists python 
Python :: numpy round 
Python :: python json parse 
Python :: python number of elements in multidimensional array 
Python :: pandas drop column by index range 
Python :: how to end the python program 
Python :: bulk file name changer in python 
Python :: schedule task to midnight python 
Python :: python bold text 
Python :: how to change dtype object to int 
Python :: get difference of images python 
Python :: opposite of .isin pandas 
Python :: python get weather temperature 
Python :: confusion matrix heat map 
Python :: howt to make caluclator in python 
Python :: python check if string is a float 
Python :: fastest way to output text file in python + Cout 
Python :: virtual env 
Python :: adaptive thresholding python 
Python :: powershell to python converter 
Python :: python install tabulate 
Python :: barabasi albert graph networkx 
Python :: how to get the location of the cursor screen in python 
Python :: how to loop over month name in python 
Python :: print last n rows of dataframe 
Python :: segregate list in even and odd numbers python 
Python :: tkinter button background color mac 
Python :: pandas drop rows with empty list 
Python :: python check if number is float or int 
ADD CONTENT
Topic
Content
Source link
Name
9+6 =