Hint: |
In order to process a particular class layer you should use the function Copy3DLayerToMatrix to copy the layer into a two-dimensional array. The following code snippet shows how to classify the currently loaded data (accessible via the global variables RawData and MData) and adds an image of class 1 to the image repository:
var
MskArr : TBool2DArray;
imgmat : TDouble2DArray;
RF : TRndForest;
...
...
...
ResizeBoolMatrix (MskArr, MData.SizeX, MData.SizeY);
FillBoolMatrix (MskArr, false);
RF.ClassifyCubeData (RawData, 1, MData, MskArr);
ResizeMatrix (imgmat, MData.SizeX, MData.SizeY);
Copy3DLayerToMatrix (RF.ClassifiedCubeDataAs3DArray, 0, imgmat); // class 1 = index 0
AddImgToRepository (imgmat, 0, 0, 'Class 1', '');
...
|