Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Export a part or all of the reconstruction volume as a short array.
The surface boundary occurs where the tri-linearly interpolated voxel values have a zero crossing (i.e. when an interpolation crosses from positive to negative or vice versa). A voxel value of 0x8000 indicates that a voxel is uninitialized and has no valid data associated with it.
Syntax
public void ExportVolumeBlock (
int sourceOriginX,
int sourceOriginY,
int sourceOriginZ,
int destinationResolutionX,
int destinationResolutionY,
int destinationResolutionZ,
int voxelStep,
short[] volumeBlock
)
Parameters
- sourceOriginX
Type: Int32
The reconstruction volume voxel index in the X axis from which the extraction should begin. This value must be greater than or equal to 0 and less than the reconstruction volume X axis voxel resolution. - sourceOriginY
Type: Int32
The reconstruction volume voxel index in the Y axis from which the extraction should begin. This value must be greater than or equal to 0 and less than the reconstruction volume Y axis voxel resolution. - sourceOriginZ
Type: Int32
The reconstruction volume voxel index in the Z axis from which the extraction should begin. This value must be greater than or equal to 0 and less than the reconstruction volume Z axis voxel resolution. - destinationResolutionX
Type: Int32
The X axis resolution/width of the new voxel volume to return in the array. This value must be greater than 0 and less than or equal to the current volume X axis voxel resolution. The final count of (sourceOriginX+(destinationResolutionX*voxelStep)) must not be greater than the current reconstruction volume X axis voxel resolution. - destinationResolutionY
Type: Int32
The Y axis resolution/height of the new voxel volume to return in the array. This value must be greater than 0 and less than or equal to the current volume Y axis voxel resolution. The final count of (sourceOriginY+(destinationResolutionY*voxelStep)) must not be greater than the current reconstruction volume Y axis voxel resolution. - destinationResolutionZ
Type: Int32
The Z axis resolution/depth of the new voxel volume to return in the array. This value must be greater than 0 and less than or equal to the current volume Z axis voxel resolution. The final count of (sourceOriginZ+(destinationResolutionZ*voxelStep)) must not be greater than the current reconstruction volume Z axis voxel resolution. - voxelStep
Type: Int32
The step value in integer voxels for sampling points to use in the volume when exporting. The value must be greater than 0 and less than the smallest volume axis voxel resolution. To export the volume at its full resolution, use a step value of 1. Use higher step values to skip voxels and return the new volume as if there were a lower effective resolution volume. For example, when exporting with a destination resolution of 320^3, setting voxelStep to 2 would actually cover a 640^3 voxel are a(destinationResolution*voxelStep) in the source reconstruction, but the data returned would skip every other voxel in the original volume. NOTE: Any value higher than 1 for this value runs the risk of missing zero crossings, and hence missing surfaces or surface details. - volumeBlock
Type: Int16
A pre-allocated short array to be filled with volume data. The number of elements in this user array should be allocated as: (destinationResolutionX * destinationResolutionY * destinationResolutionZ) To access the voxel located at x,y,z use pVolume[z][y][x], or index as 1D array for a particular voxel(x,y,z) as follows: with pitch = x resolution, slice = (y resolution * pitch) unsigned int index = (z * slice) + (y * pitch) + x; Note: A right handed coordinate system is used, with the origin of the volume (i.e. voxel 0,0,0) at the top left of the front plane of the cube. Similar to bitmap images with top left origin, +X is to the right, +Y down, and +Z is forward from origin into the reconstruction volume.
This method raises the following exceptions:
Exception | Raised By |
ArgumentNullException | Thrown when the volumeBlock parameter is null. |
ArgumentException | Thrown when the volumeBlock parameter length is not equal to (destinationResolutionX * destinationResolutionY * destinationResolutionZ). Thrown when a sourceOrigin or destinationResolution parameter less than 1 or greater than the maximum unsigned short value. Thrown when the (sourceOrigin+(destinationResolution*voxelStep)) calculation was greater than the current reconstruction volume voxel resolution along an axis. |
OutOfMemoryException | Thrown if the CPU memory required for volume export could not be allocated. |
InvalidOperationException | Thrown when the Kinect Runtime could not be accessed, the device is not connected, a GPU memory allocation failed or the call failed for an unknown reason. |
Requirements
Namespace: Microsoft.Kinect.Toolkit.Fusion
Assembly: Microsoft.Kinect.Toolkit.Fusion (in microsoft.kinect.toolkit.fusion.dll)
See Also
Reference
Reconstruction Class
Reconstruction Members
Microsoft.Kinect.Toolkit.Fusion Namespace