FILT: Create MTRSimFilter that wraps the primary functionality of the MTRSim app and library#1
FILT: Create MTRSimFilter that wraps the primary functionality of the MTRSim app and library#1imikejackson wants to merge 18 commits into
Conversation
Integration of MTR representation codes into DREAM3D-NX filters: MTRSimFilter (algorithm MTRSim, "Generate Synthetic Microtexture"), filter-focused + statistical test strategy, and CI validation. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…der) - Random seed uses standard simplnx UseSeed/SeedValue/SeedArray pattern - Output defaults: geometry "MTR Microstructure", arrays "MTRIds"/"Eulers" - Clarify voxel remap target is SIMPLNX z,y,x (slowest->fastest) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
TDD plan for MTRSimFilter: LibMTRSim driver (buildUniformODF, gridToODFComponent, remapSimToZYX, simulateMTR), the filter + algorithm, deterministic + statistical tests, and CI validation. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Declares MTRSimResult struct and simulateMTR() in MTRSimDriver.hpp/.cpp. The function consolidates PGRF assignment, per-component ODF sampling, and per-voxel orientation assignment into a single call that returns results already remapped into SIMPLNX z,y,x voxel order. Refactors src/app/main.cpp to call simulateMTR() and removes the now- redundant local buildUniformODF() from the anonymous namespace. Adds a statistical end-to-end test (6x6 mm domain, seed=42) that verifies volume fractions land within 0.05 of targets (0.30/0.35/0.35) and that all output Euler angles are within their valid ranges. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…view FIX 1: Rebuild spatialCoords in SIMPLNX z,y,x order (iz outer, iy middle, ix inner) so row k matches sim.phi*/mtrIndex[k]. The old loop used z-x-y order which mismatched coordinates with orientations for non-square grids. FIX 2: Replace magic literals 72, 36, 72 in the simulateMTR call with named constants (k_OdfBinsPhi1/PHI/Phi2) documenting the fixed 5-degree Bunge-Euler MATLAB ODF grid layout (186624 bins). FIX 3: Guard in simulateMTR that pgrf_result.mtrIndex.size() == N; throws std::runtime_error if the PGRF result dimensions are inconsistent. FIX 4: CSV loop now uses sim.nx*sim.ny*sim.nz to tie the bound to the actual result rather than the pre-call N. FIX 5: Add phi2 range check and phi1/phi/phi2 size-equality checks to the statistical driver test. FIX 6: Remove unused <numbers> include from main.cpp; ODFSampler.hpp retained (ODFComponent is used directly). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ight validation + error tests Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Add zero-spacing guard (-13006) before dim() divisions in preflightImpl - Update Physical Size help text to document the 2D (Z=0) mode - Change physicalSize/physicalSpacing members from std::vector<float> to std::vector<float32> to match what executeImpl reads from filterArgs - Change outputs separator label to "Output Data Object(s)" (matches ReadMTRSimODFFilter) - Remove premature #include "simplnx/DataStructure/DataArray.hpp" from stub MTRSim.cpp - Add preflight test for Theta List rows with wrong column count (-13005) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… test
Wire MTRSimFilter to the LibMTRSim simulateMTR entry point: reconstruct
ODFComponents from the selected Float64 cell arrays, build SimulationParams
from filter inputs, run the simulation, and write MTRIds + Eulers into the
output geometry cell AttributeMatrix. Polar coloring (Task 8) is deferred.
Add preflight non-negativity/range hardening (error -13007) requiring each
Volume Fraction value to lie in [0, 1].
Add an end-to-end execute test (100x100 = 10000 voxels, seed 42, 3 components)
that verifies array contract (types/components/tuples), id set {1,2,3},
finite Bunge-bounded Eulers, recorded seed, and loose volume fractions.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Remove params.seed = m_InputValues->seed (dead write; rng is seeded directly) - Add clarifying comment noting simulateMTR uses the rng, not SimulationParams::seed - Remove unused #include <cmath> from MTRSim.cpp - Move per-element VF range check (-13007) before sum check (-13003) so out-of-range values produce the precise diagnostic rather than the misleading sum message - Remove redundant size/spacing/VF args.insertOrAssign calls in execute test that duplicated what MakeValidArgs already sets; keep seed overrides Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* Implement MTRSim::applyPolarColoring using IPFMapper with the MatLab HCP colour scheme and Z-axis reference direction * Call applyPolarColoring from operator() when generatePolarColoring is true; short-circuits on error; leaves no array when the flag is false * Add two unit tests: polar ON verifies array shape (3 components, 10000 tuples) and non-zero content; polar OFF asserts array is absent Signed-off-by: Michael Jackson <mike.jackson@bluequartz.net>
Documents all parameters, output arrays, preflight error codes, the units consistency requirement for Physical Size / Spacing / Theta List, and the expected single-stage progress behaviour for large volumes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
clang-format
[clang-format] reported by reviewdog 🐶
MTRSim/src/MTRSim/Filters/Algorithms/MTRSim.cpp
Lines 91 to 95 in 4f5504c
[clang-format] reported by reviewdog 🐶
MTRSim/src/MTRSim/Filters/Algorithms/MTRSim.cpp
Lines 98 to 99 in 4f5504c
[clang-format] reported by reviewdog 🐶
MTRSim/src/MTRSim/Filters/Algorithms/MTRSim.cpp
Lines 108 to 110 in 4f5504c
[clang-format] reported by reviewdog 🐶
MTRSim/src/MTRSim/Filters/Algorithms/MTRSim.cpp
Lines 112 to 113 in 4f5504c
[clang-format] reported by reviewdog 🐶
MTRSim/src/MTRSim/Filters/Algorithms/MTRSim.cpp
Lines 122 to 123 in 4f5504c
[clang-format] reported by reviewdog 🐶
MTRSim/src/MTRSim/Filters/Algorithms/MTRSim.cpp
Lines 125 to 127 in 4f5504c
[clang-format] reported by reviewdog 🐶
[clang-format] reported by reviewdog 🐶
MTRSim/src/MTRSim/Filters/Algorithms/MTRSim.cpp
Lines 132 to 135 in 4f5504c
[clang-format] reported by reviewdog 🐶
MTRSim/src/MTRSim/Filters/Algorithms/MTRSim.hpp
Lines 13 to 14 in 4f5504c
[clang-format] reported by reviewdog 🐶
MTRSim/src/MTRSim/Filters/Algorithms/MTRSim.hpp
Lines 16 to 17 in 4f5504c
[clang-format] reported by reviewdog 🐶
MTRSim/src/MTRSim/Filters/Algorithms/MTRSim.hpp
Lines 36 to 37 in 4f5504c
[clang-format] reported by reviewdog 🐶
MTRSim/src/MTRSim/Filters/Algorithms/MTRSim.hpp
Lines 39 to 40 in 4f5504c
[clang-format] reported by reviewdog 🐶
[clang-format] reported by reviewdog 🐶
MTRSim/src/MTRSim/Filters/Algorithms/MTRSim.hpp
Lines 45 to 48 in 4f5504c
[clang-format] reported by reviewdog 🐶
MTRSim/src/MTRSim/Filters/Algorithms/MTRSim.hpp
Lines 53 to 57 in 4f5504c
[clang-format] reported by reviewdog 🐶
MTRSim/src/MTRSim/Filters/MTRSimFilter.cpp
Lines 29 to 30 in 4f5504c
[clang-format] reported by reviewdog 🐶
MTRSim/src/MTRSim/Filters/MTRSimFilter.cpp
Lines 32 to 33 in 4f5504c
[clang-format] reported by reviewdog 🐶
MTRSim/src/MTRSim/Filters/MTRSimFilter.cpp
Lines 38 to 39 in 4f5504c
[clang-format] reported by reviewdog 🐶
MTRSim/src/MTRSim/Filters/MTRSimFilter.cpp
Lines 44 to 47 in 4f5504c
[clang-format] reported by reviewdog 🐶
MTRSim/src/MTRSim/Filters/MTRSimFilter.cpp
Lines 50 to 51 in 4f5504c
[clang-format] reported by reviewdog 🐶
MTRSim/src/MTRSim/Filters/MTRSimFilter.cpp
Lines 56 to 57 in 4f5504c
[clang-format] reported by reviewdog 🐶
MTRSim/src/MTRSim/Filters/MTRSimFilter.cpp
Lines 62 to 63 in 4f5504c
[clang-format] reported by reviewdog 🐶
MTRSim/src/MTRSim/Filters/MTRSimFilter.cpp
Lines 67 to 71 in 4f5504c
[clang-format] reported by reviewdog 🐶
[clang-format] reported by reviewdog 🐶
MTRSim/src/MTRSim/Filters/MTRSimFilter.cpp
Lines 82 to 87 in 4f5504c
[clang-format] reported by reviewdog 🐶
MTRSim/src/MTRSim/Filters/MTRSimFilter.cpp
Lines 89 to 97 in 4f5504c
[clang-format] reported by reviewdog 🐶
MTRSim/src/MTRSim/Filters/MTRSimFilter.cpp
Lines 100 to 106 in 4f5504c
[clang-format] reported by reviewdog 🐶
MTRSim/src/MTRSim/Filters/MTRSimFilter.cpp
Line 109 in 4f5504c
[clang-format] reported by reviewdog 🐶
MTRSim/src/MTRSim/Filters/MTRSimFilter.cpp
Lines 115 to 118 in 4f5504c
[clang-format] reported by reviewdog 🐶
MTRSim/src/MTRSim/Filters/MTRSimFilter.cpp
Lines 121 to 122 in 4f5504c
[clang-format] reported by reviewdog 🐶
MTRSim/src/MTRSim/Filters/MTRSimFilter.cpp
Lines 127 to 132 in 4f5504c
[clang-format] reported by reviewdog 🐶
MTRSim/src/MTRSim/Filters/MTRSimFilter.cpp
Lines 147 to 149 in 4f5504c
[clang-format] reported by reviewdog 🐶
MTRSim/src/MTRSim/Filters/MTRSimFilter.cpp
Lines 151 to 153 in 4f5504c
[clang-format] reported by reviewdog 🐶
MTRSim/src/MTRSim/Filters/MTRSimFilter.cpp
Lines 155 to 159 in 4f5504c
[clang-format] reported by reviewdog 🐶
MTRSim/src/MTRSim/Filters/MTRSimFilter.cpp
Lines 163 to 164 in 4f5504c
[clang-format] reported by reviewdog 🐶
MTRSim/src/MTRSim/Filters/MTRSimFilter.cpp
Lines 167 to 169 in 4f5504c
[clang-format] reported by reviewdog 🐶
MTRSim/src/MTRSim/Filters/MTRSimFilter.cpp
Lines 171 to 173 in 4f5504c
[clang-format] reported by reviewdog 🐶
MTRSim/src/MTRSim/Filters/MTRSimFilter.cpp
Lines 175 to 179 in 4f5504c
[clang-format] reported by reviewdog 🐶
MTRSim/src/MTRSim/Filters/MTRSimFilter.cpp
Lines 183 to 185 in 4f5504c
[clang-format] reported by reviewdog 🐶
MTRSim/src/MTRSim/Filters/MTRSimFilter.cpp
Line 188 in 4f5504c
[clang-format] reported by reviewdog 🐶
MTRSim/src/MTRSim/Filters/MTRSimFilter.cpp
Line 195 in 4f5504c
[clang-format] reported by reviewdog 🐶
MTRSim/src/MTRSim/Filters/MTRSimFilter.cpp
Lines 198 to 205 in 4f5504c
[clang-format] reported by reviewdog 🐶
MTRSim/src/MTRSim/Filters/MTRSimFilter.cpp
Line 207 in 4f5504c
[clang-format] reported by reviewdog 🐶
MTRSim/src/MTRSim/Filters/MTRSimFilter.cpp
Lines 209 to 210 in 4f5504c
[clang-format] reported by reviewdog 🐶
MTRSim/src/MTRSim/Filters/MTRSimFilter.cpp
Lines 216 to 218 in 4f5504c
[clang-format] reported by reviewdog 🐶
MTRSim/src/MTRSim/Filters/MTRSimFilter.cpp
Lines 220 to 231 in 4f5504c
[clang-format] reported by reviewdog 🐶
MTRSim/src/MTRSim/Filters/MTRSimFilter.cpp
Lines 234 to 236 in 4f5504c
[clang-format] reported by reviewdog 🐶
MTRSim/src/MTRSim/Filters/MTRSimFilter.cpp
Line 238 in 4f5504c
[clang-format] reported by reviewdog 🐶
MTRSim/src/MTRSim/Filters/MTRSimFilter.cpp
Lines 245 to 246 in 4f5504c
[clang-format] reported by reviewdog 🐶
MTRSim/src/MTRSim/Filters/MTRSimFilter.cpp
Line 255 in 4f5504c
[clang-format] reported by reviewdog 🐶
MTRSim/src/MTRSim/Filters/MTRSimFilter.hpp
Lines 9 to 10 in 4f5504c
[clang-format] reported by reviewdog 🐶
MTRSim/src/MTRSim/Filters/MTRSimFilter.hpp
Lines 17 to 18 in 4f5504c
[clang-format] reported by reviewdog 🐶
MTRSim/src/MTRSim/Filters/MTRSimFilter.hpp
Lines 23 to 24 in 4f5504c
[clang-format] reported by reviewdog 🐶
MTRSim/src/MTRSim/Filters/MTRSimFilter.hpp
Lines 26 to 27 in 4f5504c
[clang-format] reported by reviewdog 🐶
MTRSim/src/MTRSim/Filters/MTRSimFilter.hpp
Lines 30 to 32 in 4f5504c
[clang-format] reported by reviewdog 🐶
[clang-format] reported by reviewdog 🐶
MTRSim/src/MTRSim/Filters/MTRSimFilter.hpp
Lines 39 to 44 in 4f5504c
[clang-format] reported by reviewdog 🐶
[clang-format] reported by reviewdog 🐶
MTRSim/src/MTRSim/Filters/MTRSimFilter.hpp
Lines 105 to 107 in 4f5504c
[clang-format] reported by reviewdog 🐶
MTRSim/src/MTRSim/Filters/MTRSimFilter.hpp
Line 109 in 4f5504c
[clang-format] reported by reviewdog 🐶
MTRSim/src/MTRSim/Filters/MTRSimFilter.hpp
Lines 111 to 113 in 4f5504c
[clang-format] reported by reviewdog 🐶
MTRSim/src/MTRSim/Filters/MTRSimFilter.hpp
Lines 115 to 116 in 4f5504c
[clang-format] reported by reviewdog 🐶
MTRSim/src/MTRSim/Filters/MTRSimFilter.hpp
Lines 119 to 120 in 4f5504c
[clang-format] reported by reviewdog 🐶
MTRSim/src/MTRSim/Filters/MTRSimFilter.hpp
Line 122 in 4f5504c
[clang-format] reported by reviewdog 🐶
MTRSim/src/MTRSim/Filters/MTRSimFilter.hpp
Lines 125 to 127 in 4f5504c
[clang-format] reported by reviewdog 🐶
MTRSim/src/MTRSim/Filters/MTRSimFilter.hpp
Lines 129 to 130 in 4f5504c
[clang-format] reported by reviewdog 🐶
MTRSim/src/MTRSim/Filters/MTRSimFilter.hpp
Line 134 in 4f5504c
[clang-format] reported by reviewdog 🐶
Line 249 in 4f5504c
[clang-format] reported by reviewdog 🐶
Lines 252 to 254 in 4f5504c
[clang-format] reported by reviewdog 🐶
Line 289 in 4f5504c
[clang-format] reported by reviewdog 🐶
Line 10 in 4f5504c
[clang-format] reported by reviewdog 🐶
Lines 33 to 34 in 4f5504c
[clang-format] reported by reviewdog 🐶
Lines 45 to 47 in 4f5504c
[clang-format] reported by reviewdog 🐶
Line 50 in 4f5504c
[clang-format] reported by reviewdog 🐶
Line 55 in 4f5504c
[clang-format] reported by reviewdog 🐶
Lines 58 to 60 in 4f5504c
[clang-format] reported by reviewdog 🐶
Line 62 in 4f5504c
[clang-format] reported by reviewdog 🐶
Lines 69 to 70 in 4f5504c
[clang-format] reported by reviewdog 🐶
Lines 74 to 77 in 4f5504c
[clang-format] reported by reviewdog 🐶
Line 80 in 4f5504c
[clang-format] reported by reviewdog 🐶
Lines 82 to 86 in 4f5504c
[clang-format] reported by reviewdog 🐶
Lines 91 to 92 in 4f5504c
[clang-format] reported by reviewdog 🐶
Line 96 in 4f5504c
[clang-format] reported by reviewdog 🐶
Lines 105 to 106 in 4f5504c
[clang-format] reported by reviewdog 🐶
Line 110 in 4f5504c
[clang-format] reported by reviewdog 🐶
Line 115 in 4f5504c
[clang-format] reported by reviewdog 🐶
Lines 121 to 122 in 4f5504c
[clang-format] reported by reviewdog 🐶
Lines 126 to 130 in 4f5504c
[clang-format] reported by reviewdog 🐶
Line 154 in 4f5504c
[clang-format] reported by reviewdog 🐶
Line 159 in 4f5504c
[clang-format] reported by reviewdog 🐶
Lines 163 to 165 in 4f5504c
[clang-format] reported by reviewdog 🐶
Lines 167 to 168 in 4f5504c
[clang-format] reported by reviewdog 🐶
Lines 175 to 178 in 4f5504c
[clang-format] reported by reviewdog 🐶
Lines 187 to 189 in 4f5504c
[clang-format] reported by reviewdog 🐶
Line 205 in 4f5504c
[clang-format] reported by reviewdog 🐶
Lines 212 to 214 in 4f5504c
[clang-format] reported by reviewdog 🐶
Lines 219 to 220 in 4f5504c
[clang-format] reported by reviewdog 🐶
Line 224 in 4f5504c
[clang-format] reported by reviewdog 🐶
Line 229 in 4f5504c
[clang-format] reported by reviewdog 🐶
Lines 235 to 236 in 4f5504c
[clang-format] reported by reviewdog 🐶
Line 240 in 4f5504c
[clang-format] reported by reviewdog 🐶
Line 245 in 4f5504c
[clang-format] reported by reviewdog 🐶
Lines 251 to 252 in 4f5504c
[clang-format] reported by reviewdog 🐶
Lines 256 to 259 in 4f5504c
[clang-format] reported by reviewdog 🐶
Line 275 in 4f5504c
[clang-format] reported by reviewdog 🐶
Line 278 in 4f5504c
[clang-format] reported by reviewdog 🐶
Lines 282 to 283 in 4f5504c
[clang-format] reported by reviewdog 🐶
Lines 289 to 290 in 4f5504c
[clang-format] reported by reviewdog 🐶
Lines 294 to 297 in 4f5504c
[clang-format] reported by reviewdog 🐶
Lines 313 to 314 in 4f5504c
[clang-format] reported by reviewdog 🐶
Lines 317 to 318 in 4f5504c
[clang-format] reported by reviewdog 🐶
Line 322 in 4f5504c
[clang-format] reported by reviewdog 🐶
Lines 326 to 329 in 4f5504c
[clang-format] reported by reviewdog 🐶
MTRSim/tests/test_mtrsim_driver.cpp
Line 24 in 4f5504c
[clang-format] reported by reviewdog 🐶
MTRSim/tests/test_mtrsim_driver.cpp
Line 40 in 4f5504c
[clang-format] reported by reviewdog 🐶
MTRSim/tests/test_mtrsim_driver.cpp
Line 44 in 4f5504c
[clang-format] reported by reviewdog 🐶
MTRSim/tests/test_mtrsim_driver.cpp
Line 64 in 4f5504c
[clang-format] reported by reviewdog 🐶
MTRSim/tests/test_mtrsim_driver.cpp
Lines 66 to 67 in 4f5504c
[clang-format] reported by reviewdog 🐶
MTRSim/tests/test_mtrsim_driver.cpp
Lines 73 to 74 in 4f5504c
[clang-format] reported by reviewdog 🐶
MTRSim/tests/test_mtrsim_driver.cpp
Line 78 in 4f5504c
[clang-format] reported by reviewdog 🐶
MTRSim/tests/test_mtrsim_driver.cpp
Line 83 in 4f5504c
[clang-format] reported by reviewdog 🐶
MTRSim/tests/test_mtrsim_driver.cpp
Line 86 in 4f5504c
[clang-format] reported by reviewdog 🐶
MTRSim/tests/test_mtrsim_driver.cpp
Lines 95 to 97 in 4f5504c
4f5504c to
125eab7
Compare
125eab7 to
f5aabb0
Compare
Plan updated with the Approx (not Catch::Approx) and src/LibMTRSim/CMakeLists.txt corrections discovered during execution.
f5aabb0 to
dea7856
Compare
Embed the conceptual "what it generates" and "how it works" slides (converted from output/avatar_slides) plus an ODF Euler-space figure into the filter documentation. Also correct the Execute error code in the table to -13050 to match the algorithm source. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
10bac67 to
78e6d53
Compare
…dationTest) simplnx's FilterValidationTest requires path-type parameter keys to end with '_path' and ChoicesParameter keys with '_index'. Rename the offending key strings across MTRSimFilter, ComputeODFFilter, ReadMTRSimODFFilter, and WriteMTRSimODFFilter (C++ constant names unchanged, so .cpp/tests are unaffected) and update the avtr12 example pipeline to match. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
No description provided.