Declaration: TransformSpectra(TSlot, SpecGroup: integer; RefSpec: TDoubleArray; P1, P2: double; CMode: integer; Feedback: boolean): integer;
Transforms all spectra of the spectral group SpecGroup and the time slot TSlot according to the following equations. The parameter CMode specifies the type of transformation:

CMode Equation
1 Specs[x,y] := P1*Specs[x,y] + P2*RefSpec
2 Specs[x,y] := P1*Specs[x,y] - P2*RefSpec
3 Specs[x,y] := P1*Specs[x,y] * P2*RefSpec
4 Specs[x,y] := P1*Specs[x,y] / P2*RefSpec
5 Specs[x,y] := (1+P1*Specs[x,y]) / (1+P2*RefSpec)
6 Specs[x,y] := P1*sqr(Specs[x,y])
7 Specs[x,y] := P1*abs(Specs[x,y])

If Feedback is set to TRUE, the progress bar at the bottom of the ImageLab main window indicates the progress of the calculation, if set to FALSE no visual feedback is provided.

The function returns the following error codes:

 0 ... everthing is OK
-1 ... invalid SpecGroup
-2 ... invalid CMode
-3 ... TimeSlot is out of range
-4 ... P2 must not be zero (for CMode = 4)
-5 ... reference spectrum RefSpec does not match length of spectral group
Please note that a possible division by zero in the course of the calculation is ignored, the corresponding cell of the data cube is not affected.

Last Update: 2018-Jun-02