DGtalTools  1.2.0
vol2heightfield

Converts volumetric file into a projected 2D image given from a normal direction N and from a starting point P.

The 3D volume is scanned in this normal direction N starting from P with a step 1. If the intensity of the 3d point is inside the given thresholds its 2D gray values are set to the current scan number.

Usage: vol2heightfield [input] [output]

Allowed options are:

Positionals:
1 TEXT:FILE REQUIRED vol file (.vol, .longvol .p3d, .pgm3d and if WITH_ITK is selected: dicom, dcm, mha, mhd). For longvol, dicom, dcm, mha or mhd formats, the input values are linearly scaled between 0 and 255.
2 TEXT=result.pgm resulting image filename (in pgm or other).
Options:
-h,--help Print this help message and exit
-i,--input TEXT:FILE REQUIRED vol file (.vol, .longvol .p3d, .pgm3d and if WITH_ITK is selected: dicom, dcm, mha, mhd). For longvol, dicom, dcm, mha or mhd formats, the input values are linearly scaled between 0 and 255.
-o,--output TEXT resulting image filename (in pgm or other)
-m,--thresholdMin INT=128 threshold min (excluded) to define binary shape.
-M,--thresholdMax INT=255 threshold max (included) to define binary shape.
--rescaleInputMin INT=0 min value used to rescale the input intensity (to avoid basic cast into 8 bits image).
--rescaleInputMax INT=255 max value used to rescale the input intensity (to avoid basic cast into 8 bits image).
--nx FLOAT=0 set the x component of the projection direction.
--ny FLOAT=0 set the y component of the projection direction.
--nz FLOAT=1 set the z component of the projection direction.
-x,--centerX UINT=0 choose x center of the projected image.
-y,--centerY UINT=0 choose y center of the projected image.
-z,--centerZ UINT=0 choose z center of the projected image.
-w,--width UINT=100 set the width of the resulting height Field image.
--height UINT=100 set the height of the resulting height Field image.
--heightFieldMaxScan UINT set the maximal scan deep.
--setBackgroundLastDepth change the default background (black with the last filled intensity).

Example:

$ vol2heightfield ${DGtal}/examples/samples/lobster.vol resultingHeightMap.pgm -m 60 -M 500 --nx 0 --ny 0.7 --nz -1 -x 150 -y 0 -z 150 --width 300 --height 300 --heightFieldMaxScan 350 resultingHeightMap.pgm
Definition: ATu0v1.h:57

You should obtain such a resulting image:

resulting image.
See also
vol2heightfield.cpp