tracing of vectors in an image


vect_ima

Author:
C. MAIER
Version:
1.0 (03/04/00); Include : vect_ima.h


param * vector_lect (vector_t *des, param *ptp, char *debq)
int vector_calc (vector_t *des)

Detailed Description

operator vector : tracing of vectors in an image or directional filtering of the image along given vectors.

directional filtering:
To protect the edges from blurring while smoothing a directional filter is suited. As direction the vectors given in the input file are used.

Filter type:
As direction the eigenvectors calculated by the PCA are suited. Since the third eigenvector is pointing in the most homogeneous direction, the filter was applied in that direction to preserve the edges. For reason of simplicity the mean along the direction is chosen. A 1D mean filter is calculated for each voxel along the direction of the given vector.

$ Y(x,y,z)=\sum(X(x,y,z)) \qquad \forall (x,y,z) \in A $

where A denotes the area of all voxels belonging to the calculated straight line segment of a certain length.

line tracing:
This operator visualizes vectors in an image of the format ima3ds2. The user of the operator has to specify the radius of the window for tracing the vectors. The operator will visualize the vectors for all points with a distance of 2*window radius + 1 in each dimension. Only the orientation is printed with a chosen intensity in the image not the direction.

Example in 2D:
size=2, actual pixel is the center, vector=[0.7,0.7]

- - - - X
- - - X -
- - X - -
- X - - -
X - - - -

Description of the algorithm used to trace the vector for the filtering and the printing:
To follow a given direction by a vector a fast algorithm is appropriate. For this purpose the Bresenham algorithm is suited. This algorithm has its origin in computer graphics like CAD. In many of these kind of programs a digital straight line segment connecting two points p1 and p2 of the image domain must be traced on a screen.

To use this algorithm in our case the start and end coordinates of the line to draw have been specified using the actual site, the window size and the vector. We consider the straight line segment is a finite set of grid points of the square raster grid, individuated by a straight line segment of the Euclidean plane by making use of the grid intersection digitization criterion; the grid point closest to each intersection between the grid and the Euclidean segment is an element of the digital straight line segment. Normally this point set has two unique end points, it can be ordered as 8-path from one end point to the other, and the digital straight line segment can be identified with this 8-path.

The computation of a digital straight line segment uses consecutive 'small' steps from pixel to pixel, starting at p1=(x1,y1) and ending at p2=(x2,y2). These elementary steps can be restricted to be parallel to he coordinate axes (4-path), or can also include diagonal steps (8-path). The latter case is mostly used for representing a digital curve, and it is also used in the straight line algorithm given below. Besides the given points p1 and p2 the algorithm generates additional

max{|x1-x2|,|y1-y2|}-1

'new' points on the screen for a digital straight line from p1 to p2.
To apply this algorithm in 3D, the y has to be replaced by the z to get the third coordinate of the line points. Thus the 3D case uses the two 2D projection of the line in the XY- and the ZY-plane.

Descriptor:

The vector file has to have the following format:
dimensions (struct dimensions)
vector1 (struct eigenvectors)
.
vectori (struct eigenvectors)
.
.

The vectors are saved sequentially in the counting order x, y, z. The type definitions of these structures are available in the header file filelib.h.


Function Documentation

int vector_calc ( vector_t des  ) 

Printing the vectors in the image / directional filtering of the image .\

Parameters:
des pointeur descripteur
Author:
C. MAIER
Version:
1.0 (03/04/00); Include : vect_ima.h, filelib.h , volume.h

Definition at line 459 of file vect_ima.c.

Referenced by main().

param* vector_lect ( vector_t des,
param *  ptp,
char *  debq 
)

reading of parameters for the operator vector.

Parameters:
des descriptor pointer
ptp pointer of the current parameters allready allocated,
debq pointer to a string placed to the begin of the question
Returns:
returns a new pointer for the parameters
Author:
C. MAIER
Version:
1.0 (03/04/00); Include : vect_ima.h, filelib.h , volume.h

Definition at line 412 of file vect_ima.c.

Referenced by main().


Generated on Tue Apr 22 13:31:07 2008 for volume by  doxygen 1.5.3