Skip to content

BUG: Use one EbsdLib space-group mapping in Read GrainMapper3D - #1962

Closed
imikejackson wants to merge 2 commits into
BlueQuartzSoftware:developfrom
imikejackson:topic/gm3d_space_group_laue
Closed

imikejackson wants to merge 2 commits into
BlueQuartzSoftware:developfrom
imikejackson:topic/gm3d_space_group_laue

Conversation

@imikejackson

@imikejackson imikejackson commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Read GrainMapper3D showed one crystal symmetry in the preview and imported a different one for 82 of the 230 space groups. The preview used EbsdLib to find the Laue class. The import used a separate copy of the mapping in GrainMapper3DUtilities. The EbsdLib function had an error, and BlueQuartzSoftware/EbsdLib#67 fixes it. This pull request removes the copy, so that the preview and the import use the same EbsdLib mapping.

  • GrainMapper3DUtilities::GetLaueIndexFromSpaceGroup is removed. The preview and the import call LaueOps::GetLaueOpsFromSpaceGroupNumber and LaueOps::GetLaueOpsIndexFromSpaceGroupNumber.
  • A space group of 0 or less, or above 230, is an error (-67600) in preflight and in execute: File '<path>' phase <N> has invalid Space Group <value>. Use a space group from 1 to 230. Before, the preview used a null pointer, and the import threw an exception (0 or less) or gave Cubic-High (above 230). Preflight and execute use one helper, GrainMapper3DUtilities::ValidateSpaceGroups. BUG: Validate EBSD reader headers, scans and slice ranges #1967 uses the same code and message for the same check, so the rebase of whichever pull request merges second is simple.
  • The reader checks the size of each value that it reads from the file header. Before, a short dataset was read past its end and gave incorrect values or a crash.
    • /PhaseInfo/PhaseNN/UnitCell must have 6 values (-38609).
    • Extent, Spacing, Center and VirtualShift must have 3 values in each selected group: LabDCT -38610 to -38613, AbsorptionCT -38614 to -38617.
    • /LabDCT/Data/Completeness must exist (-38618) and have 3 dimensions (-38619).
    • Each message gives the file, the dataset path, the number of values found and expected, and an action to take.
  • The import uses the phase information that the header read already read. It checks the selected headers before it copies data.
  • New tests:
    • ReadGrainMapper3D:SpaceGroupSymmetry checks one space group from each Laue class that EbsdLib gave incorrectly, plus space group 225. It compares the preview text and the imported CrystalStructures value with written expected values.
    • ReadGrainMapper3D:InvalidSpaceGroup checks -1, 0, 231 and the largest int32 value: preflight and execute without preflight both give -67600 with the file, phase and value in the message, and no CrystalStructures value is written.
    • ReadGrainMapper3D:InvalidUnitCell, ReadGrainMapper3D:InvalidHeaderReads and ReadGrainMapper3D:ReadSelections check each new error code, in preflight and in execute without preflight, and the four combinations of Read LabDCT and Read AbsorptionCT.
  • The filter documentation describes the space-group mapping and the new checks.

Blocked — do not merge yet. This pull request needs the EbsdLib version that has LaueOps::GetLaueOpsIndexFromSpaceGroupNumber (BlueQuartzSoftware/EbsdLib#67). Merge after that EbsdLib release is available and the simplnx vcpkg registry is updated. Until then, CI cannot build this pull request, so it is a draft.

Test Plan

  • macOS, Release, DREAM3D-NX build with this simplnx and the EbsdLib branch of BUG: Map space groups 1-230 to the correct Laue class EbsdLib#67: all ReadGrainMapper3D tests pass, together with the EbsdLib LaueOps, CtfReader, CtfPhase and PhaseTest tests (64 tests).
  • With the old code restored, the new tests fail: the space-group test, the UnitCell check, the header checks and the execute-side AbsorptionCT header read.
  • macOS, Release, DREAM3D-NX build with the local EbsdLib develop (which contains BUG: Map space groups 1-230 to the correct Laue class EbsdLib#67): all 11 ReadGrainMapper3D tests pass. InvalidSpaceGroup failed on the previous commit of this branch (8 assertions, four values in preflight and execute).
  • Out-of-core validation: not run yet. It will be run after the current out-of-core merges are complete.
  • CI passes after the EbsdLib release.

Related Issue

Closes #1953
Related to #1868 (this pull request fixes item ReadGrainMapper3DFilter#3)
Related to #1867 (item ReadGrainMapper3DFilter#7, class C07e)
Related to #1879 (the preview crash for an invalid space group, now tracked in #1867 class C07e, does not occur)

@imikejackson imikejackson self-assigned this Nov 11, 2026
* The preview used EbsdLib to find the Laue class of each phase. The
  import used a separate copy of the mapping in GrainMapper3DUtilities.
  The EbsdLib function had an error, so the two disagreed for 82 of the
  230 space groups. For example, space group 2 showed Monoclinic in the
  preview and imported as Triclinic.
* Remove GrainMapper3DUtilities::GetLaueIndexFromSpaceGroup. The preview
  and the import now both use the corrected EbsdLib functions. A space
  group of 0 or less, or above 230, gives Unknown. Before, the preview
  used a null pointer and the import threw an exception or gave
  Cubic-High.
* The reader now checks the size of each value it reads from the file
  header. UnitCell must have 6 values. Extent, Spacing, Center and
  VirtualShift must have 3 values in each selected group.
  Data/Completeness must exist and have 3 dimensions. Before, a short
  dataset was read past its end. Each check has its own error code,
  from -38609 to -38619.
* The import uses the phase information that the header read already
  read, and it checks the selected headers before it copies data.
* Add tests for the space-group mapping, the header checks and the four
  combinations of Read LabDCT and Read AbsorptionCT.
* Update the filter documentation.

This change needs the EbsdLib version that has
LaueOps::GetLaueOpsIndexFromSpaceGroupNumber.

Signed-off-by: Michael Jackson <mike.jackson@bluequartz.net>
A phase SpaceGroup outside 1 to 230 now gives error -67600 in preflight
and in execute, instead of importing as Unknown. Preflight and execute
use one ValidateSpaceGroups helper, and the message names the file, the
phase and the value.

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

Copy link
Copy Markdown
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

imikejackson added a commit to imikejackson/simplnx that referenced this pull request Nov 14, 2026
…uartzSoftware#1962)

Originally simplnx BlueQuartzSoftware#1962 (branch topic/gm3d_space_group_laue), combined into this branch for the EbsdLib 3.1.4 update.

Signed-off-by: Michael Jackson <mike.jackson@bluequartz.net>
imikejackson added a commit to imikejackson/simplnx that referenced this pull request Nov 14, 2026
- The merge of BlueQuartzSoftware#1962 into the combined branch joined the last BlueQuartzSoftware#1967 test case
  and the first BlueQuartzSoftware#1962 test case without the closing brace between them, so
  ReadGrainMapper3DTest.cpp did not compile.

Signed-off-by: Michael Jackson <mike.jackson@bluequartz.net>
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.

ENH: Resolve GrainMapper3D SpaceGroup-to-Laue mapping disagreement

1 participant