Hello. I am trying to display a grayscale OpenCV image in separate window, but no success so far. The code I am executing is as follows and causes Slicer to crash:
height, width = image.shape qImg = qt.QImage(np.asarray(image), width, height, qt.QImage.Format_Grayscale8) pixmap = qt.QPixmap.fromImage(qImg) myLabel = qt.QLabel() myLabel.setPixmap(pixmap) myLabel.show()
Before this, I was successfully displaying the image using OpenCV imshow() method, but it also caused Slicer to crash when I tried to interact with it while maintaining the OpenCV window open.
Any suggestions? I am using Slicer 4.11.0-2019-09-01 r28473.