Program: SIGDET (SIGnal DETection) Purpose: Separate signal from noise in image. Category: PROFILES, MANIPULATION,, TRANSFER File: sigdet.c Author: M. Vogelaar (written by: Foppe Leistra and Gert Cazemier) Keywords: INSET= Give input set. The set must have 3 axes. Maximum number of subsets is 2048. If some frequenties are not wanted, replace them with blanks with COMBIN or EDITSET. BOX= Give box in ..... [entire subset] Box must be given for all 3 dimensions. OUTSET= Give output set (, subsets): Output set and subset(s) for the result. The number of output subsets is the same as the number of input sub- sets. OKAY= Will overwrite data, okay ? [Y] When the outset already exists this keyword asks if it is ok to overwrite the outset. DIRECTIONS= Give directions(1, 2 and/or 3): [] The directions that will be handled. Directions are 1,2 and 3. TIMES= Give times: [3] A pixel is indicated as signal, only when there are more then TIMES directions, where it was found as signal. WINDOW= Give: minimum window length: [3] This keyword specifies the minimum window length. A profile contains signal only if this signal has a minimum length of WINDOW=. USELEVEL= Use level: [N] The program can calculate the signal-border. But a cut-off level can also be used. This keyword asks if a cut-off level must be used. The cut-off level can be given with the keyword WEIGHTx=, where x is the axis number. LEVEL= Give level : [] When a cut-off level is used, the level can be given with this keyword. NSIGMA= Give cut-off in number times sigma [number=3] When no cut-off level is used, the signal-border is calculated as follows: mean + NSIGMA= * sigma. (horizontal yellow line in GIDS) SMOOTH= Give smoothing length: [0] The size of the smoothing mask can be computed as: 2 * SMOOTH= + 1. So when a mask of size 7 is used, you give SMOOTH= 3. See for more information at METHOD=, DIRECTIONS= and WEIGHTx=. REFINEMENT= Use refinement: [Y] The signal can be refined at the beginning and the ending of the found signal. The values that are next to the signal are also indicated as signal, if they are between mean and signal-border. This keyword asks if refinement must be used. METHOD= Give smoothing option: [0] The mask must be filled with weights. This can be done with: - 0: gauss distribution - 1: hanning distribution (0.25 0.5 0.25) - 2: weights given by the user (keyword WEIGHTx=). WEIGHTx= Give weight: When the smoothing method is 2 (weights given by the user) then values can be given by this keyword. This is for axis x. SHOW= Ask to show next profile? [Y] GRDEVICE= Graphics device [list of all graphics devices] Destination of plot: Screen, Hardcopy or Null. When the profile is send to GIDS, the colors have the following meaning: cyan: Original profile blue: Smoothed profile yellow: Noise peak in this axis red: The signal that is found in this axis horizontal yellow line: The signal-border or cut-off level horizontal green line: The mean of this profile ** TOLERANCE= Give the stop condition: [0.05] The loop, to determine what is signal and what not, stops when: previous mean - mean < TOLERANCE= ** PGMOSAIC= View surface sub divisions in x,y: [1,1] View surface can contain a number of plots in in X and Y direction (mosaic). Default is 1 plot in both X- and Y direction. ** PGPAPER= Give width(cm), aspect ratio: [calc, calc] Aspect ratio is height/width. ** PGBOX= Corners of box Xl,Yl,Xh,Yh: [default by application] It is possible to overrule the calculated PGPLOT box size with PGBOX=. The coordinates (x,y) of the lower point are given first. ** PGCOLOR= Give color 1..15: [1] See description for the available colors. ** PGWIDTH= Give line width 1..21: [2] ** PGHEIGHT= Give character height: [1.0] ** PGFONT= Give font 1..4: [2] EXAMPLES: 1: To determine the values of the keywords 2: When you have determined the 'correct' keywords Example 1: SIGDET INSET= M101 BOX= -10 -10 1 -7 -7 59 Analysis of a box. OUTSET= M101.WINDOW OKAY= Y Rewrite outset GRDEVICE= GIDS Output to Gids DIRECTIONS= 1 2 3 All axis TIMES= 2 2 of the 3 axis must be found as signal REFINEMENT= N Y Y No refinement in the first axis WINDOW= 3 3 3 Minimum window must be 3 SMOOTH= 5 5 5 Size of smoothing mask is 2*5+1 METHOD= 0 1 2 Smooth is filled with: axis 1: Gauss distribution axis 2: Hanning distribution axis 3: Own weights(see WEIGHT3) WEIGHT3= 1 2 3 4 7 9 7 4 3 2 1 Weights for axis 3 USELEVEL= N Y N Use cut-off level for axis 2 NSIGMA= 3 3 Signal-border for axis 1 and 2 LEVEL= 2.5 Cut-off level for axis 2 is 2.5 SHOW= Y Now you have time to analyse a profile Example 2: SIGDET INSET= M101 BOX= Complete set and subsets OUTSET= M101.WINDOW OKAY= Y Rewrite outset GRDEVICE= NULL No output to gids SHOW= N No waiting after every profile DIRECTIONS= 1 2 3 All axis TIMES= 1 In only 1 axis has to be signal REFINEMENT= N Y Y No refinement in the first axis WINDOW= 3 3 3 Minimum window must be 3 SMOOTH= 5 5 5 Size of smoothing mask is 2*5+1 METHOD= 0 0 1 Smooth is filled with: axis 1: Gauss distribution axis 2: Gauss distribution axis 3: Hanning distribution USELEVEL= N N N Calculate signal-border for each profile NSIGMA= 3 3 3 Signal-border for axis 1, 2 and 3 DESCRIPTION: The program can find signal in an image. The image must have 3 dimensions. To determine the signal the program handles the image, profile after profile. Profiles can be read from all 3 directions. The keyword TIMES= indicates in how many directions signal must be found at one position before it finally will be signal in the outset. Window: The window-method is used to find the signal. This method will now be explained: We use a mask to indicate which channel of a profile is signal, noise or noise_peak. To make distinguish between signal and noise, we first calculate the mean and sigma of the profile. This calculation is done with profile values which have the status noise in the mask. The signal_border is computed. This is mean plus NSIGMA= times sigma. If WINDOW= channels successively have a greater intensity then the signal_border, then it is indicated as signal in the mask. When there are less than WINDOW= channels successively greater than the signal_border, and when the intensity is greater than two times the signal_border it is indicated as noise_peak. If a channel is neither signal or noise_peak, it's called noise. Previous steps are iterated until (old_mean-mean) < TOLERANCE=. All channels with the value blank are ignored. Cut-off: It is also possible to use a Cut-off level. The parameter USELEVEL= asks for each axis if you want to use a cut-off level. When a cut-off level is used for a axis, the parameter LEVEL asks this value. Smooth: The signal can also be smoothed. This can be done with the keyword SMOOTH=. This keyword asks for all axis the size of the smoothing. When you give 3 with this keyword the smoothing size will be 2*3+1=7. You can smooth with the following distributions: 0 - Gauss distribution: 2 ( z - mu ) 1 -0.5 (--------) mu + 1 f(z) = ------------------ e ( sigma ) sigma = ---------------- sigma sqrt( 2pi) sqrt(12 ln 10) Sigma is calculated, so that the position just outside the smooth mask has the value 0.000001. 1 - Hanning distribution 2 - Own distribution (with the keyword WEIGHTx=, x is the axis number) Updates: Jun 1993: FLE & GRC, Document created. Aug 1993: Olaf Kolkman, Some changes and additions. Feb 1, 2000: JPT, Increased number of subsets.