Skip to content

Instantly share code, notes, and snippets.

@sergiolucero
Last active Aug 9, 2022
Embed
What would you like to do?
view dcm folder
import pydicom as dicom
import matplotlib.pylab as plt
import glob
fig=plt.figure(figsize=(20,12));rows=2;cols=2;axes=[]
for a, file in zip(range(rows*cols),glob.glob('*.dcm')):
axes.append( fig.add_subplot(rows, cols, a+1) )
axes[-1].set_title(file)
axes[-1].axis('off')
plt.imshow(dicom.dcmread(file).pixel_array)
fig.tight_layout()
plt.show()
@sergiolucero
Copy link
Author

sergiolucero commented Aug 9, 2022

image

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