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

Offen Anfängerfreundlich
#1,978 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 6 Tagen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
65/100
Issue-Typ
Dokumentation
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
cpp
Bereich
documentation

Rechercherichtung

Lies die Verschiebungsberechnung in AlignSectionsFeatureCentroid.cpp (Zeilen 17-25), die mit static_cast<int64> zur Null hin abschneidet. Bearbeite dann AlignSectionsFeatureCentroidFilter.md, wo Zeile 21 besagt, dass Verschiebungen auf das nächste Vielfache von Cell gerundet werden, und Zeile 38, dass sie auf ganzzahlige Voxel-Schritte gerundet werden. Fertig, wenn beide Zeilen besagen, dass die Verschiebungen zur Null hin abgeschnitten werden. Ändere die Arithmetik nicht, da das Issue diese Entscheidung offen lässt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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.

Vorherrschende Sprache
C++
Sterne
18
Forks
15
Ø Merge
4 T. 23 Std.
Gemergte PRs (30 T.)
42

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus BlueQuartzSoftware/simplnx

Alle Issues in BlueQuartzSoftware/simplnx

Ähnliche Issues

Weitere Issues zu C++

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.