Last active
August 9, 2022 02:26
-
-
Save sergiolucero/fc58084e349db7ce2cd499dc94bc638b to your computer and use it in GitHub Desktop.
view dcm folder
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
Author
sergiolucero
commented
Aug 9, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment