How can I save all slices from 3D image?

7 次查看(过去 30 天)
I am using this code but not working good it save only one slice
for i=1:45
slice=Myimage(:,:,i);
saveas(gcf,'slice_i.png')
end

回答(1 个)

KSSV
KSSV 2022-1-12
for i=1:45
slice=Myimage(:,:,i);
pcolor(slice) ; shading interp
fname = ['slice_',num2str(i),'.png'] ;
saveas(gcf,fname)
end

类别

Help CenterFile Exchange 中查找有关 Geometric Transformation and Image Registration 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by