BUG: ConvertColorToGrayScale writes all inputs to the first output array
维护者通常 3 天内回复
评估
调研方向
从 src/simplnx/Utilities/ImageProcessing/ColorToGrayScale.cpp 中 588-599 行附近的 Execute 循环开始,然后检查 ConvertColorToGrayScaleTest.cpp。运行现有测试以确定其行为,使用至少两个值不同的输入数组添加覆盖,并验证每个对应的 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 分钟
- 30 天内合并 PR
- 25
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
BlueQuartzSoftware/simplnx 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 82/100
BlueQuartzSoftware/simplnx#1945 ·
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
BlueQuartzSoftware/simplnx#1944 ·
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
BlueQuartzSoftware/simplnx#1912 ·
维护者通常 3 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 85/100
BlueQuartzSoftware/simplnx#1906 ·
维护者通常 3 天内回复
-
BUG: Compute C-Axis Locations writes a zero vector for a zero quaternion可能已有人在做 @jmarquisbq 于 2 天前认领。 未关闭bug Filter
难度 2/5 1-3 小时 新手友好度 84/100
BlueQuartzSoftware/simplnx#1891 · 已指派 1 人 ·
维护者通常 3 天内回复
查看 BlueQuartzSoftware/simplnx 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
cloudflare/workerd#8290 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 86/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 84/100
Vector35/binaryninja-api#8715 ·
维护者通常 2 天内回复
-
ai_p3 comp-database-engines
难度 2/5 1-3 小时 新手友好度 72/100
ClickHouse/ClickHouse#130186 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100