GetAllDetectorData() and GetAllDetectorDataSafe() are both methods that can be used to retrieve detector data for a specified detector object.
- The main difference between the two methods is that
GetAllDetectorDataSafe()returns a two-dimensional array of double values double[,] that contains all the detector data for the detector object, whileGetAllDetectorData()returns a boolean value that indicates whether the detector data was retrieved successfully, and one-dimensional array double[] . GetAllDetectorDataSafe()does not require the input ofnumPixelsanddetectorData, whereasGetAllDetectorData()requires these parameters in addition to (detector)ObjectNumberandData(type).
Check the examples to use the two methods:
For python:
1TheNCE = TheSystem.NCE2DetObj = 43obj = TheSystem.NCE.GetObjectAt(DetObj);4numXPixels = obj.ObjectData.NumberXPixels;5numYPixels = obj.ObjectData.NumberYPixels;67DetRectangleData_FluxArea = TheSystem.NCE.GetAllDetectorDataSafe(4, 1)8for x in range(numXPixels):9 for y in range(numYPixels):10 print(DetRectangleData_FluxArea[x,y])1112numPixels=numXPixels*numYPixels13detectorData=np.zeros(numPixels, dtype=np.float64)14bool_value, detectorData= TheNCE.GetAllDetectorData(DetObj, 1, numPixels,detectorData)15for i in range(numPixels):16 print(detectorData[i])For matlab:
1TheNCE = TheSystem.NCE;23DetObj = 4;4obj = TheSystem.NCE.GetObjectAt(DetObj);5numXPixels = obj.ObjectData.NumberXPixels;6numYPixels = obj.ObjectData.NumberYPixels;78DetRectangleData_FluxArea = TheSystem.NCE.GetAllDetectorDataSafe(4, 1);9for x = 1:numXPixels10 for y = 1:numYPixels11 disp(DetRectangleData_FluxArea(x,y));12 end13end1415numPixels=numXPixels*numYPixels;16detectorData=NET.createArray('System.Double', TheNCE.GetDetectorSize(4));17bool_value=TheSystem.NCE.GetAllDetectorData(DetObj, 1,TheNCE.GetDetectorSize(4),detectorData);18for i = 1:numPixels19 disp(detectorData(i));20end2122
In matlab, the retrieved data from GetAllDetectorData() need to be rearranged from 1D array to a matrix, detectorData = flipud(rot90(reshape(data.double, rows, cols)));
and here is a simple example to show the transform:
