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 41 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
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>
Add scripts/generate_nx_pipelines.py which turns each configs/*.json into a ReadMTRSimODF -> MTRSim -> WriteDREAM3D pipeline, and the 20 generated .d3dpipeline files. All 20 preflight cleanly via nxrunner. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
GPGenerator::buildCovarianceMatrix did `gamma += gamma.transpose()`, which aliases (Eigen throws an assertion in Debug builds). Materialize the transpose with .eval() before the in-place add. Also add a 1500-voxel smoke_test config + pipeline that exercises the full MTRSim execute path quickly; verified clean end-to-end in the Debug build (nxrunner_d --execute), confirming no remaining debug-only Eigen issues. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ISimulationObserver (progress + cancel) threaded through simulateMTR/sampleN, and an optional MTRSim config-JSON input on MTRSimFilter gated by a linked boolean (config mode vs manual mode). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…tations * Add ISimulationObserver pure-virtual interface (updateProgress + shouldCancel) to give callers a clean hook for progress reporting and cancellation * Add NullObserver (no-op default) and ConsoleObserver (spdlog-throttled) concrete implementations in SimulationObservers.hpp * Register both headers in src/LibMTRSim/CMakeLists.txt and MTRSimPlugin.cmake * Add Catch2 tests covering NullObserver and a RecordingObserver test double that verifies cancel-after-K-updates behaviour Signed-off-by: Michael Jackson <mike.jackson@bluequartz.net>
…tion, ODFSampler Tasks A2 + A3: observer (nullable, default nullptr) is now propagated from simulateMTR -> PGRFSimulation::run -> ODFSampler::sampleN. - MTRSimResult gains `cancelled` flag; simulateMTR returns early with it set when the observer vetoes the run. - PGRFSimulation::run checks shouldCancel() before each latent field and reports progress via updateProgress(); returns empty PGRFResult on cancel. - ODFSampler::sampleN checks shouldCancel() every 4096 iterations in both the sampling loop and the assignment loop without consuming the RNG on the non-cancel path (bit-stability preserved). - Python bindings updated to wrap the new signatures with observer=nullptr so existing Python callers are unaffected. - New tests: cancel-early and nullptr-observer in test_mtrsim_driver.cpp; immediate-cancel bail-out in test_odf_sampler.cpp. All 441 tests pass; [mtrsim_driver][statistical] seed-fixed regression guard continues to pass unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Added documentation for kCheck constant: explains the 4096 poll interval, latency rationale, and that modulo check short-circuits before RNG draw. - Clarified PGRFSimulation return comment to specify the cancelled lambda. - Documented sampleOne call: n=1 case doesn't need observer (latency negligible). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Pass a ConsoleObserver to simulateMTR so the CLI emits spdlog percentage-progress lines during the simulation, and guard the CSV/PNG-writing block against a cancelled result. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* Add ConfigIO.hpp and ConfigIO.cpp with parseConfigJson() function * Parses xLen/yLen/zLen, dx/dy/dz, volumeFractions, thetaList, nuggetVariance, and seed from config JSON; unknown keys are ignored * Register ConfigIO in LibMTRSim/CMakeLists.txt and MTRSimPlugin.cmake * Add tests/test_config_io.cpp covering round-trip read, missing-file error, and malformed-JSON error (3 test cases, 9 assertions) * All 444 tests pass Signed-off-by: Michael Jackson <mike.jackson@bluequartz.net>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* Replace inline nlohmann JSON-parsing block with mtrsim::parseConfigJson * Preserve CLI semantics: --seed non-zero overrides JSON seed; outputDir from -o flag survives config load * Read odfInputPath from JSON separately after parseConfigJson (the shared helper intentionally omits that field; keep nlohmann include for this) Signed-off-by: Michael Jackson <mike.jackson@bluequartz.net>
Teach `mtrsim::parseConfigJson` to populate `SimulationParams::odfInputPath` so callers no longer need a second JSON read. The standalone CLI's redundant re-open/re-parse block and its `#include <nlohmann/json.hpp>` are removed. The round-trip test is updated to assert the field is now populated. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…nfig-mode preflight/execute) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* executeImpl now parses the config file at most once and populates all MTRSimInputValues fields (VF, theta, size, spacing, seed) from whichever source is active (config file or manual UI) * MTRSim::operator() no longer calls parseConfigJson; it always builds SimulationParams directly from m_InputValues — the algorithm has no knowledge of the config file * Removed useConfigFile and configFilePath from MTRSimInputValues and the <filesystem> include from MTRSim.hpp (no longer needed there) * Removed #include "LibMTRSim/ConfigIO.hpp" from MTRSim.cpp * Execute-time config parse failures use error code -13521 (distinct from preflight's -13520) so the two phases can be told apart * WriteTempConfig helper in the test hardened with REQUIRE(is_open) and REQUIRE(good) so temp-write failures surface clearly Signed-off-by: Michael Jackson <mike.jackson@bluequartz.net>
Add a "Configuration Source" section describing the optional JSON config-file input (what it reads, what it ignores, seed-zero behaviour, units caveat). Update the Performance section to reflect continuous progress reporting and mid-run cancellation support (replacing the old "start/completion only; no cancel" text). Add error codes -13520 (preflight config parse failure) and -13521 (execute config parse failure) to the Errors table in numeric order. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The MTRSimFilter gained config-file params; regenerate the example pipelines (and the generator) so each MTRSim step carries use_config_file=false + config_file_path explicitly. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…l review nits) Fixed stale error-code references in test comments (-13005 -> -13505 for column-count check, -13004 -> -13504 for row-count check). Clarified cancel behavior in Performance section to note that output arrays are created by preflight but remain unfilled on cancellation. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* Add defaulted virtual info() to ISimulationObserver — no-op by default so existing test doubles need no changes * ConsoleObserver overrides info() to emit via spdlog (CLI output unchanged) * FilterObserver overrides info() to forward through the simplnx IFilter::MessageHandler with Type::Info (no raw console lines from the DREAM3D-NX filter) * Convert all five direct spdlog::info() calls in PGRFSimulation::run to observer->info() with nullptr guard; drop the redundant per-field spdlog line that duplicated the updateProgress message * Remove unused #include <spdlog/spdlog.h> from PGRFSimulation.cpp Signed-off-by: Michael Jackson <mike.jackson@bluequartz.net>
The plugin-build shim hard-coded LIBMTRSIM_EXPORT to empty. On Unix that is fine (default visibility exports the symbols), but on MSVC nothing is exported from the plugin DLL, so external consumers (MTRSimUnitTest, the Python bindings) fail to link mtrsim:: free functions (readODFComponents, readODFMetadata, tryReadFixtureVersion) with LNK2019/LNK1120. Key the macro on MTRSim_EXPORTS (dllexport when building the plugin, dllimport when consuming), matching the plugin's own export macro. macOS build + 42/42 tests unaffected. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
9f4c0cf to
1d6a567
Compare
Signed-off-by: Michael Jackson <mike.jackson@bluequartz.net>
9f4c0cf to
2d72d3e
Compare
No description provided.