DOC: Align Sections (Feature Centroid) says shifts are rounded, but they are truncated

未关闭 适合新手
#1,978 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 6 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
65/100
Issue 类型
文档
描述清晰度
基本清楚
活跃度
活跃
技术栈
cpp
领域
documentation

调研方向

阅读 AlignSectionsFeatureCentroid.cpp 第 17-25 行的位移计算,它通过 static_cast<int64> 向零截断。然后编辑 AlignSectionsFeatureCentroidFilter.md,第 21 行写的是位移四舍五入到最接近的 Cell 倍数,第 38 行写的是四舍五入到整数体素增量。两行都改为位移向零截断时即完成。不要改动运算逻辑,因为该 issue 对此决定保持开放。

由索引模型根据 Issue 内容生成。

描述

documentation

Summary

The documentation of Align Sections (Feature Centroid) says that the section shifts are rounded to the nearest cell. The code truncates them toward zero. The page should describe what the code does.

How it works now. AlignSectionsFeatureCentroid.cpp lines 17-25 converts a centroid difference to a whole-cell shift with static_cast<int64>((centroid - referenceCentroid) / spacing). This truncates toward zero: a difference of +1.75 cells gives a shift of +1, and -1.75 cells gives -1. Both the in-core (Direct) and the out-of-core (Scanline) paths use this function.

What the documentation says. AlignSectionsFeatureCentroidFilter.md line 21 says "Round the shifts to the nearest multiple of the Cell resolution", and line 38 says "Shifts are rounded to integer voxel increments". A user who reads this expects +1.75 cells to give +2.

Why it matters. The documented and actual shifts differ by one cell whenever the fractional part of a centroid difference is 0.5 or more. A user who checks the output against the documentation sees a wrong result.

Where it applies. Only the documentation page. The request is to state that shifts are truncated toward zero. Whether the arithmetic should instead change to rounding (which would change results compared with DREAM3D 6.5.171 and the existing exemplars) is still open.

Found during the review of the #1908 batch 4 changes (items L77 and L78). No open issue covered it.

主要语言
C++
星标
18
派生
15
平均合并
4 天 23 小时
30 天内合并 PR
42

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

BlueQuartzSoftware/simplnx 的其他 Issue

查看 BlueQuartzSoftware/simplnx 的全部 Issue

相似的 Issue

更多 C++ Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。