2D Image area and diameter include the flat-axis spacing
I maintainer di solito rispondono entro 6 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 20/100
Direzione di ricerca
Read src/Plugins/SimplnxCore/vv/deviations/ComputeFeatureSizesFilter.md and the cited calculations in ComputeFeatureSizesDirect.cpp, ComputeFeatureSizesScanline.cpp, and ImageGeom.cpp; the issue first requires a decision on the slab convention. Compare the current behavior with the named tests in ComputeFeatureSizesTest.cpp and GeometryTest.cpp. Done means the convention is decided and applied consistently across the affected filters and geometry code, with tests updated to record the chosen behavior.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
For a 2D Image Geometry (one dimension has size 1), Compute Feature Sizes multiplies all three spacings to get the cell "area". It then calculates the equivalent circle diameter from that value. When the flat dimension's spacing is not 1, the value is a volume, not an area, and the diameter is incorrect. DREAM.3D v6.5.171 uses only the two non-flat spacings.
This behavior came from PR #1590 (e76ad508e). PR #1590 also documents it as the intended "slab" convention in wrapping/python/docs/source/Geometry.rst:37-52: a user who wants a true 2D result must set the flat spacing to 1.0. Thus a fix is a design decision first, and a code change second.
This is deviation ComputeFeatureSizes-D3 in src/Plugins/SimplnxCore/vv/deviations/ComputeFeatureSizesFilter.md.
Example
Four cells, non-flat spacings 2 and 3, flat spacing 5:
- True area: 4 × 2 × 3 = 24. DREAM.3D v6.5.171 reports 24.
- SIMPLNX reports 4 × 2 × 3 × 5 = 120.
- The diameter is too large by a factor of √5.
Affected code (same calculation)
src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeFeatureSizesDirect.cpp:173(diameter at:195)src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeFeatureSizesScanline.cpp:257(diameter at:261-262)src/simplnx/DataStructure/Geometry/ImageGeom.cpp:150(findElementSizes). This is the source of the convention. Compute Feature Sizes calls it when Save Element Sizes is on.ComputeNeighborhoodsuses the diameter to set the neighborhood radius. In 2D, the larger diameter gives a larger radius.
The RectGrid path in Compute Feature Sizes has no 2D branch. A single-layer RectGrid always gets a volume and an equivalent sphere diameter. That is a different inconsistency.
Other 2D axis defects found in the same check
These are not the slab convention. They are defects under either convention.
- Compute Biased Features (regression).
src/Plugins/SimplnxCore/src/SimplnxCore/Filters/Algorithms/ComputeBiasedFeatures.cpp:232-263. When X or Y is the flat axis, the code swaps the point counts, origins and centroid offsets. The bounding box at line 263 still usesspacing[0]andspacing[1]. DREAM.3D v6.5.171 (FindBoundingBoxFeatures.cpp:350-377) swaps the spacing too. The final check at:318-334also compares the box against unshifted centroid components. DREAM.3D v6.5.171 has that second defect too. - Compute Shapes (inherited).
src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/Algorithms/ComputeShapes.cpp,findMoments2D(:432-542) andfindAxes2D(:621-664). When X or Y is the flat axis, the moments use the wrong spacing, origin and centroid components. The 2D area written to Volumes (:527) isspacing[0] * spacing[1], so it includes the flat spacing when X or Y is flat. When Z is flat, it is sx·sy, which does not agree with Compute Feature Sizes (sx·sy·sz). DREAM.3D v6.5.171FindShapes.cpphas the same code.
Checked and correct (or following the documented convention): Compute Feature Neighbors shared surface area, Compute Surface Area To Volume, Compute Largest Cross Sections, Compute Euclidean Distance Map, and the topology-only filters changed in PR #1590.
Compute Feature Neighbors has one documentation error: docs/ComputeFeatureNeighborsFilter.md:26 says the shared surface area is a count of cell faces. The code adds physical face areas.
Tests that record the current behavior
ComputeFeatureSizesTest.cpp:1003("2D area excludes the flat-dimension spacing",[2DFlatSpacing][!shouldfail]) expects the DREAM.3D value 24 for X, Y and Z flat. It is an expected failure now.ComputeFeatureSizesTest.cpp:327and:456-466assert the slab values (volumes == 60, diameter8.7403879).Create2DImageDataStructure(ComputeFeatureSizesTest.cpp:508) uses flat spacing 1.0, so the "Valid: Image 2D" tests cannot detect the problem.test/GeometryTest.cpp:297-316asserts the slab convention forfindElementSizes.ComputeFeatureNeighborsTest.cpp:167-201and:417-449assert slab values for flat X, Y and Z.- Compute Shapes has no 2D test. The Compute Biased Features 2D test uses a Z-flat exemplar, so it cannot detect the X/Y-flat defect.
Decisions needed
- Keep the slab convention, or change 2D area and diameter to ignore the flat spacing (DREAM.3D v6.5.171 behavior). The answer applies to
ImageGeom::findElementSizes, Compute Feature Sizes, Compute Shapes and Compute Feature Neighbors together. - If the slab convention stays: should Compute Feature Sizes call the 2D output an area and calculate a circle diameter from it?
- Fix the Compute Biased Features and Compute Shapes axis defects separately. They do not depend on decision 1.
- Lingua principale
- C++
- Stelle
- 18
- Fork
- 15
- Merge medio
- 4g 23h
- PR unite (30g)
- 42
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di BlueQuartzSoftware/simplnx
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
BlueQuartzSoftware/simplnx#1987 ·
I maintainer di solito rispondono entro 6 giorni
-
documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
BlueQuartzSoftware/simplnx#1980 ·
I maintainer di solito rispondono entro 6 giorni
-
Testing
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
BlueQuartzSoftware/simplnx#1979 ·
I maintainer di solito rispondono entro 6 giorni
-
documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
BlueQuartzSoftware/simplnx#1978 ·
I maintainer di solito rispondono entro 6 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
BlueQuartzSoftware/simplnx#1945 ·
I maintainer di solito rispondono entro 6 giorni
Tutte le issue di BlueQuartzSoftware/simplnx
Issue simili
-
bug triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
26.04 bug dark-mode Easy Hack impress symptom: visual
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
CollaboraOnline/online#16421 · 1 commento ·
-
area/cs bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
ydb-platform/ydb#59881 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
I maintainer di solito rispondono entro 1 giorno
-
documentation enhancement lua server
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100