ImageDescriptorWorld
Convenience struct extending an ImageDescriptor to also include a matrix describing the image orientation in world coordinates.
This struct can be useful for describing the geometrical properties of an image without need to hold the (heavy) image content.
Extends
Properties
| Property | Type | Description |
|---|---|---|
matrixToWorld | mat4 | Transformation matrix from image space to world space. |
matrixFromWorld | mat4 | Transformation matrix from world space to image space. |
Methods
| Method | Description |
|---|---|
| isApprox() | Convenience function to perform partial comparison of two ImageDescriptorWorld instances. |
| isSpatiallyCompatible() | Convenience function to compare two image world descriptors (for instance to know whether a resampling is necessary). |
| pixelToImage() | Convert a 3D pixel/voxel position to image coordinates |
| imageToPixel() | Convert 3D image coordinates to pixel/voxel position |
| pixelToWorld() | Convert a 3D pixel/voxel position to world coordinates taking into account the image matrix |
| worldToPixel() | Convert 3D world coordinates to pixel/voxel position taking into account the image matrix |
| pixelToImageMatrix() | Returns a 4x4 matrix to transform from image pixel space to image space. |
| imageToPixelMatrix() | Returns a 4x4 matrix to transform from image space to image pixel space. |
| pixelToWorldMatrix() | Returns a 4x4 matrix to transform from image pixel space to world space. |
| worldToPixelMatrix() | Returns a 4x4 matrix to transform from world space to image pixel space. |
| textureToWorldMatrix() | Returns a 4x4 matrix to transform from texture space to world space. |
| worldToTextureMatrix() | Returns a 4x4 matrix to transform from world space to texture space. |
| textureToImageMatrix() | Returns a 4x4 matrix to transform from texture space to image space. |
| imageToTextureMatrix() | Returns a 4x4 matrix to transform from image space to texture space. |
Inherited from ClassHandle
| Method | Description |
|---|---|
| isAliasOf() | Returns true if this handle and other alias the same underlying C++ object. |
| delete() | Releases this JavaScript handle. |
| deleteLater() | Schedules this handle for deferred deletion and returns this handle. |
| isDeleted() | Returns true if this handle has already been deleted. |
| [dispose]() | Releases this handle when the enclosing scope exits, so a handle can be declared with using instead of calling delete() later manually. |
| clone() | Returns a new JavaScript handle aliasing the same underlying C++ object. |
isApprox()
isApprox(other: ImageDescriptorWorld, partsToCompare?: ImageDescriptorWorldComparison[]): boolean;Convenience function to perform partial comparison of two ImageDescriptorWorld instances. This function will use approximate comparison of floating point members.
Parameters
| Parameter | Type | Description |
|---|---|---|
other | ImageDescriptorWorld | - |
partsToCompare? | ImageDescriptorWorldComparison[] | Optional array to select which aspects of the ImageDescriptor should be considered. Use the bitflag partsToCompare to select which aspects of the descriptor should be considered. |
Returns
boolean
isSpatiallyCompatible()
isSpatiallyCompatible(other: ImageDescriptorWorld): boolean;Convenience function to compare two image world descriptors (for instance to know whether a resampling is necessary).
Two descriptors are compatible if their dimensions, matrix and spacing are identical.
Has the same effect as isApprox(other, {ImageDescriptorWorld::IgnorePixelType, ImageDescriptorWorld::IgnoreChannels, ImageDescriptorWorld::IgnoreShiftScale}).
Parameters
| Parameter | Type |
|---|---|
other | ImageDescriptorWorld |
Returns
boolean
pixelToImage()
pixelToImage(pixel: vec3): vec3;Convert a 3D pixel/voxel position to image coordinates
Parameters
| Parameter | Type |
|---|---|
pixel | vec3 |
Returns
imageToPixel()
imageToPixel(world: vec3): vec3;Convert 3D image coordinates to pixel/voxel position
Parameters
| Parameter | Type |
|---|---|
world | vec3 |
Returns
pixelToWorld()
pixelToWorld(pixel: vec3): vec3;Convert a 3D pixel/voxel position to world coordinates taking into account the image matrix
Parameters
| Parameter | Type |
|---|---|
pixel | vec3 |
Returns
worldToPixel()
worldToPixel(world: vec3): vec3;Convert 3D world coordinates to pixel/voxel position taking into account the image matrix
Parameters
| Parameter | Type |
|---|---|
world | vec3 |
Returns
pixelToImageMatrix()
pixelToImageMatrix(): mat4;Returns a 4x4 matrix to transform from image pixel space to image space.
Returns
imageToPixelMatrix()
imageToPixelMatrix(): mat4;Returns a 4x4 matrix to transform from image space to image pixel space.
Returns
pixelToWorldMatrix()
pixelToWorldMatrix(): mat4;Returns a 4x4 matrix to transform from image pixel space to world space.
Returns
worldToPixelMatrix()
worldToPixelMatrix(): mat4;Returns a 4x4 matrix to transform from world space to image pixel space.
Returns
textureToWorldMatrix()
textureToWorldMatrix(): mat4;Returns a 4x4 matrix to transform from texture space to world space.
Returns
worldToTextureMatrix()
worldToTextureMatrix(): mat4;Returns a 4x4 matrix to transform from world space to texture space.
Returns
textureToImageMatrix()
textureToImageMatrix(): mat4;Returns a 4x4 matrix to transform from texture space to image space.
Returns
imageToTextureMatrix()
imageToTextureMatrix(): mat4;Returns a 4x4 matrix to transform from image space to texture space.