VFITPOLY

VisionX V4
NAME

vfitpoly − fits polynomials from a given VX thinned structure point

SYNOPSIS

vfitpoly if=<imgfile> of=<outfile> st=<x,y,z> en=<x,y,z> scale=<xs,ys,zs> p=<pfit> len=<len> [-w] [-v]

DESCRIPTION

vfitpoly takes in a VX image of a thinned structure (output from v3thin) and fits a polynomial through a segment from the structure. A polynomial of degree [p=] is fitted through the non-zero voxels in the input image. The polynomials are fitted for x, y, and z coordinates with respect to t.

The polynomials are fit in mm space, rather than voxel space, according to [scale=] parameter specified by the user. The start and end coordinates of the segment needs to be also specified by the user, and the voxels corresponding to these coordinates must be non-zero voxels. When of= is specified, the output is a binary image of the fitted line.

When -w flag is used, the program gives wish output for setting variables. The variables include "xfit", "yfit", and "zfit" that give the comma-separated coefficients for the fitted polynomial, ordered from higher to lower coefficient.

When [len=] is specified additional line is output to the console, specifying the coordinate of the point that is [len=] away from the start point.

Examples:
For a fitted polynomial x(t) = A*t^3 + B*t^2 + C*t + D,
the output will be: set xfit "A,B,C,D"
For a fitted polynomial y(t) = A*t^2 + B*t + C,
the output will be: set yfit "A,B,C"

CONSTRAINTS

Input must be a byte image.

OPTIONS

if=

VX thinned image file

of=

output file with ordered list of coordinates

st=

coordinate of staring point [x,y,z]

en=

coordinate of end point [x,y,z]

scale=

scan resolution (mm/pixel) [xs,ys,zs]

p=

polynomial fit order

len=

length from the start point

-w

wish output option

-v

verbose mode

SEE ALSO

v3thin

AUTHOR

Jaesung Lee