Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions Modules/Core/Mesh/wrapping/test/itkMeshArrayPixelTypeTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,7 @@
mesh = MeshType.New()

# Create Vector Container and Store values in it for each Point
# For windows use itk.ULL
if hasattr(itk.VectorContainer, "ULAD"):
IdentifierType = itk.UL
else:
IdentifierType = itk.ULL
IdentifierType = itk.IT

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Windows identifier types diverge

itk.IT is always exported as itk.ULL on Windows, but a build with ITK_USE_64BITS_IDS=OFF defines itk::IdentifierType as unsigned long and wraps this mesh's point-data container with an itk.UL key. This creates VectorContainer[ULL, Array.D], which does not match the VectorContainer[UL, Array.D] required by mesh.SetPointData(v), so this wrapping test fails on that supported configuration. Restore the configuration-aware UL/ULL container selection, or make itk.IT reflect the configured identifier width.

Artifacts

Focused Mesh IdentifierType selection validation script

  • Authored and executed a focused Python source-contract validation for Windows with 64-bit IDs disabled; it asserts the exact C++, wrapping, Python-alias, and changed-test selection facts, with the takeaway that the selected container key types differ.

Focused validation output showing the post-change Mesh key-type mismatch

  • Captured output from executing the focused validation script in `/home/user/repo`; it reports `unsigned long` for the mesh and `unsigned long long` for `itk.IT`, with the takeaway that post-change `SetPointData` container types do not match.

View artifacts

T-Rex Ran code and verified through T-Rex


v = itk.VectorContainer[IdentifierType, PixelType].New()
Comment on lines +30 to 32

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of introducing this IdentifierType alias, we might as well directly use itk.IT, as in:

v = itk.VectorContainer[itk.IT, PixelType].New()

But I guess IdentifierType is more readable than itk.IT 🤷

v.Reserve(NumberOfPoints)
Expand Down
Loading