TransformSpectra

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 script progress bar at the bottom right of the Epina ImageLab main window indicates the progress of the calculation, if set to FALSE no visual feedback is provided. Please note that unless the script progress bar is already visible you have to make it visible before calling TransformSpectra, otherwise the feedback will not be displayed. You can activate the script progress bar by calling the function ScriptBar(0).

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.