Skip to content

BUG: Fix SIMPL pipeline conversion bugs and Write Image naming - #1682

Merged
imikejackson merged 5 commits into
BlueQuartzSoftware:developfrom
imikejackson:topic/simpl_to_simplnx_conversion_bugs
Jul 27, 2026
Merged

BUG: Fix SIMPL pipeline conversion bugs and Write Image naming#1682
imikejackson merged 5 commits into
BlueQuartzSoftware:developfrom
imikejackson:topic/simpl_to_simplnx_conversion_bugs

Conversation

@imikejackson

Copy link
Copy Markdown
Contributor

Summary

Fixes a set of conversion bugs found while importing a DREAM3D 6.5.49 pipeline, plus a Write Image naming improvement and a C-Axis segmentation validation fix.

  • Guard optional SIMPL keys (IgnoredDataArrayPaths, RandomizeFeatureIds) in FromSIMPLJson() for NeighborOrientationCorrelation, RequireMinNumNeighbors, ErodeDilateBadData, FillBadData, and CAxisSegmentFeatures. Pre-6.6 pipelines omit these keys and failed to convert with "Key not found in json" errors; the filter default is now used instead.
  • Fix wrong argument mappings in FromSIMPLJson():
    • WritePoleFigure no longer maps the CrystalStructures DataContainer onto the created Output Image Geometry (which collided with the existing input geometry); the "PoleFigure" default is used.
    • ComputeAvgOrientations, ComputeFeatureReferenceMisorientations, and ComputeSurfaceFeatures derive the Feature Attribute Matrix from a feature-level array path instead of FeatureIds (which lives in the cell attribute matrix).
    • ComputeAvgCAxes derives the Feature Attribute Matrix from the AvgCAxes path and fills the NX-only Cell Phases / Crystal Structures parameters with conventional locations instead of invalid attribute-matrix paths.
    • CopyFeatureArrayToElementArray leaves the Created Array Suffix blank so the copied array keeps the input array's name, instead of concatenating the legacy CreatedArrayName onto it.
  • CAxisSegmentFeatures skips phase 0 (unindexed) and masked-out cells in the crystal-structure validation loop so only phases that participate in the segmentation must be hexagonal.
  • Write Image omits the _<index> suffix when the volume produces a single slice, in both the written file name and the preflight "Example Output File" preview. Documentation and unit tests updated, including a new test covering the single-slice naming.

Test Plan

  • ctest -R "SimplnxCore::WriteImageFilter" passes (13/13)
  • Full 51-filter DREAM3D 6.5.49 pipeline converts with nxrunner --convert with zero conversion errors
  • CI passes on all platforms

@imikejackson
imikejackson force-pushed the topic/simpl_to_simplnx_conversion_bugs branch from 18ed460 to c7ac2cc Compare July 22, 2026 22:02
@imikejackson
imikejackson requested a review from JDuffeyBQ July 24, 2026 14:45
DREAM3D 6.5.49 pipelines fail to convert with "Key not found in json"
errors because several FromSIMPLJson() implementations unconditionally
convert keys that were added to the legacy filters after 6.5.49.

* NeighborOrientationCorrelation, RequireMinNumNeighbors,
  ErodeDilateBadData, FillBadData: IgnoredDataArrayPaths
* CAxisSegmentFeatures: RandomizeFeatureIds

Skip the conversion when the key is absent so the filter's default
argument value is used instead, matching the pattern already used by
ReadRawBinary and RemoveFlaggedFeatures.

Signed-off-by: Michael Jackson <mike.jackson@bluequartz.net>
Several FromSIMPLJson() implementations map legacy values onto the
wrong simplnx parameters, producing converted pipelines that fail
preflight or write misnamed output:

* WritePoleFigure: stop mapping the CrystalStructures DataContainer
  onto the created Output Image Geometry; the legacy filter had no
  output geometry and reusing the input container name collides with
  the existing geometry. The "PoleFigure" default is used instead.
* ComputeAvgOrientations, ComputeFeatureReferenceMisorientations,
  ComputeSurfaceFeatures: derive the Feature Attribute Matrix from a
  feature-level array path (AvgQuats/SurfaceFeatures) instead of
  FeatureIds, which lives in the cell attribute matrix.
* ComputeAvgCAxes: derive the Feature Attribute Matrix from the
  AvgCAxes path and stop stuffing attribute-matrix paths into the
  Cell Phases and Crystal Structures array parameters. The legacy
  filter had no phases/structures inputs, so fill the conventional
  locations derived from the FeatureIds path.
* CopyFeatureArrayToElementArray: leave the Created Array Suffix
  blank instead of appending the legacy CreatedArrayName to the
  input array name; the copied array keeps the input array's name.

Signed-off-by: Michael Jackson <mike.jackson@bluequartz.net>
The crystal-structure validation loop rejected the whole input when it
encountered cells with phase 0 (unindexed) or cells excluded by the
mask. Skip those cells so only phases that actually participate in the
segmentation must be Hexagonal-Low/High.

Signed-off-by: Michael Jackson <mike.jackson@bluequartz.net>
A single-slice volume now writes exactly the user-specified file name;
the _<index> suffix is only appended when multiple slices are produced.

* Apply the rule in the algorithm's per-slice writer and in the
  preflight "Example Output File" preview
* Document the single-slice behavior in the filter markdown
* Add a unit test asserting the un-suffixed name (preflight preview,
  written file, and absence of the _000 variant)
* Read single-slice test output back with ReadImageFilter since a
  generated file list cannot describe an un-indexed file name

Signed-off-by: Michael Jackson <mike.jackson@bluequartz.net>
The 'Example Output File' preflight value was assembled with
fmt::format("{}/{}...") which hard-codes a forward slash between the
parent directory and the file name. On Windows the parent path uses
backslashes, producing a mixed-separator string that failed the
single-slice unit test's comparison against
fs::absolute(outputPath).string() (and displayed inconsistently in the
GUI). Build the preview with the std::filesystem path append operator
so the separator is always native.

Signed-off-by: Michael Jackson <mike.jackson@bluequartz.net>
@imikejackson
imikejackson force-pushed the topic/simpl_to_simplnx_conversion_bugs branch from cb0586f to 8e0824f Compare July 27, 2026 14:17
@imikejackson
imikejackson merged commit 5eb69f3 into BlueQuartzSoftware:develop Jul 27, 2026
6 checks passed
@imikejackson
imikejackson deleted the topic/simpl_to_simplnx_conversion_bugs branch July 27, 2026 17:50
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.

2 participants