Software is being developed to edit a dataset with a specific extension and structure. It is required to put the resulting image into a QLabel, but when reading the data in Format_Grayscale16
mode, it is darker than when opening matplotlib with the "grey"
color map.
QLabel code:
ds=dcmread(*filepath*)
imQt=QImage(ds.pixel_array,ds.Columns,ds.Rows,ds.Columns*2, QImage.Format.Format_Grayscale16)
pix=QPixmap.fromImage(imQt)
Img_View_label.setPixmap(self.pix.scaled(self.Img_View_label.width(),
Img_View_label.height(),QtCore.Qt.AspectRatioMode.KeepAspectRatio))
Output
matplotlib code:
ds=dcmread(path)
im=Image.fromarray(ds.pixel_array)
fig, ax = plt.subplots()
ax.imshow(im,cmap="grey")
plt.show()
Output
How should the data be processed?