Last active
December 23, 2015 12:39
-
-
Save trigfa/6637045 to your computer and use it in GitHub Desktop.
Displaying a dicom image in a matplotlib widget within a pyqt window. The axes have been set to not visible
This file contains 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
class MainWindow(QMainWindow, Ui_MainWindow): | |
def __init__(self,parent=None): | |
QDialog.__init__(self,parent) | |
self.setupUi(self) | |
self.mpl.canvas.ax.clear() | |
ds=dicom.read_file("slice.dcm") | |
#self.mpl.canvas.ax.imshow(self.image1, cmap=pylab.cm.bone) | |
self.mpl.canvas.ax.imshow(ds.pixel_array, cmap=pylab.cm.bone) | |
self.mpl.canvas.ax.xaxis.set_visible(False) | |
self.mpl.canvas.ax.yaxis.set_visible(False) | |
self.mpl.canvas.draw() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment