Skip to content

ENH: Add Use Feature Ids option to ComputeKernelAvgMisorientations#1674

Open
imikejackson wants to merge 11 commits into
BlueQuartzSoftware:developfrom
imikejackson:topic/kam_ignore_feature_ids
Open

ENH: Add Use Feature Ids option to ComputeKernelAvgMisorientations#1674
imikejackson wants to merge 11 commits into
BlueQuartzSoftware:developfrom
imikejackson:topic/kam_ignore_feature_ids

Conversation

@imikejackson

Copy link
Copy Markdown
Contributor

Summary

Adds a use_feature_ids boolean parameter (default: true) to the Compute Kernel Average Misorientations filter.

  • Checked (default): unchanged per-grain KAM — kernel neighbors contribute only when they share the focal cell's Feature Id. Verified behavior-identical to the previous implementation.
  • Unchecked: per-voxel KAM — the average may cross grain boundaries; a neighbor contributes when it is in-bounds, has Feature Id > 0, and matches the focal cell's Phase. The focal-cell validity gate (Feature Id > 0 and Phase > 0) is unchanged in both modes.
  • parametersVersion() bumped 1 → 2; the three shipping pipelines that use the filter are migrated; SIMPL-converted and older NX pipelines pick up the default via argument backfill.
  • Three new inline analytical unit tests (per-voxel multi-feature fixture, two-phase gate fixture, per-grain/per-voxel mode-equivalence invariant) extend the existing Class 1/Class 4 suite — no exemplar archives.
  • V&V report reopened (status DRAFT pending re-sign-off): code paths re-enumerated per mode, oracle section extended with the new hand-derived fixtures, and a runtime A/B against DREAM3D 6.5.171 on the default path (identical seeded synthetic input through both runners; max |Δ| = 0.0072°, consistent with the documented EbsdLib 2.4.1 precision deviation). Per-voxel mode is recorded as an NX-only capability deviation.
  • Review-driven cleanup of pre-existing code in the algorithm: getDataRefAs for the validated geometry, signed kernel boundary clamps with the neighbor index computed from the clamped indices, LaueOps list built once per run, per-row cancel checks, progress-increment floor, removal of the unreachable numVoxel == 0 fallback, and real Doxygen. All behavior-preserving.

Fixes #1613

Test Plan

  • Tests pass on in-core build (filter suite 9/9; OrientationAnalysis 258/258; FilterValidation 5/5)
  • Tests pass on out-of-core build (filter suite 9/9)

@imikejackson
imikejackson requested a review from JDuffeyBQ July 16, 2026 16:00
* Add use_feature_ids BoolParameter (default true keeps the original
  per-grain behavior)
* When false, KAM is computed per-voxel: kernel neighbors contribute if
  featureId > 0 and their phase matches the central cell, allowing the
  average to cross feature boundaries
* Bump parametersVersion to 2
* Add Class 1 analytical test for the per-voxel mode

Fixes BlueQuartzSoftware#1613

Signed-off-by: Michael Jackson <mike.jackson@bluequartz.net>
* Two-phase fixture verifies per-voxel neighbor gates: different-phase
  and featureId=0 neighbors are excluded; featureId=0 focal cells still
  output 0
* Mode-equivalence invariant: per-grain and per-voxel modes are
  bit-identical on single-feature single-phase data

Signed-off-by: Michael Jackson <mike.jackson@bluequartz.net>
* Add use_feature_ids (true) and bump parameters_version to 2 in the
  three pipelines that use the filter

Signed-off-by: Michael Jackson <mike.jackson@bluequartz.net>
…ations

Signed-off-by: Michael Jackson <mike.jackson@bluequartz.net>
* Reopen report for issue BlueQuartzSoftware#1613 feature; re-enumerate code paths for the
  per-mode neighbor gates and map them to the new TEST_CASEs
* Record 6.5.171 A/B results on the default per-grain path
* Add deviation entry: per-voxel mode is an NX-only capability

Signed-off-by: Michael Jackson <mike.jackson@bluequartz.net>
* Fix signed legacy-vs-nx split to the recomputed values
* Reconcile ctest entry count and refresh the exemplar-archive row for
  the reopened 9-path enumeration

Signed-off-by: Michael Jackson <mike.jackson@bluequartz.net>
* Reconcile code-path exercised count (9 enumerated, 8 exercised)
* Record A/B input generator seed and recipe for reproducibility
* Clarify per-voxel phase-gate rationale in user documentation

Signed-off-by: Michael Jackson <mike.jackson@bluequartz.net>
* Use getDataRefAs for the parameter-validated ImageGeom (two sites)
* Make kernel boundary clamps signed and compute the neighbor index
  from the clamped indices, removing the vacuous negative checks
* Build the LaueOps list once per run as a worker member
* Check cancellation per row instead of per plane
* Floor the progress increment at 1 for thin chunk ranges
* Remove the unreachable numVoxel == 0 fallback and fold the
  invalid-cell reset into an else branch
* Replace placeholder Doxygen with real class documentation

Signed-off-by: Michael Jackson <mike.jackson@bluequartz.net>
* Note Image Geometry requirement and degree units; link related
  misorientation filters
* Re-cite shifted line numbers; path enumeration now 8 of 8 after the
  dead numVoxel fallback was removed

Signed-off-by: Michael Jackson <mike.jackson@bluequartz.net>
Signed-off-by: Michael Jackson <mike.jackson@bluequartz.net>
The section (path-to-TEST_CASE mapping table) was dropped accidentally
during a commit amend before push.

Signed-off-by: Michael Jackson <mike.jackson@bluequartz.net>
@imikejackson
imikejackson force-pushed the topic/kam_ignore_feature_ids branch from 785d491 to 503ef1c Compare July 16, 2026 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Kernel Average Misorientation Ignore FeatureIds option

1 participant