How can I save all slices from 3D image?

2 visualizzazioni (ultimi 30 giorni)
Haytham Ali
Haytham Ali il 12 Gen 2022
Risposto: KSSV il 12 Gen 2022
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

Risposte (1)

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

Categorie

Scopri di più su Images in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by