Repository navigation
BUG: Reject zero and nonfinite misorientation axes and loading directions - #1969
Closed
imikejackson wants to merge 1 commit into
Closed
imikejackson wants to merge 1 commit into
imikejackson wants to merge 1 commit into
Conversation
…ions - Compute Misorientation, Compute GBCD Pole Figure, Write GBCD Pole Figure (GMT 5), Compute GBCD (Metric-Based Approach) and Compute Feature Boundary Strength Metrics accepted an axis or direction of [0, 0, 0] or with a NaN or infinite component. The filters then normalized it to NaN or to a zero vector and wrote wrong data with no error. - Each algorithm now has a static check that preflight and the algorithm both call: -68005, -34646 (Direct and Scanline), -96714, -94744. Compute GBCD (Metric-Based Approach) keeps -7231 for the axis, now also for NaN and infinity, and -7230 now also rejects a NaN angle. - The axes are normalized with OrientationUtilities::NormalizeDirection(), which scales by the largest component in double precision, so a large finite axis such as [1e20, 1e20, 1e20] no longer overflows float32 to a zero axis. - The Loading Direction default changes from [0, 0, 0] to [1, 1, 1] (the DREAM3D 6.5 default). The Misorientation Axis-Angle default of Write GBCD Pole Figure (GMT 5) changes from [0, 0, 0, 0] to 60 degrees about [1, 1, 1]. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
This was referenced Nov 13, 2026
Contributor
Author
|
Closed in favor of #1973, which merges this branch (with its history) together with the other EBSD fixes that need the next EbsdLib release (BlueQuartzSoftware/EbsdLib#86). The branch is kept. 🤖 Generated with Claude Code |
This was referenced Nov 13, 2026
imikejackson
added a commit
to imikejackson/simplnx
that referenced
this pull request
Nov 14, 2026
…ions (BlueQuartzSoftware#1969) Originally simplnx BlueQuartzSoftware#1969 (branch fix/orientation-axis-direction-validation), combined into this branch for the EbsdLib 3.1.4 update. Signed-off-by: Michael Jackson <mike.jackson@bluequartz.net>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Five OrientationAnalysis filters accepted an axis or direction parameter of [0, 0, 0], or with a NaN or infinite component. They normalized it to NaN (or Eigen left it as a zero vector), passed it to the EbsdLib
AxisAngleconversions or the LaueOps metrics, and reported success with wrong output:Vec3::normalize()made it NaN, so the m', F1, F1spt and F7 outputs were NaN.Changes:
preflightImpl()and the algorithm'soperator()()both call, so the algorithm also rejects the value when it runs without its filter. The message names the parameter and the value and suggests a valid axis.OrientationUtilities::NormalizeDirection()(header-only, OrientationAnalysis) rejects nonfinite and zero vectors and normalizes after scaling by the largest component, in double precision. Compute GBCD Pole Figure and Write GBCD Pole Figure (GMT 5) normalized in float32, so a finite axis such as [1e20, 1e20, 1e20] overflowed to a zero axis; it now gives the same result as [1, 1, 1].FindBoundaryStrengthsdefault. Misorientation Axis-Angle of Write GBCD Pole Figure (GMT 5) changes from [0, 0, 0, 0] to 60 degrees about [1, 1, 1] (the Σ3 twin, the default of Compute GBCD Pole Figure). DREAM3D 6.5VisualizeGBCDGMTalso defaulted to all zeros, so there is no valid legacy default to restore. SIMPL pipeline conversion always sets these values from the file, so only new filter instances see the new defaults. A saved pipeline that still holds a zero vector now fails preflight instead of writing NaN.Valid input gives the same output as before: every existing test of the five filters passes unchanged.
Overlap with open pull requests
ComputeBoundaryStrengths.cpp(Laue class warning, other hunks) andOrientationUtilities.hpp/.cpp(top of file). No hunk overlaps; this change appendsNormalizeDirection()at the end of the header.WriteGBCDGMTFileFilter.cpp::executeImpl()andComputeGBCDMetricBased.cpp(top of file). No hunk overlaps.Existing branches
I checked every branch on
originandforkfor commits not indevelopthat touch the changed files. None fixes these items. The only other branch that touches them isfix/writegbcdgmt-crystal-structure-check(#1970, Write GBCD GMT files, different hunks). The branches of #1919 and #1859 are not on those remotes; their diffs were checked above.Test Plan
develop(0cd2009) and pass with this change. Ondevelop, preflight and execute returned success for every invalid axis, the default-value tests failed, and the scaled-axis pole figure differed (40.0 == Approx(48.083)):OrientationAnalysis::ComputeMisorientationsFilter: Invalid Reference Axis(filter and algorithm without filter; Use Arrays mode ignores the axis)OrientationAnalysis::ComputeGBCDPoleFigureFilter: Invalid Misorientation Axis(filter, Direct and Scanline executors)OrientationAnalysis::ComputeGBCDPoleFigureFilter: Misorientation Axis Scale(both algorithm paths)OrientationAnalysis::WriteGBCDGMTFileFilter: Invalid Misorientation AxisOrientationAnalysis::WriteGBCDGMTFileFilter: Default Misorientation Axis-AngleOrientationAnalysis::WriteGBCDGMTFileFilter: Misorientation Axis ScaleOrientationAnalysis::ComputeGBCDMetricBasedFilter: Nonfinite Fixed MisorientationOrientationAnalysis::ComputeBoundaryStrengthsFilter: Invalid Loading DirectionOrientationAnalysis::ComputeBoundaryStrengthsFilter: Default Loading Directionctest -R "OrientationAnalysis::(ComputeMisorientationsFilter|ComputeGBCDPoleFigureFilter|WriteGBCDGMTFileFilter|ComputeGBCDMetricBasedFilter|ComputeBoundaryStrengthsFilter)".SIMPLNX_TEST_ALGORITHM_PATH=0). New tests use synthetic data written by the test; the Metric-Based test uses the existingcompute_gbcd_metric_basedarchive. No new data archives.bluequartz-skills:cpp-best-practices,bluequartz-skills:simplnx-best-practices,filter-implementation,implement-filter-tests,error-messages,dual-build-protocol,clang-format,github-workflow.docs/Coding_Knowledge_Base.mdwas followed instead.Related Issue
Related to #1873 (items
ComputeMisorientationsFilter#2,ComputeGBCDPoleFigureFilter#5,WriteGBCDGMTFileFilter#1,ComputeGBCDMetricBasedFilterlines 149 and 154,ComputeBoundaryStrengthsFilter#2) and the default-value decision in #1875.🤖 Generated with Claude Code