![]() |
ImFusion SDK 4.3
|
#include <ImFusion/Base/ImageDescriptorWorld.h>
Convenience struct extending an ImageDescriptor to also include a matrix describing the image orientation in world coordinates. More...
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. As such it can be used for representing reference geometries (see ImageResamplingAlgorithm), or for one-line creation of a new SharedImage (see SharedImage(const ImageDescriptorWorld&)).
Public Types | |
enum | Comparison { Everything = 0 , IgnorePixelType = 1 << 0 , IgnoreWidth = 1 << 1 , IgnoreHeight = 1 << 2 , IgnoreSlices = 1 << 3 , IgnoreDimensions = IgnoreWidth | IgnoreHeight | IgnoreSlices , IgnoreChannels = 1 << 4 , IgnoreSpacing = 1 << 5 , IgnoreShiftScale = 1 << 6 , IgnoreMatrix = 1 << 12 } |
Bitflag enumeration to be used with isApprox() to select which aspects of the descriptor should be compared. | |
Public Member Functions | |
ImageDescriptorWorld (const ImageDescriptor &desc, const mat4 &matrixToWorld) | |
ImageDescriptorWorld (const SharedImage &sharedImage) | |
const ImageDescriptor & | descriptor () const |
ImageDescriptor & | descriptor () |
const mat4 & | matrixToWorld () const |
Returns the transformation matrix from image space to world space. | |
void | setMatrixToWorld (const mat4 &value) |
Sets the transformation matrix from image space to world space. | |
mat4 | matrixFromWorld () const |
Returns the transformation matrix from world space to image space. | |
void | setMatrixFromWorld (const mat4 &value) |
Sets the transformation matrix from world space to image space. | |
bool | isApprox (const ImageDescriptorWorld &other, Flags< Comparison > partsToCompare=Comparison::Everything) const |
Convenience function to perform partial comparison of two ImageDescriptorWorld instances. | |
bool | isSpatiallyCompatible (const ImageDescriptorWorld &other) const |
Convenience function to compare two image world descriptors (for instance to know whether a resampling is necessary). | |
bool isApprox | ( | const ImageDescriptorWorld & | other, |
Flags< Comparison > | partsToCompare = Comparison::Everything ) const |
Convenience function to perform partial comparison of two ImageDescriptorWorld instances.
This function will use approximate comparison of floating point members. Use the bitflag partsToCompare to select which aspects of the descriptor should be considered.
bool isSpatiallyCompatible | ( | const ImageDescriptorWorld & | other | ) | const |
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})
.