Main Content

このページの内容は最新ではありません。最新版の英語を参照するには、ここをクリックします。

bwmorph3

バイナリ ボリュームのモルフォロジー演算

説明

J = bwmorph3(V,operation) は、モルフォロジー演算をバイナリ ボリューム V に適用し、演算結果をバイナリ ボリューム J で返します。

すべて折りたたむ

3 次元 MRI ボリューム データを読み込み、バイナリ ボリュームを作成します。volshow を使用して、灰色のボリューム データを表示します。

load mristack;
BW1 = mristack > 127;
cmap = [0.6 0.6 0.6];
volshow(BW1,Colormap=cmap);

1 に設定されているボクセルであり、かつ、0 に設定されているボクセルで囲まれているボクセルを削除するには、ボリューム データで "clean" 操作を実行します。削除するボクセルを決定するとき、"clean" 操作で 26 個の隣接するボクセルを考慮します。volshow を使用して結果を表示します。

BW2 = bwmorph3(BW1,"clean");
volshow(BW2,Colormap=cmap);

比較のために、ボリューム データで "majority" 操作を実行します。"majority" 操作は "clean" 操作と同様のタスクを実行します。ただし、ターゲット ボクセルの近傍にあるボクセルの半分以上 (つまり majority) が 1 に設定されている場合のみ、ボクセルを維持します。維持するボクセルを決定するとき、"majority" 操作も 26 個の隣接ボクセルを考慮します。volshow を使用して結果を表示します。

BW3 = bwmorph3(BW1,"majority");
volshow(BW3,Colormap=cmap);

入力引数

すべて折りたたむ

入力ボリューム。数値配列または logical 配列として指定します。数値入力の場合、非ゼロのピクセルは 1 (true) であると見なされます。

bwmorph3 は 1 次元、2 次元または 3 次元配列を受け付けます。1 次元または 2 次元の入力配列を指定する場合、bwmorph3 は、3 次元ボリュームに対して定義されているモルフォロジー演算を実行します。2 次元の処理を実行する場合は、代わりに bwmorph を使用します。

実行するモルフォロジー演算。以下の文字ベクトルまたは string スカラーのいずれかに指定します。

操作

説明

処理前と処理後の図

"branchpoints"

スケルトンの分岐点を検出する。分岐点は、複数の分岐が交差するジャンクションのボクセルです。

分岐点を見つけるには、イメージをスケルトン化しなければなりません。スケルトン化されたイメージを作成するには、bwskel を使用します。

The original image on the left is a chain of adjacent 1-valued voxels with two branches. The processed image on the right highlights the branch points in green and other voxels in red.

"clean"

0 に設定することで、孤立したボクセルを削除します。孤立ボクセルは、1 に設定されている独立した 26 連結ボクセルで、0 に設定されているボクセルに囲まれているものです。

The original image on the left is a chain of adjacent 1-valued voxels and one additional 1-valued voxel that does not touch any other voxels. The processed image on the right includes the chain and removes the isolated voxel.

"endpoints"

スケルトンの終点を検出します。終点は分岐の端にあるボクセルです。

メモ: 終点を見つけるには、イメージをスケルトン化しなければなりません。スケルトン化されたイメージを作成するには、bwskel を使用します。

The original image on the left is a chain of adjacent 1-valued voxels with two branches. The processed image on the right highlights the four endpoints in green and other voxels in red.

"fill"

1 に設定することで、内部の孤立ボクセル (穴) を塗りつぶします。内部の孤立ボクセルは個別のボクセルで、0 に設定されており、1 に設定されているボクセルで (6 個に連結されて) 囲まれています。

The original image on the left displays a hole, or a 0-valued voxel surrounded by 1-valued voxels on the top, bottom, left, right, front, and back. The processed image on the right fills the hole in the center with the value 1.

"majority"

1 に設定されているボクセルを維持します。ただし 3 x 3 x 3 で、26 個の隣接に連結されたものの中で 14 個以上 (majority) のボクセルが 1 に設定されている場合です。他の場合は、ボクセルを 0 に設定します。

The original image on the left displays a filled half sphere consisting of 1-valued voxels. The processed image on the right shows a filled half sphere with a smaller radius, which formed by removing the exterior shell of the original half sphere where voxels are not connected to a majority of their neighborhood.

"remove"

0 に設定して内部ボクセルを削除します。内部ボクセルは個別のボクセルで、1 に設定されており、1 に設定されているボクセルで (6 個に連結されて) 囲まれています。

The original image on the left is a volume consisting of a 1-valued voxel surrounded by 1-valued voxels on the top, bottom, left, right, front, and back. The processed image on the right shows a hole in the volume formed by setting the interior voxel to 0.

データ型: char | string

出力引数

すべて折りたたむ

モルフォロジー演算後のボリューム。入力ボリューム V と同じサイズの logical 配列として返されます。

ヒント

  • 3 次元ボリュームでモルフォロジー演算の収縮または膨張を行うには、関数 imerode または imdilate に構造化要素 ones(3,3,3) を指定して使用します。

  • 3 次元ボリュームで、モルフォロジー クロージング、オープニング、トップハット フィルター処理またはボトムハット フィルター処理を実行するには、関数 imcloseimopenimtophat、または imbothat に構造化要素 ones(3,3,3) を指定して使用します。

拡張機能

バージョン履歴

R2018a で導入

すべて展開する