Declaration: TrimDataCube(FirstX, LastX, FirstY, LastY, FirstLayer, LastLayer, FirstTSlot, LastTSlot: integer; Feedback: boolean): integer;
Cuts the data cube in such a way that the specified range remains. The parameters FirstX/Y/Layer/TSLot and LastX/Y/Layer/TSLot specify the ranges of the x, y, layer and time slot axis, respectively.

The Feedback parameter determines whether a progress bar is displayed. Please note that unless the script progress bar is already visible you have to make it visible before calling TrimDataCube, 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 ... everything is OK
-1 ... FirstX or LastX out of range
-2 ... FirstY or LastY out of range
-3 ... FirstLayer or LastLayer out of range
-4 ... FirstTSlot or LastTSlot out of range
-5 ... the resulting image is too small (2x2 pixel minimum required)