필터 지우기
필터 지우기

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 CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by