ImFusion Web SDK

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

PropertyTypeDescription
matrixToWorldmat4Transformation matrix from image space to world space.
matrixFromWorldmat4Transformation matrix from world space to image space.

Methods

MethodDescription
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

MethodDescription
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()

ts
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

ParameterTypeDescription
otherImageDescriptorWorld-
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()

ts
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

ParameterType
otherImageDescriptorWorld

Returns

boolean


pixelToImage()

ts
pixelToImage(pixel: vec3): vec3;

Convert a 3D pixel/voxel position to image coordinates

Parameters

ParameterType
pixelvec3

Returns

vec3


imageToPixel()

ts
imageToPixel(world: vec3): vec3;

Convert 3D image coordinates to pixel/voxel position

Parameters

ParameterType
worldvec3

Returns

vec3


pixelToWorld()

ts
pixelToWorld(pixel: vec3): vec3;

Convert a 3D pixel/voxel position to world coordinates taking into account the image matrix

Parameters

ParameterType
pixelvec3

Returns

vec3


worldToPixel()

ts
worldToPixel(world: vec3): vec3;

Convert 3D world coordinates to pixel/voxel position taking into account the image matrix

Parameters

ParameterType
worldvec3

Returns

vec3


pixelToImageMatrix()

ts
pixelToImageMatrix(): mat4;

Returns a 4x4 matrix to transform from image pixel space to image space.

Returns

mat4


imageToPixelMatrix()

ts
imageToPixelMatrix(): mat4;

Returns a 4x4 matrix to transform from image space to image pixel space.

Returns

mat4


pixelToWorldMatrix()

ts
pixelToWorldMatrix(): mat4;

Returns a 4x4 matrix to transform from image pixel space to world space.

Returns

mat4


worldToPixelMatrix()

ts
worldToPixelMatrix(): mat4;

Returns a 4x4 matrix to transform from world space to image pixel space.

Returns

mat4


textureToWorldMatrix()

ts
textureToWorldMatrix(): mat4;

Returns a 4x4 matrix to transform from texture space to world space.

Returns

mat4


worldToTextureMatrix()

ts
worldToTextureMatrix(): mat4;

Returns a 4x4 matrix to transform from world space to texture space.

Returns

mat4


textureToImageMatrix()

ts
textureToImageMatrix(): mat4;

Returns a 4x4 matrix to transform from texture space to image space.

Returns

mat4


imageToTextureMatrix()

ts
imageToTextureMatrix(): mat4;

Returns a 4x4 matrix to transform from image space to texture space.

Returns

mat4

On this page