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 doubled,] 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 ofnumPixels
anddetectorData
, whereasGetAllDetectorData()
requires these parameters in addition to (detector)ObjectNumber
andData
(type).
Check the examples to use the two methods:
For python:
TheNCE = TheSystem.NCE
DetObj = 4
obj = TheSystem.NCE.GetObjectAt(DetObj);
numXPixels = obj.ObjectData.NumberXPixels;
numYPixels = obj.ObjectData.NumberYPixels;
DetRectangleData_FluxArea = TheSystem.NCE.GetAllDetectorDataSafe(4, 1)
for x in range(numXPixels):
for y in range(numYPixels):
print(DetRectangleData_FluxAreacx,y])
numPixels=numXPixels*numYPixels
detectorData=np.zeros(numPixels, dtype=np.float64)
bool_value, detectorData= TheNCE.GetAllDetectorData(DetObj, 1, numPixels,detectorData)
for i in range(numPixels):
print(detectorData i])
For matlab:
TheNCE = TheSystem.NCE;
DetObj = 4;
obj = TheSystem.NCE.GetObjectAt(DetObj);
numXPixels = obj.ObjectData.NumberXPixels;
numYPixels = obj.ObjectData.NumberYPixels;
DetRectangleData_FluxArea = TheSystem.NCE.GetAllDetectorDataSafe(4, 1);
for x = 1:numXPixels
for y = 1:numYPixels
disp(DetRectangleData_FluxArea(x,y));
end
end
numPixels=numXPixels*numYPixels;
detectorData=NET.createArray('System.Double', TheNCE.GetDetectorSize(4));
bool_value=TheSystem.NCE.GetAllDetectorData(DetObj, 1,TheNCE.GetDetectorSize(4),detectorData);
for i = 1:numPixels
disp(detectorData(i));
end
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: