ENH: Resample Image Geometry uses much less memory at the cost of some computation time#1529
Conversation
ab3332f to
1b22dfd
Compare
Uses ProgressMessageHelper with shared atomic counter to report percentage complete for each DataArray during the resampling loop. Co-Authored-By: Claude Opus 4.6 <[email protected]>
We cannot parallelize effectively over each array without allocating 8 byte indices or other large buffers so go back to at copying each Data Array on its own thread.
1b22dfd to
8737444
Compare
PR #1529 Review: "Resample Image Geometry uses much less memory at the cost of some computation time"Author: imikejackson | Files changed: 2 ( What it doesRewrites the Old flow: One parallel pass to pre-compute all indices into a vector, then N parallel copy passes (one per data array) using New flow: N parallel tasks (one per data array), each doing its own per-voxel coordinate lookup + copy via Positive observations
Issues found1. Misleading comment (minor)Line ~58 in the new code: // Get the destination voxel center.
Point3D<float64> coords = m_DestImageGeom.getPlaneCoords(destVoxelIdx);
2. Unchecked
|
The code was updated to remove the pre-calculated voxel indices which added an 8 byte integer at every voxel which can quickly blow up memory usage. The code now uses some extra cpu cycles to compute the source and destination indices.