Não consigo montar uma imagem , ele é montade de dados coletados de imagens Tiff de ossos de fósseis. Encontrei os modelos que quero utilizar nessa extensão skimage para phyton, mas não consigo importalas para o jupter assim o modelo não roda, me ajudem!!
import skimage.io as io
from skimage.io import imread
from skimage.util.montage import montage2d
fossil_path = "Chopped.tif"
fossil_data = imread(fossil_path)
print('Loading Fossil Data sized {}'.format(fossil_data.shape))
%matplotlib inline
from skimage.morphology import binary_closing, ball
closed_fossil_data = binary_closing(thresh_fossil_data, ball(5))
close_slice = closed_fossil_data[slice_idx]
fig, (ax1, ax2) = plt.subplots(1,2, figsize = (10, 5))
ax1.imshow(test_filt_slice, cmap = 'bone')
ax1.set_title('Filtered Slices')
_ = ax2.imshow(close_slice)
ax2.set_title('Slice After Closing')
from mpl_toolkits.mplot3d.art3d import Poly3DCollection
from skimage import measure
def show_3d_mesh(p, threshold):
verts, faces = measure.marching_cubes(p, threshold)
fig = plt.figure(figsize=(10, 10))
ax = fig.add_subplot(111, projection='3d')
mesh = Poly3DCollection(verts[faces], alpha=0.9, edgecolor='none', linewidth = 0.1)
mesh.set_facecolor([.1, 1, .1])
mesh.set_edgecolor([1, 0, 0])
ax.add_collection3d(mesh)
ax.set_xlim(0, p.shape[0])
ax.set_ylim(0, p.shape[1])
ax.set_zlim(0, p.shape[2])
ax.view_init(45, 45)
return fig
from scipy.ndimage import zoom
# we downsample the image to make 3d rendering quicker
fossil_downscale = zoom(closed_fossil_data.astype(np.float32), 0.25)
# now we display it with a nice mesh
_ = show_3d_mesh(fossil_downscale, 0.5)