How to get XYZ coordinates of all non-zero voxels in a 3D volume?
21 ビュー (過去 30 日間)
古いコメントを表示
Alexander Collins
2020 年 5 月 18 日
コメント済み: Alexander Collins
2020 年 5 月 19 日
I have an NxMxP matrix that forms a volume. Programs like ImageJ have a function to save the XY coordinates of any pixels above a certain threshold, is there a good way to implement this in 3D in matlab?
0 件のコメント
採用された回答
Ameer Hamza
2020 年 5 月 18 日
Try something like this
M = randi([0 5], 20, 30, 10); % example matrix
idx = find(M); % find nonzero values in M
[y,x,z] = ind2sub(size(M), idx);
y is the row number, x is column number, and z is the 3D slice number of non-zero entries.
参考
カテゴリ
Help Center および File Exchange で 3-D Volumetric Image Processing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!