Generates normal vector field from a vol file using DGtal library.
It will output the embedded vector field (Gaussian convolution on elementary normal vectors) an OFF file, and a TXT normal vector file (theta, phi in degree).
Usage: vol2normalField[options] –input <volFileName> –o <outputFileName>
Allowed options are :
-h [ --help ] display this message.
-i [ --input ] arg Input vol file.
-o [ --output ] arg Output filename.
-l [ --level ] arg (=0) Iso-level for the surface construction.
-s [ --sigma ] arg (=5) Sigma parameter of the Gaussian kernel.
--exportOriginAndExtremity exports the origin and extremity of the
vector fields when exporting the vector field
in TXT format (useful to be displayed in
other viewer like meshViewer).
-N [ --vectorsNorm ] arg (=1) set the norm of the exported vectors in TXT
format (when the extremity points are
exported with --exportOriginAndExtremity). By
using a negative value you will invert the
direction of the vectors.
-n [ --neighborhood ] arg (=10) Size of the neighborhood for the convolution
(distance on surfel graph).
Example:
We consider the generation of normal vector field from the Iso-level 40 and export the vectors with a norm = -3 (negative value to invert the normal direction).
$ vol2normalField -i $DGtal/examples/samples/lobster.vol -o lobTreshold40 -l 40 --exportOriginAndExtremity -N -3
You can use the too meshViewer to display the resulting vector field with the Iso-level surface:
$ meshViewer -i lobTreshold40.off -f lobTreshold40.txt --vectorFieldIndex 2 3 4 5 6 7 -n
You should obtain such a result:
Resulting vector field visualization.
- See also
- vol2normalField.cpp