Syntax
[CIL,ci,pi]=CILofOEL(EL)
Input Parameter
Output Parameter
CIL : | | Contour index list |
ci : | | real closed contur index list (without points) |
pi : | | single point contour index list |
Examples
Used in EXP-2013-08-13
EL=[ELofn(3);ELofn(4)+3;ELofn(1)+5+3]
UEL=[ELunsort(EL);EL]; [CIL,ci,pi]=CILofOEL(UEL)
Copyright 2013-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth
Algorithm (Workflow)
This algorithm processes a sorted edge list to identify and categorize contours. It is designed to work with both closed and open contour edge lists. The function returns a contour index list, a real closed contour index list, and a single point contour index list.
Input Parameters
- EL: Edge list, which is a sorted list of edges representing contours.
Output Results
- CIL: Contour index list, indicating the start and end indices of each contour in the edge list.
- ci: Real closed contour index list, identifying contours that form a closed loop.
- pi: Single point contour index list, identifying contours that consist of a single point.
Algorithm Steps
- Initialize variables: Determine the number of edges
n
in the edge list EL
. Create a zero matrix CIL
with n
rows and 2 columns. Set a counter k
to zero.
- Iterate over each edge in the edge list using a loop from 1 to
n
.
- For each edge, check if it is the first edge or if it does not connect to the previous edge. If true, increment
k
and set the start index of the current contour in CIL
.
- If the current edge is not the first edge, set the end index of the previous contour in
CIL
.
- If the current edge is a single point (start and end nodes are the same), set the end index of the current contour in
CIL
.
- After the loop, set the end index of the last contour in
CIL
to n
.
- Adjust the length of
CIL
to include only the filled rows.
- Determine the closed contours by checking if the start node of a contour matches the end node of the same contour. Store the result in
ci
.
- Identify single point contours by checking if the start and end indices of a contour are the same and if it is a closed contour. Store the result in
pi
.
- Update
ci
to exclude single point contours, ensuring it only contains real closed contours.
Algorithm explaination created using ChatGPT on 2025-08-19 00:56. (Please note: No guarantee for the correctness of this explanation)
Last html export of this page out of FM database by TL: 2025-09-21