BUG: ConvertColorToGrayScale writes all inputs to the first output array
メンテナーはふだん 3 日以内に返信
評価
調査の方向性
src/simplnx/Utilities/ImageProcessing/ColorToGrayScale.cpp の 588~599 行付近にある Execute ループから開始し、その後 ConvertColorToGrayScaleTest.cpp を確認します。既存のテストを実行してその動作を確認し、異なる値を持つ少なくとも 2 つの入力配列を使用したカバレッジを追加して、対応する各 Gray_ 出力に正しいグレースケール値が含まれ、他の出力を上書きしていないことを検証します。
索引モデルが issue の本文から書いたものです。
説明
Description
ConvertColorToGrayScaleFilter writes every converted input array to the first output array when the user selects more than one input array.
Preflight makes one output array for each selected input array (<prefix><input name>). Execute does not move to the next output path. outputPathIter is set to begin() and the loop never increments it:
// Current behavior reuses the first output path for every selected input path.
auto outputPathIter = m_InputValues->OutputDataArrayPaths.begin();
for(const auto& arrayPath : m_InputValues->InputDataArrayPaths)
{
...
auto& outputGrayArray = m_DataStructure.getDataRefAs<UInt8Array>(*outputPathIter);
...
}
The defect has been in the code since the filter was ported in e135e9de0 (#388). #1568 added the comment above but kept the behavior. #1752 moved the file to src/simplnx/Utilities/ImageProcessing/.
Steps to Reproduce
- Create three
uint8color arraysA,B, andCwith 3 components and different values. - Run
ConvertColorToGrayScaleFilterwith all three arrays selected and the prefixGray_.
Expected: Gray_A, Gray_B, and Gray_C contain the gray-scale values of A, B, and C.
Actual: Gray_A contains the gray-scale values of C, because each pass overwrites the previous one. The filter does not write to Gray_B and Gray_C; they keep their initial values. The filter does not show an error or a warning.
Test Coverage
ConvertColorToGrayScaleTest.cpp selects only one input array, so the tests do not find this defect. A fix must increment outputPathIter after each input array, remove the comment, and add a test that selects two or more input arrays with different values.
- 主要言語
- C++
- スター
- 18
- フォーク
- 15
- 平均マージ
- 3日 35分
- マージ済み PR(30日)
- 25
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
BlueQuartzSoftware/simplnx のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
BlueQuartzSoftware/simplnx#1912 ·
メンテナーはふだん 3 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
BlueQuartzSoftware/simplnx#1906 ·
メンテナーはふだん 3 日以内に返信
-
bug Filter
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
BlueQuartzSoftware/simplnx#1891 · 担当者 1 名 ·
メンテナーはふだん 3 日以内に返信
-
bug Filter
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
BlueQuartzSoftware/simplnx#1860 · コメント 1 件 ·
メンテナーはふだん 3 日以内に返信
-
documentation
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
BlueQuartzSoftware/simplnx#1847 ·
メンテナーはふだん 3 日以内に返信
BlueQuartzSoftware/simplnx の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
Sunrisepeak/mcpp-language-server#80 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
xiaoyifang/goldendict-ng#3148 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 91/100
triton-inference-server/server#9069 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 4 日以内に返信