def plot_3d_cubic(image):
'''
plot the 3D cubic
:param image: image saved as npy file path
:return:
'''
from skimage import measure, morphology
from mpl_toolkits.mplot3d.art3d import Poly3DCollection
image = np.load(image)
verts, faces = measure.marching_cubes(image,0)
fig = plt.figure(figsize=(40, 40))
ax = fig.add_subplot(111, projection='3d')
# Fancy indexing: `verts[faces]` to generate a collection of triangles
mesh = Poly3DCollection(verts[faces], alpha=0.1)
face_color = [0.5, 0.5, 1]
mesh.set_facecolor(face_color)
ax.add_collection3d(mesh)
ax.set_xlim(0, image.shape[0])
ax.set_ylim(0, image.shape[1])
ax.set_zlim(0, image.shape[2])
plt.show()
# LUNA2016 data prepare ,first step: truncate HU to -1000 to 400
kaggle_2017_lung_data_prepare.py 文件源码
python
阅读 18
收藏 0
点赞 0
评论 0
评论列表
文章目录