In a 3D image, a mask represents the 'tumor volume.'
How can I easily find its pixel range: [Xmin, Xmax], [Ymin, Ymax], and [Zmin, Zmax]?
I know there is dumb way to do this, but I’m sure MATLAB has a smarter function to achieve this.
Could you suggest an efficient method?
Thanks for your help!

 採用された回答

Matt J
Matt J 2025 年 2 月 14 日
編集済み: Matt J 2025 年 2 月 14 日

0 投票

[Y,X,Z]=find(Mask);
S=X+Y+Z;
[~,i]=min(S);
[~,j]=max(S);
[Xmin,Ymin,Zmin, Xmax,Ymax,Zmax] =deal( X(i), Y(i), Z(i), X(j), Y(j), Z(j))

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeImage Processing Toolbox についてさらに検索

製品

リリース

R2024b

質問済み:

2025 年 2 月 14 日

編集済み:

2025 年 2 月 14 日

Community Treasure Hunt

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

Start Hunting!

Translated by