An example in this module is a N-Dim convolution algorithm I made up one day - it works but the boundary condtions are a bit funny.
use PDL::ImageND;
Signature: (a(m); b(n); int adims(p); int bdims(q); [o]c(m))
$new
= convolve $a, $kernel
Convolve an array with a kernel, both of which are N-dimensional.
Note because of the algorithm used (writing N-dim routines is not easy on the brain!) the boundary conditions are a bit strange. They wrap, but up to the NEXT row/column/cube-slice/etc. If this is a problem consider using zero-padding or something.
Signature: ninterpol(point(),data(n),[o]value())
$value = ninterpol($point, $data);
ninterpol
uses interpol
to find a linearly interpolated value in N dimensions, assuming the data is
spread on a uniform grid. To use an arbitrary grid distribution, need to
find the grid-space point from the indexing scheme, then call ninterpol
-- this is far from trivial (and ill-defined in general).
Signature: (a(m); [o]b(n); int ns => n)
$new
= rebin $a, $dim1, $dim2,..;. $new
= rebin
$a, $template; $new
= rebin $a, $template, {Norm => 1};
Rebin an N-dimensional array to newly specified dimensions. Specifying `Norm' keeps the sum constant, otherwise the intensities are kept constant. If more template dimensions are given than for the input pdl, these dimensions are created; if less, the final dimensions are maintained as they were.
So if $a
is a 10 x 10 pdl, then rebin($a,15)
is a 15 x 10 pdl, while rebin($a,15,16,17)
is a 15 x 16 x 17 pdl (where the values along the final dimension are all
identical).