Source Properties Table


The CImExtract:Extract method creates a table of source properties for the sources it detects and characterizes in an image. For each source, the CImExtract:GetSource method returns a table of source properties as described below.

The returned table can be either a numerically indexed table (array) or a keyed table using the property names. For example, if the table returned by GetSource is named obj, then the center X coordinate is given by either obj.nCenterX or obj[11]. The return type for the Source Properties table (indexed table or keyed table) is controlled by the bUseIndex flag in the call to GetSource. If bUseIndex is omitted or false, a keyed table is returned containing named properties. If bUseIndex=true, then an indexed table is returned. In the table below, the property index is listed under the heading Index. The property name is listed under the heading Name.

Note that some values naturally involve an integer type value, such as iIndex or iMinY. Values beginning with the letter "i" may be processed by your script as either a number or integer value.

Index

Name

Description

1

nDetectThreshold

The threshold number of sigmas above true background used for detecting the source.

2

nBackground

The threshold luminosity value used for detecting the source, a number for the .

3

nBackgroundLocal

The local background value near the source, calculated using dThreshold sigmas above the local true background.

4

nArea

The source area, in pixels.

5

nTotalLum

The total luminosity of the source relative to a pixel value of zero.

6

nNetLum

The net luminosity of the source above the background value, nBackground.

7

nAvgLum

The average luminosity of the source above the background value, nBackground.

8

nLumStdDev

The standard deviation in luminosity above the background value, nBackground.

9

nMinVal

The minimum pixel value in the source.

10

nMaxVal

The maximum pixel value in the source.

11

nCenterX

The luminosity weighted x-coordinate of the source.

12

nCenterY

The luminosity weighted y-coordinate of the source.

13

nCenterWorldX

The luminosity weighted world x-coordinate of the source.

14

nCenterWorldY

The luminosity weighted world y-coordinate of the source.

15

nMag

The astronomical magnitude of the source.

16

nMagErr

The empirical (measured) uncertainty in the astronomical magnitude of the source.

17

nMagErrT

The theoretical (calculated) uncertainty in the astronomical magnitude of the source.

18

nNetCount

The net count of the source above background.

19

nSNR

The signal to noise ratio of the source.

20

nRadiusGyration

The radius of gyration of the source.

21

nMajorAxis

The major axis length, a, of the source.

22

nMinorAxis

The minor axis length, b, of the source.

23

nEllipticity

The ellipticity of the source, in terms of 1-b/a.

24

nAngle

The angle of the major axis of the source, relative to the positive x-axis.

25

nPeakiness

The peakiness index of the source.

26

nConcentrationIndex

The concentration index of the source.

27

nEffectiveDiameter

The weighted diameter of the source.

28

nSkewnessX

The source skewness as a statistical measure of profile symmetry in the x-coordinate direction.

29

nSkewnessY

The source skewness as a statistical measure of profile symmetry in the y-coordinate direction.

30

nKurtosis

The source kurtosis as a statistical measure of flatness.

31

nFwhm

The FWHM of the source from the profile fit.

32

nFwhmPeak

The FWHM peak value from the profile fit.

33

nFwhmBg

The background level of the source from the profile fit.

34

iIndex

The numeric index of the detected source. Holes appear in the original sequence of indices when sources are merged and the secondary source is eliminated as a separate entity. This is an integer value.

35

iMinX

The minimum x-coordinate (column number) of the source above background. This is an integer value.

36

iMaxX

The maximum x-coordinate (column number) of the source above background. This is an integer value.

37

iMinY

The minimum y-coordinate (row number) of the source above background. This is an integer value.

38

iMaxY

The maximum y-coordinate (row number) of the source above background. This is an integer value.

39

iXatMinY

The x-coordinate (column number) at the minimum y-coordinate (row number) of the source above background. This is an integer value.

40

iXatMaxY

The x-coordinate (column number) at the maximum y-coordinate (row number) of the source above background. This is an integer value.

41

iYatMinX

The y-coordinate (row number) at the minimum x-coordinate (column number) of the source above background. This is an integer value.

42

iYatMaxX

The y-coordinate (row number) at the maximum x-coordinate (column number) of the source above background. This is an integer value.

43

iXatMinLum

The x-coordinate (column number) at the minimum luminosity of the source above background. This is an integer value.

44

iXatMaxLum

The x-coordinate (column number) at the maximum luminosity of the source above background. This is an integer value.

45

iYatMinLum

The y-coordinate (row number) at the minimum luminosity of the source above background. This is an integer value.

46

iYatMaxLum

The y-coordinate (row number) at the maximum luminosity of the source above background. This is an integer value.

47

iFirstX

The first x-coordinate (lowest column number) at the start of the source. This is an integer value.

48

iFirstY

The first y-coordinate (lowest row number) at the start of the source. This is an integer value.

49

nDetectThreshold2

Currently unused.

Example

Suppose an image window exists on the Mira screen. The script below performs source extraction on an image from this window and then repeatedly uses GetSource to fetch the (x,y) coordinates from each source's Source Properties table.

Before calling Extract, the default configuration is updated using a ImExtractParams table. Note that your ImExtractParams table does not need to be named Params as shown here.

V = attachlist_imageview()

-- attach an image window

Assert( V, "No image window")

-- leave script if no image window

 

 

I = V:GetImage()

-- get the top-most or only image

Assert( I, "No image selected")

-- leave script if no image

 

 

E = new_imextract()

-- create a CImExtract object

Params =

-- setup an ImExtractParams table

{

-- use a comma after each "name=value" pair

  bProcFilter = true,

 

  bFilterUseSepMin = true,

 

  nFilterSepMin = 10,

 

  bFilterUseAreaMax = true,

 

  nFilterAreaMax= 100,

 

  nBgMethod = 1,

 

  nDetectTreshold = 45,

-- threshold value = 45

  nDetectTest = 0,

-- detect pixels >= threshold

}

 

E:SetParams(Params)

-- set new configuration properties

 

 

bOK = E:Extract( I )

-- extract sources from image I

if not bOK then Exit("Extract failed.\n") end

 

 

 

-- report the number of sources extracted:

 

nCount = E:Count()

 

if nCount < 1 then Exit("No sources.\n") end

 

Printf("Number of sources = %d\n", nCount)

 

 

 

-- list the x,y coordinates for all sources:

 

for i = 1,nCount do

 

  local Stbl = E:GetSource(i)

-- fetch the properties of source i

  Printf("[%d]:%lg,%lg\n", i,Stbl.nCenterX,Stbl.nCenterY)

 

end

 

Related Topics

CImExtract class, Count, Extract, GetSource

 


Mira Pro x64 Script User's Guide, Copyright Ⓒ 2024 Mirametrics, Inc. All Rights Reserved.