フィルターのクリア

How to remove black slices from 3D binary image ?

3 ビュー (過去 30 日間)
agatte
agatte 2016 年 7 月 10 日
コメント済み: agatte 2016 年 7 月 10 日
Hello,
I read a 3D binary image. I would like to remove all black slices from the image. I don't know how can I do it ... Could someone help me please ?
I would appreciate for any help/advice please.

採用された回答

Image Analyst
Image Analyst 2016 年 7 月 10 日
Try this:
[rows, columns, slices] = size(array3d);
slicesToRemove = false(1, slices);
for slice = 1 : slices
thisSlice = array3d(:, :, slice);
if all(all(thisSlice == 0))
slicesToRemove(slice) = true;
end
end
array3d(:, :, slicesToRemove) = [];
  1 件のコメント
agatte
agatte 2016 年 7 月 10 日
Thanks a lot !

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

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by