ML Reference
|
This class encapsulates basic medical image properties: More...
#include <mlMedicalImageProperties.h>
Public Member Functions | |
Constructors | |
MedicalImageProperties () | |
Constructor. | |
virtual | ~MedicalImageProperties () |
Destructor. Cleans up dynamically allocated memory. | |
MedicalImageProperties (const MedicalImageProperties &medicalImageProperties) | |
Copy constructor from an existing medicalImageProperties object to get a copy. | |
MedicalImageProperties & | operator= (const MedicalImageProperties &medicalImageProperties) |
Assignment operator from an existing edicalImageProperties object to get a copy. | |
void | setImageProperties (const MedicalImageProperties &medicalImageProperties) |
Sets a copy of the passed image properties medicalImageProperties . | |
Comparison. | |
bool | operator== (const MedicalImageProperties &medicalImageProperties) const |
Returns true if *this and medicalImageProperties are identical, otherwise false. | |
bool | operator!= (const MedicalImageProperties &medicalImageProperties) const |
Returns true if *this and medicalImageProperties differ, otherwise false. | |
Size of voxels | |
void | setVoxelSize (MLdouble dx, MLdouble dy, MLdouble dz) |
Sets the voxel size to dx , dy and dz . This changes the voxelToWorld matrix. | |
void | setVoxelSize (const Vector3 &voxelSize) |
Sets the voxel size to voxelSize . The transformation matrix is adapted adequately. | |
Vector3 | getVoxelSize () const |
Transformation matrix | |
bool | isVoxelToWorldMatrixValid () const |
Shows the validity state of the VoxelToWorldMatrix (default=true=valid). | |
void | setVoxelToWorldMatrixValid (bool valid) |
Validates/Invalidates the VoxelToWorld matrix by passing true/false as valid . | |
const Matrix4 & | getVoxelToWorldMatrix () const |
Returns the voxelToWorld matrix. | |
void | setVoxelToWorldMatrix (const Matrix4 &matrix) |
Sets the matrix which transforms voxel to world coordinates to matrix . | |
const Matrix4 & | getWorldToVoxelMatrix () const |
Returns the worlToVoxel matrix. | |
Vector3 | mapVoxelToWorld (const Vector3 &voxelPosition) const |
Maps the voxelPosition vector to world coordinates and returns it. | |
Vector3 | mapWorldToVoxel (const Vector3 &worldPosition) const |
Maps the worldPosition vector to voxel coordinates and returns it. | |
void | scaleVoxelToWorldMatrix (const Vector3 &scaleFactors) |
Scales the voxelToWorld matrix by the vector scaleFactors and updates the image's voxel size. | |
void | translateVoxelToWorldMatrix (const Vector3 &offsetVector) |
Translates the voxelToWorld matrix by the offsetVector . | |
Information about higher dimensional subimages/channels. | |
std::vector< std::string > & | getCDimensionInfos () |
Permits access to the additional information for subimages on the c-, t- and u-dimensions. | |
std::vector< DateTime > & | getTDimensionInfos () |
std::vector< std::string > & | getUDimensionInfos () |
const std::vector< std::string > & | getCDimensionInfos () const |
const std::vector< DateTime > & | getTDimensionInfos () const |
const std::vector< std::string > & | getUDimensionInfos () const |
ImagePropertyExtensionContainer & | getImagePropertyContainer () |
Permits access to the container for user image properties. | |
const ImagePropertyExtensionContainer & | getConstImagePropertyContainer () const |
Deprecated | |
void | setImgProps (const MedicalImageProperties &medImgProps) |
bool | isToWorldMatrixValid () const |
void | setToWorldMatrixValid (bool valid) |
void | getVoxelSize (MLfloat *dx, MLfloat *dy, MLfloat *dz) const |
void | getToWorldMatrix (MLfloat *mat) const |
void | setToWorldMatrix (MLfloat *mat) |
const Matrix4 * | getToWorldMatrix () const |
void | setToWorldMatrix (const Matrix4 *mat) |
void | setToWorldMatrixIdentity () |
void | getToVoxelMatrix (MLfloat *mat) const |
const Matrix4 * | getToVoxelMatrix () const |
void | transformToWorldCoord (MLfloat *x, MLfloat *y, MLfloat *z) const |
void | transformToWorldCoord (MLdouble *x, MLdouble *y, MLdouble *z) const |
void | transformToWorldCoord (const Vector3 &voxel, Vector3 &world) const |
void | transformToVoxelCoord (MLfloat *x, MLfloat *y, MLfloat *z) const |
void | transformToVoxelCoord (MLdouble *x, MLdouble *y, MLdouble *z) const |
void | transformToVoxelCoord (const Vector3 &world, Vector3 &voxel) const |
void | scaleImage (MLfloat x, MLfloat y, MLfloat z) |
void | translateImage (MLfloat x, MLfloat y, MLfloat z) |
std::vector< std::string > & | getCDimInfos () |
std::vector< DateTime > & | getTDimInfos () |
std::vector< std::string > & | getUDimInfos () |
const std::vector< std::string > & | getConstCDimInfos () const |
const std::vector< DateTime > & | getConstTDimInfos () const |
const std::vector< std::string > & | getConstUDimInfos () const |
This class encapsulates basic medical image properties:
The following properties are available:
World coordinates are defined in the source image, e.g., loaded into the ML (usually the patient coordinate system) Changes of this coordinate system, e.g., by rotations, scales, size clamping, etc., require adoptions of the transformation matrix. So the real world positions of image voxels can be always calculated from voxel position and transformation matrix. Obviously the inverse projection is also available by inverting the transformation matrix.
Definition at line 77 of file mlMedicalImageProperties.h.
ml::MedicalImageProperties::MedicalImageProperties | ( | ) |
Constructor.
Voxel size is set to (1,1,1), DICOM tag list is set to NULL, the transformation matrix is set to the 4d unit matrix and the three channel list are initialized empty.
virtual ml::MedicalImageProperties::~MedicalImageProperties | ( | ) | [virtual] |
Destructor. Cleans up dynamically allocated memory.
ml::MedicalImageProperties::MedicalImageProperties | ( | const MedicalImageProperties & | medicalImageProperties | ) |
Copy constructor from an existing medicalImageProperties
object to get a copy.
The validity flag of ImageProperties is also copied.
std::vector<std::string>& ml::MedicalImageProperties::getCDimensionInfos | ( | ) | [inline] |
Permits access to the additional information for subimages on the c-, t- and u-dimensions.
By default these lists are empty. If not they may contain additional information e.g., about the subimages at c=0, c=1, ... c=ext.c-1, and the subimages in the t and u dimension, respectively. Note that the usage and contents are still not clearly defined and the list may not have the length of the image extents in the corresponding dimension. As a hint: -The cDimensionInfos list may be used for color channel information. Use constants defined in the mlDataTypes.h header file. -The tDimensionsInfos list may be used for temporal information - that's the reason for the "DateTime" contents. So t subimages can get information about creation time or time points, e.g., for movie playbacks. -The uDimensionInfos list may contain arbitrary user information or as an alternative information about the unit/modality which created the subimage. So multi modality information can be handled from e.g., "PET", "CT", "US" (ultrasound), "XR" (X-Ray), "MR", "MR_T1", "MR_T2", "MR_T2*", "MR_FLAIR", "MR_IR", "MR_PD" (Proton density), "MR_DW" (diffusion weighted), etc. Try to use these strings if adequate.
Definition at line 198 of file mlMedicalImageProperties.h.
const std::vector<std::string>& ml::MedicalImageProperties::getCDimensionInfos | ( | ) | const [inline] |
Definition at line 202 of file mlMedicalImageProperties.h.
std::vector<std::string>& ml::MedicalImageProperties::getCDimInfos | ( | ) | [inline] |
Definition at line 360 of file mlMedicalImageProperties.h.
const std::vector<std::string>& ml::MedicalImageProperties::getConstCDimInfos | ( | ) | const [inline] |
Definition at line 369 of file mlMedicalImageProperties.h.
const ImagePropertyExtensionContainer& ml::MedicalImageProperties::getConstImagePropertyContainer | ( | ) | const [inline] |
Definition at line 214 of file mlMedicalImageProperties.h.
const std::vector<DateTime>& ml::MedicalImageProperties::getConstTDimInfos | ( | ) | const [inline] |
Definition at line 372 of file mlMedicalImageProperties.h.
const std::vector<std::string>& ml::MedicalImageProperties::getConstUDimInfos | ( | ) | const [inline] |
Definition at line 375 of file mlMedicalImageProperties.h.
ImagePropertyExtensionContainer& ml::MedicalImageProperties::getImagePropertyContainer | ( | ) | [inline] |
Permits access to the container for user image properties.
Definition at line 213 of file mlMedicalImageProperties.h.
const std::vector<DateTime>& ml::MedicalImageProperties::getTDimensionInfos | ( | ) | const [inline] |
Definition at line 203 of file mlMedicalImageProperties.h.
std::vector<DateTime>& ml::MedicalImageProperties::getTDimensionInfos | ( | ) | [inline] |
Definition at line 199 of file mlMedicalImageProperties.h.
std::vector<DateTime>& ml::MedicalImageProperties::getTDimInfos | ( | ) | [inline] |
Definition at line 363 of file mlMedicalImageProperties.h.
void ml::MedicalImageProperties::getToVoxelMatrix | ( | MLfloat * | mat | ) | const |
const Matrix4* ml::MedicalImageProperties::getToVoxelMatrix | ( | ) | const |
void ml::MedicalImageProperties::getToWorldMatrix | ( | MLfloat * | mat | ) | const |
const Matrix4* ml::MedicalImageProperties::getToWorldMatrix | ( | ) | const |
std::vector<std::string>& ml::MedicalImageProperties::getUDimensionInfos | ( | ) | [inline] |
Definition at line 200 of file mlMedicalImageProperties.h.
const std::vector<std::string>& ml::MedicalImageProperties::getUDimensionInfos | ( | ) | const [inline] |
Definition at line 204 of file mlMedicalImageProperties.h.
std::vector<std::string>& ml::MedicalImageProperties::getUDimInfos | ( | ) | [inline] |
Definition at line 366 of file mlMedicalImageProperties.h.
Vector3 ml::MedicalImageProperties::getVoxelSize | ( | ) | const |
const Matrix4& ml::MedicalImageProperties::getVoxelToWorldMatrix | ( | ) | const |
Returns the voxelToWorld matrix.
const Matrix4& ml::MedicalImageProperties::getWorldToVoxelMatrix | ( | ) | const |
Returns the worlToVoxel matrix.
bool ml::MedicalImageProperties::isToWorldMatrixValid | ( | ) | const [inline] |
Definition at line 306 of file mlMedicalImageProperties.h.
bool ml::MedicalImageProperties::isVoxelToWorldMatrixValid | ( | ) | const |
Shows the validity state of the VoxelToWorldMatrix (default=true=valid).
false
indicates that the voxelToWorldMatrix is invalid, i.e., also derived data like voxel size or WorldToVoxelMatrix are invalid. Note that this flag state does not change anything on matrix calculations behavior and it does not have anything to do with the validity of the matrix pointer. ML-Matrix calculations are NOT influenced by the state of this flag. Calculations continue even if matrices or voxel size are invalid. This flag is just a hint for operators about matrix reliability. Default is true.
Maps the voxelPosition
vector to world coordinates and returns it.
Maps the worldPosition
vector to voxel coordinates and returns it.
bool ml::MedicalImageProperties::operator!= | ( | const MedicalImageProperties & | medicalImageProperties | ) | const |
Returns true if *this and medicalImageProperties
differ, otherwise false.
MedicalImageProperties& ml::MedicalImageProperties::operator= | ( | const MedicalImageProperties & | medicalImageProperties | ) |
Assignment operator from an existing edicalImageProperties
object to get a copy.
The validity flag of ImageProperties is also copied.
bool ml::MedicalImageProperties::operator== | ( | const MedicalImageProperties & | medicalImageProperties | ) | const |
Returns true if *this and medicalImageProperties
are identical, otherwise false.
Definition at line 354 of file mlMedicalImageProperties.h.
void ml::MedicalImageProperties::scaleVoxelToWorldMatrix | ( | const Vector3 & | scaleFactors | ) |
Scales the voxelToWorld matrix by the vector scaleFactors
and updates the image's voxel size.
void ml::MedicalImageProperties::setImageProperties | ( | const MedicalImageProperties & | medicalImageProperties | ) |
Sets a copy of the passed image properties medicalImageProperties
.
Note that the validity flag of base class imageProperties is not copied, i.e., left unchanged.
void ml::MedicalImageProperties::setImgProps | ( | const MedicalImageProperties & | medImgProps | ) | [inline] |
Definition at line 303 of file mlMedicalImageProperties.h.
References ml::ImageProperties::setImageProperties().
void ml::MedicalImageProperties::setToWorldMatrix | ( | const Matrix4 * | mat | ) |
void ml::MedicalImageProperties::setToWorldMatrix | ( | MLfloat * | mat | ) |
void ml::MedicalImageProperties::setToWorldMatrixIdentity | ( | ) |
void ml::MedicalImageProperties::setToWorldMatrixValid | ( | bool | valid | ) | [inline] |
Definition at line 309 of file mlMedicalImageProperties.h.
Sets the voxel size to dx
, dy
and dz
. This changes the voxelToWorld matrix.
void ml::MedicalImageProperties::setVoxelSize | ( | const Vector3 & | voxelSize | ) |
Sets the voxel size to voxelSize
. The transformation matrix is adapted adequately.
void ml::MedicalImageProperties::setVoxelToWorldMatrix | ( | const Matrix4 & | matrix | ) |
Sets the matrix which transforms voxel to world coordinates to matrix
.
void ml::MedicalImageProperties::setVoxelToWorldMatrixValid | ( | bool | valid | ) |
Validates/Invalidates the VoxelToWorld matrix by passing true/false as valid
.
See isVoxelToWorldMatrixValid() for more information.
void ml::MedicalImageProperties::transformToVoxelCoord | ( | MLdouble * | x, |
MLdouble * | y, | ||
MLdouble * | z | ||
) | const |
void ml::MedicalImageProperties::transformToVoxelCoord | ( | const Vector3 & | world, |
Vector3 & | voxel | ||
) | const |
void ml::MedicalImageProperties::transformToVoxelCoord | ( | MLfloat * | x, |
MLfloat * | y, | ||
MLfloat * | z | ||
) | const |
void ml::MedicalImageProperties::transformToWorldCoord | ( | const Vector3 & | voxel, |
Vector3 & | world | ||
) | const |
void ml::MedicalImageProperties::transformToWorldCoord | ( | MLdouble * | x, |
MLdouble * | y, | ||
MLdouble * | z | ||
) | const |
void ml::MedicalImageProperties::transformToWorldCoord | ( | MLfloat * | x, |
MLfloat * | y, | ||
MLfloat * | z | ||
) | const |
Definition at line 357 of file mlMedicalImageProperties.h.
void ml::MedicalImageProperties::translateVoxelToWorldMatrix | ( | const Vector3 & | offsetVector | ) |
Translates the voxelToWorld matrix by the offsetVector
.