Python 尝试滚动CT切片

Python 尝试滚动CT切片,python,python-3.x,matplotlib,Python,Python 3.x,Matplotlib,我使用的代码从 不幸的是,输出是一个静态图像。我正在使用jupyter笔记本(在我的实际代码中,类后的函数是缩进的) 我是如何观看3D图像的 cube = dicom_cbct_view(test_dir, trim_factor=trim_factor) fig, ax = plt.subplots(1, 1) tracker = IndexTracker(ax, cube) fig.canvas.mpl_connect('scroll_event', tracker.onscro

我使用的代码从

不幸的是,输出是一个静态图像。我正在使用jupyter笔记本(在我的实际代码中,类后的函数是缩进的)

我是如何观看3D图像的

cube = dicom_cbct_view(test_dir, trim_factor=trim_factor)


fig, ax = plt.subplots(1, 1)


tracker = IndexTracker(ax, cube)


fig.canvas.mpl_connect('scroll_event', tracker.onscroll)
plt.show()
输出(铁路超高滚动)


对不起大家。我是哑巴。我需要

%matplotlib qt 
所以下面的工作

%matplotlib qt 
fig, ax = plt.subplots(1, 1)


tracker = IndexTracker(ax, cube)


fig.canvas.mpl_connect('scroll_event', tracker.onscroll)

plt.show()
%matplotlib qt 
fig, ax = plt.subplots(1, 1)


tracker = IndexTracker(ax, cube)


fig.canvas.mpl_connect('scroll_event', tracker.onscroll)

plt.show()