Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Fixed-affine nonlinear chunk-size characterization

Question and controlled design

The preceding CC SyN radius characterization found that radius 4 improved the known dim-region residual, but its independent affine estimates confounded comparisons among radii. This experiment asks a narrower question: with the accepted radius-4 affine state held exactly fixed, does reducing the nonlinear XY chunk size reduce the remaining dim-region displacement?

The experiment reused the completed round-2, round-3, and round-4 affine artifacts from the radius-4 workflow. Their completion records, input identities, fixed geometry, TRSAA/high policy, native-thread policy, and bytes were validated before and after every condition. Cy-ExM cloned those artifacts into a caller-owned shared preparation, applied each accepted affine once to resample the moving data onto the fixed grid, and cloned that prepared state into every condition. The TRSAA estimator was never called during the sweep.

All other scientific and operational choices were held constant:

VariableControlled value
Moving rounds2, 3, and 4
Nonlinear transformhigh-accuracy SyNOnly
Nonlinear metricCC, scalar voxel radius 4
Chunk size ZYX[512,1125,1125], [512,512,512], [512,256,256], or [512,128,128]
Overlap fraction0.15
Fixed geometry ZYX51 × 2240 × 2223 voxels
Native threads30 ITK and 30 BLAS-family threads
SLURM resourcesfour exclusive 512-GB nodes, one task slot per node

The four conditions contain 27, 108, 363, and 1,323 nonlinear chunk tasks across the three moving rounds, respectively. The 1125-pixel baseline ran first. The remaining three conditions later ran concurrently with four dedicated nodes each, so their wall times include possible shared-filesystem contention. Fine-grained execution changed task placement only; the production preparation, nonlinear chunk, assembly, transform, validation, artifact, and cache implementations remained unchanged.

Spatial quality measurements

Registration quality was measured on Z maximum-intensity projections using the same fixed-grid observables as the preceding radius study:

For each ROI, float64 Sobel gradient magnitude was calculated for the fixed and exported registered channel. Every integer correction in ±30 pixels along Y and X was evaluated by normalized cross-correlation. The reported residual is the Euclidean magnitude of the correction applied to the moving image. current NCC is the score at zero correction, best NCC is the score at the optimum, and prominence is the best score minus the best score outside a Chebyshev radius of two pixels around that optimum. A boundary optimum is a lower bound, not a precise residual.

As a regression check, this implementation reproduced the previously reported radius-4 dim residuals exactly: 7.81, 14.32, and 13.45 pixels for rounds 2, 3, and 4. The assembled registration scalar and exported registration channel selected the same correction in every round. The exported channel was retained as the primary downstream observable.

The whole field was also sampled with 128 × 128-pixel windows on a 64-pixel stride. Each window retained its fixed-image signal quartile, fixed-gradient energy, residual, NCC confidence, and search-boundary status. A window was classified as seam-adjacent when its center lay within 16 pixels of a visible assembled core transition. Because later overlapping cores overwrite earlier cores in canonical chunk order, these transitions occur at later core starts, not at both starts and ends.

Finally, ANTs computed the geometric Jacobian determinant of each assembled three-dimensional displacement field on the exact fixed domain. Non-finite values and determinants less than or equal to zero were counted explicitly; the latter indicate local folding or singular deformation.

Results

The named bright and dim regions

Reducing nonlinear spatial support did not change the selected correction in either named ROI. Every chunk size produced exactly the same residual for a given round:

RoundBright residual (px)Dim correction (dy, dx) (px)Dim residual (px)
20.00(6, -5)7.81
30.00(14, -3)14.32
40.00(9, -10)13.45

None of these optima reached the ±30-pixel search boundary. Bright-region prominence remained high, from 0.340 to 0.378. Dim-region prominence remained much lower, from 0.013 to 0.030, so the dim correction is less uniquely determined even though its selected integer displacement is stable across conditions.

The current dim-region NCC changed only slightly. Relative to 1125 pixels, the 128-pixel condition changed current NCC by +0.0071, +0.0045, and +0.0064 for rounds 2, 3, and 4. These small score changes did not reduce the residual displacement. Whole-image correlation also remained close across conditions:

XY chunk (px)Round 2Round 3Round 4
11250.68510.54200.5566
5120.68000.54970.5496
2560.68240.54720.5490
1280.67840.54210.5480
Bright and dim ROI residuals plotted against nonlinear XY chunk size.

The bright ROI remains at zero residual and the dim ROI retains the same round-specific displacement at every chunk size.

Fixed-green and registered-magenta gradient overlays for every condition, round, and ROI.

Fixed-image gradients are green and registered moving-image gradients are magenta. The overlays visually reproduce the quantitative result: chunk size does not remove the dim-region displacement.

Whole-field signal and seam behavior

Across 12,672 block measurements, the overall median residual remained essentially constant: 11.02, 11.02, 11.18, and 11.05 pixels for 1125-, 512-, 256-, and 128-pixel chunks. Signal strength, rather than chunk size, dominated the result:

XY chunk (px)Quartile 1, dimmestQuartile 2Quartile 3Quartile 4, brightest
112526.4017.801.000.00
51226.1717.801.000.00
25626.4117.801.000.00
12825.5017.690.000.00

Values are median residuals in pixels. Approximately 9–10% of defined windows had a search-boundary optimum in every condition, concentrated in the lower-signal quartiles. Those observations are lower bounds and should not be interpreted as precise displacement estimates.

Seam-adjacent and interior windows cannot be compared without accounting for their signal distribution. The raw medians were 2.24 versus 13.04 pixels at 512 pixels, 11.68 versus 10.82 pixels at 256 pixels, and 13.10 versus 8.37 pixels at 128 pixels. The apparently favorable 512-pixel seam value reflects where those seams cross this specimen, not evidence that seams improve registration. At 128 pixels, the direction reverses and the seam median is 4.73 pixels worse than the interior median. Within signal quartiles the differences are smaller, but the 128-pixel condition still shows no consistent benefit and has a seam penalty in quartiles 2 and 4.

Mean block residual near assembled chunk seams and in chunk interiors.

Raw seam/interior means are descriptive and remain confounded by specimen signal distribution. The smallest chunks do not provide a consistent seam benefit.

Deformation validity

All twelve assembled warp fields contained only finite Jacobian determinants and zero nonpositive determinants; no folding was detected. Smaller chunks nevertheless produced progressively more extreme local volume changes:

XY chunk (px)MinimumLowest round-level 1st percentileHighest round-level 99th percentileMaximumNonpositive voxels
11250.0004190.8131.2011.7700
5120.0000010.8091.2062.2690
2560.0000030.7951.2214.9820
1280.0000020.7671.2526.5940

The median determinant remained approximately 1.0 in every round. Thus the smaller-chunk fields are topologically valid by this gate, but their tails are less conservative.

Jacobian determinant percentiles and folding counts by chunk size.

No condition folded, while the deformation-distribution tails widened as chunks became smaller.

Runtime

Wall time increased as chunks became smaller:

XY chunk (px)ChunksFour-node wall time (h)Four-node allocation (node-h)Increase from 1125
1125273.5314.11—
5121083.8315.298.4%
2563634.6918.7332.7%
1281,3235.0820.3143.9%

These are SLURM allocation envelopes rather than summed ANTs task timings. The 1125-pixel baseline ran separately, whereas the other three conditions ran concurrently and may have contended for shared storage.

Four-node wall time and completed chunks per hour by XY chunk size.

Task throughput rises as individual chunks become smaller, but total wall time and node consumption also rise.

Interpretation and limitations

This experiment does not support the hypothesis that reducing the nonlinear chunk size removes brightness-dependent registration error. The named dim-region correction is exactly unchanged, whole-field medians are unchanged to within 0.16 pixels, and the smallest chunks add runtime, seam exposure, and more extreme local Jacobian values. For this dataset, retaining the 1125-pixel XY chunks is the best-supported choice among those tested. There is no evidence here to change a Cy-ExM production default.

The result also strengthens the original scientific observation: high-signal windows generally register well, while dim windows have large, low-prominence, and sometimes boundary-limited displacement estimates. Altering nonlinear spatial support alone does not resolve that dependence. Future experiments should instead test signal-aware preprocessing, masks or weights, multiscale metric choices, or regularization while preserving the same fixed-affine design.

This characterization has important limits:

Machine-readable tables corresponding to these figures are stored beside the image assets as regional-residuals.csv, seam-interior.csv, jacobian-validity.csv, and runtime-throughput.csv.