问题描述
我正在使用 Tkinter 和 matplotlib 制作 Dicom 查看器应用程序。我可以为它编码,但图像没有快速更新。这是我使用的代码,任何替代方法都会对我有很大帮助。
from tkinter import *
master = Tk()
import matplotlib.pyplot as plt
import pydicom
import pydicom.data
import numpy as np
fig,ax = plt.subplots()
def show_values(a):
a=int(a)
print(a)
# Full path of the DICOM file is passed in base
base = r"C:\Users\AJU\PycharmProjects\3Drendering\S50" #this the path contains dicom images
from load_file import load_file
data = load_file(base)
b=int(a)
ds= pydicom.dcmread(data[b])
ax.imshow(ds.pixel_array,cmap=plt.cm.bone)
fig.canvas.draw_idle()
w = Scale(master,from_=0,length=800,width=20,to=680,orient=VERTICAL,command=show_values)
w.pack()
plt.show()
mainloop()
在上面的代码中 w 是一个 tkinter 滚动小部件,我的目标是滚动绘图中的 dicom 图像
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)