```{index} single: PDL::ImageND ``` # PDL::ImageND ```{pperl-module-badges} PDL::ImageND ``` Image processing in any number of dimensions: convolution, rebinning, interpolation, circular masks, contours and graph layout forces. ```perl use PDL; use PDL::ImageND; print convolveND(sequence(5), pdl(1, 1, 1)), "\n"; # [1 3 6 9 7] print rebin(sequence(4), 2), " ", kernctr(sequence(4), pdl(1, 2, 1))->flat, "\n"; # [0.5 2.5] [2 1 0 1] ``` `convolveND($a, $kernel, { boundary => 'periodic' })` convolves in as many dimensions as the kernel has, with a choice of boundary conditions and of the direct or the FFT method; `convolve` is the older form, wrapping around. `rebin($a, @dims)` changes the size by averaging or replicating (`{ Norm => 1 }` keeps the sum), `ninterpol($point, $data, $n)` interpolates linearly in the first `$n` dimensions, `kernctr($image, $kernel)` pads a kernel to the size of an image for the FFT, and `circ_mean` and `circ_mean_p` average around rings. `contour_segments` and `contour_polylines` trace a contour level through a 2-D field, `path_join` and `path_segs` turn edges into paths, `combcoords` packs three coordinates into one ndarray, and `attract` and `repulse` compute the spring and the repulsive forces of a graph layout. This is PDL::ImageND of PDL 2.106: upstream's Perl, unchanged, over PDL's own kernels run by pperl's engine.