Hi; Someone please help me, how to do the same code with a set of images with a loop, and save only the first slice of each image?
3 次查看(过去 30 天)
显示 更早的评论
for sliceIndex = 1 : size(image3d, 3)
thisSlice = image3d(:,:,sliceIndex);
filename = sprintf('Slice #%d.png', sliceIndex);
imwrite(thisSlice, filename);
end
0 个评论
回答(1 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!