In [31]:
import dicom
from matplotlib import pyplot as plt, cm
import numpy as np
import cv2 

%matplotlib inline

In [32]:
plan0 = dicom.read_file("../../dicom/ProstateX-0000/1.3.6.1.4.1.14519.5.2.1.7311.5101.158323547117540061132729905711/1.3.6.1.4.1.14519.5.2.1.7311.5101.100000082759836574166944843130/000000.dcm")

In [33]:
plan0.BodyPartExamined


Out[33]:
'PROSTATE'

In [34]:
plan0.ImagePositionPatient


Out[34]:
['-57.679780620168', '-80.935898100698', '-22.813066698769']

In [30]:
plan0.Columns


Out[30]:
128

In [27]:
rsImage = cv2.resize(plan0.pixel_array, (64,64))

In [28]:
plt.figure(figsize=(10,10));
plt.subplot(1,2,1);
plt.imshow(plan0.pixel_array, cmap=cm.bone);
plt.title('Original')

plt.subplot(1,2,2);
plt.imshow(rsImage, cmap=cm.bone);
plt.title('Resized');



In [10]:
plan1 = dicom.read_file("../../dicom/ProstateX-0000/1.3.6.1.4.1.14519.5.2.1.7311.5101.158323547117540061132729905711/1.3.6.1.4.1.14519.5.2.1.7311.5101.100000082759836574166944843130/000001.dcm")

In [11]:
plt.imshow(plan1.pixel_array, cmap=cm.bone);



In [7]:
plan1.ImageType


Out[7]:
['ORIGINAL', 'PRIMARY', 'M', 'DIS2D']

In [13]:



Out[13]:
'SIEMENS'

In [14]:
plan1.SliceThickness


Out[14]:
'3'

In [6]:
plan2 = dicom.read_file("/Volumes/homes/users/anthony.reina/dicom"
                        "/Lung CT/stage1/00cba091fa4ad62cc3200a657aeb957e/"
                        "0a291d1b12b86213d813e3796f14b329.dcm")

In [7]:
plt.imshow(plan2.pixel_array, cmap=cm.bone);



In [16]:
plan2.PatientID


Out[16]:
'00cba091fa4ad62cc3200a657aeb957e'

In [3]:
plan3 = dicom.read_file("/Volumes/homes/users/anthony.reina/dicom/Lung CT/stage1/00cba091fa4ad62cc3200a657aeb957e/034673134cbef5ea15ff9e0c8090500a.dcm")

In [4]:
plt.imshow(plan3.pixel_array, cmap=cm.bone)


Out[4]:
<matplotlib.image.AxesImage at 0x108ef7150>

In [12]:
np.shape(plan1.pixel_array)


Out[12]:
(128, 128)

In [16]:
plan3.Rows


Out[16]:
512

In [ ]: