Skip to main content

ZOS-API interface 2024 R2

ZOSAPI.Editors.NCE.IObjectDetector Interface Reference

Last update: 17.07.2025
Inheritance diagram for ZOSAPI.Editors.NCE.IObjectDetector:

Public Member Functions

int GetRowCount ()
 
int GetColCount ()
 
bool GetDetectorDimensions (out uint Rows, out uint Cols)
 
int GetDetectorSize ()
 

Additional Inherited Members

- Properties inherited from ZOSAPI.Editors.NCE.IObject
ObjectType Type [get]
 
INCERow Row [get]
 
bool IsValid [get]
 
long Id [get]
 

Detailed Description

Usage (see Example 02 for a full sample)

C#

// Get detector data
System.Text.StringBuilder sbReport = new System.Text.StringBuilder();
double[,] detectorData = new double[100, 100];
for (int i = 0; i < 99; i++)
{
for (int j = 0; j < 99; j++)
{
TheNCE.GetDetectorData(4, j + i * 100, 1, out detectorData[i, j]);
sbReport.Append(detectorData[i, j].ToString() + "\t");
}
sbReport.AppendLine("");
}
string resFile = TheApplication.SamplesDir + "\\API\\CS\\e02_NSC_ray_trace.txt";
System.IO.File.WriteAllText(resFile, sbReport.ToString());

C++

// Get detector data
double detectorData[100][100];
for (int i = 0; i < 99; i++)
for (int j = 0; j < 99; j++)
TheNCE->GetDetectorData(4, j + i * 100, 1, &detectorData[i][j]);

Matlab

% Get detector data
data = NET.createArray('System.Double', TheNCE.GetDetectorSize(4));
TheNCE.GetAllDetectorData(4, 1, TheNCE.GetDetectorSize(4), data);
[~, rows, cols] = TheNCE.GetDetectorDimensions(4);
% rotates and flips image to reflect ZOS orientation
detectorData = flipud(rot90(reshape(data.double, rows, cols)));

Python

# Get detector data
detectorData = [[0 for x in range(numYPixels)] for x in range(numXPixels)]
for x in range(0,numYPixels,1):
for y in range(0,numXPixels,1):
ret, pixel_val = TheNCE.GetDetectorData(DetObj, pix, 1, 0)
pix += 1
if ret == 1:
detectorData[y][x] = pixel_val
else:
detectorData[x][y] = -1

Member Function Documentation

◆ GetColCount()

int ZOSAPI.Editors.NCE.IObjectDetector.GetColCount ( )

◆ GetDetectorDimensions()

bool ZOSAPI.Editors.NCE.IObjectDetector.GetDetectorDimensions ( out uint  Rows,
out uint  Cols 
)

◆ GetDetectorSize()

int ZOSAPI.Editors.NCE.IObjectDetector.GetDetectorSize ( )

◆ GetRowCount()

int ZOSAPI.Editors.NCE.IObjectDetector.GetRowCount ( )

Connect with Ansys