convert 3d image to 2d images
16 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
khaled alsaih
il 17 Dic 2017
Commentato: Image Analyst
il 30 Ott 2018
i have image with size of 1024*512*128 where 128 is the number of slices in the volume how can i get the 2d images and save it into .png and how to get them back thanks for your kind help
0 Commenti
Risposta accettata
Image Analyst
il 17 Dic 2017
Try something like this
[rows, columns, numberOfSlices] = size(image3d);
for slice = 1 : numberOfSlices
thisSlice = image3d(:,:, slice);
baseFileName = sprintf('Slice %d.png', slice);
fullFileName = fullfile(folder, baseFileName);
imwrite(thisSlice, fullFileName);
end
To get them back, use imread(). To tack onto a 3D image, use cat(3, image3d, thisSlice).
4 Commenti
Image Analyst
il 30 Ott 2018
permute() does not do that. It basically just rotates the 3D volume so that rows are now columns, etc.
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Image Processing Toolbox in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!