The user has to derive a concrete class from this base class
and implement the (pure) virtual functions.
The main function is process, which needs to do the
calculation.
Other functions make it possible to perform an initial check.
The class is Doubly templated. Ths first template type is for the data type you are processing. The second type is for what type you want the results of the processing assigned to. For example, if you are computing sums of squares for statistical purposes, you might use higher precision (FLoat->Double) for this. No check is made that the template types are self-consistent.
The init function for a derived class.
It can be used to check if nOutPixelsPerCollapse
corresponds with the number of pixels produced per collapsed chunk.
processAxis is the axis of the line being passed
to the process function.
Can the process function in the derived class handle a null mask pointer?
If not, LatticeApply ensures that it'll always pass a mask block,
even if the lattice does not have a mask (in that case that mask block
contains all True values).
The default implementation returns False.
The function is there to make optimization possible when no masks
are involved. On the other side, it allows the casual user to ignore
optimization.
Create and initialize the accumulator.
The accumulator can be a cube with shape [n1,n2,n3],
where n2 is equal to nOutPixelsPerCollapse.
However, one can also use several matrices as accumulator.
The data type of the accumulator can be any. E.g. when
accumulating Float lattices, the accumulator could be of
type Double to have enough precision.
In the endAccumulator function the accumulator
data has to be copied into an Array object with the correct
shape and data type.
Collapse the given input data containing (nrval values
with an increment of inIncr elements).
inMask is a Bool block representing a mask with the
same nr of values and increment as the input data. If a mask
value is False, the corresponding input value is masked off.
When function canHandleNullMask returned True,
it is possible that inMask is a null pointer indicating
that the input has no mask, thus all values are valid.
The result(s) have to be stored in the accumulator at the given indices.
startPos gives the lattice position of the first value.
The position of other values can be calculated from index and shape
using function toPositionInArray in class
IPosition.
End the accumulator. It should return the accumulator as an Array of datatype U (e.g. double the precision of type T) with the given shape. The accumulator should thereafter be deleted when needed.