フィルターのクリア

convert 3d image to 2d images

16 ビュー (過去 30 日間)
khaled alsaih
khaled alsaih 2017 年 12 月 17 日
コメント済み: Image Analyst 2018 年 10 月 30 日
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

採用された回答

Image Analyst
Image Analyst 2017 年 12 月 17 日
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 件のコメント
M. Siyabend KAYA
M. Siyabend KAYA 2018 年 10 月 30 日
How can we use the Permute command for converting 3D to 2D?
Image Analyst
Image Analyst 2018 年 10 月 30 日
permute() does not do that. It basically just rotates the 3D volume so that rows are now columns, etc.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeImage Processing Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by