MorphologyOps.foreground_component() ignores connectivity parameter, always uses 1-connectivity
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 55/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 停滞
- 技術スタック
- python
調査の方向性
MorphologyOps.foreground_component() から始め、初期化および self.connectivity を使用する他のメソッドと比較します。neigh=6 のような使用例も含め、連結成分のラベリングが設定された連結性を尊重すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Problem Description
The MorphologyOps class in 1 accepts a connectivity parameter during initialization, but the foreground_component() method 2 completely ignores this parameter and always uses scipy's default 1-connectivity (4-connectivity for 2D, 6-connectivity for 3D).
Current Behavior
def foreground_component(self):
return ndimage.label(self.binary_map) # No structure parameter specified
When scipy.ndimage.label() is called without the structure parameter, it defaults to:
structure = _morphology.generate_binary_structure(input.ndim, 1) # 1-connectivity
Expected Behavior
The method should respect the connectivity parameter passed during class initialization, similar to how other methods in the class use self.connectivity.
Evidence of Inconsistency
-
Class initialization accepts connectivity: 1
-
Other methods use connectivity: Other methods in the codebase properly use the connectivity parameter, as seen in 3
-
Real usage expects different connectivity: In practice, the class is instantiated with different connectivity values, such as
neigh=6in 4
Proposed Solution
Modify the foreground_component() method to use the stored connectivity parameter:
def foreground_component(self):
structure = generate_binary_structure(self.binary_map.ndim, self.connectivity)
return ndimage.label(self.binary_map, structure=structure)
Impact
This inconsistency may lead to unexpected results in connected component analysis, especially for users who expect the specified connectivity to be applied consistently across all morphological operations.
- 主要言語
- Python
- スター
- 104
- フォーク
- 18
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトの環境構築ファイルはまだ確認していません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Project-MONAI/MetricsReloaded のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 50/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 52/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
Project-MONAI/MetricsReloaded の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
spec-kitty/spec-kitty#5319 ·
メンテナーはふだん 1 日以内に返信
-
backend::vllm diffusion multimodal
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
openai/openai-agents-python#5229 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信