MeVisLab Toolbox Reference
|
This class encapsulates basic medical image properties: More...
#include <mlMedicalImageProperties.h>
Public Member Functions | |
Constructors | |
MedicalImageProperties () | |
Constructor. | |
~MedicalImageProperties () override | |
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 |
Returns the voxel size. | |
double | getVoxelVolumeInCubicMillimeters () const |
Returns the volume of a single voxel in cubic millimeters (mm3). | |
double | getVoxelVolumeInMilliliters () const |
Returns the volume of a single voxel in milliliters (ml). | |
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 |
Public Member Functions inherited from ml::ImageProperties | |
MLEXPORT | ImageProperties () |
Constructor. | |
virtual MLEXPORT | ~ImageProperties () |
Virtual destructor to suppress compiler warnings. | |
MLEXPORT | ImageProperties (ImageVector extent, MLDataType dataType, MLdouble minValue, MLdouble maxValue) |
Constructor to set extent to extent , data type to dataType , minimum value to minValue and maximum value to maxValue . | |
MLEXPORT | ImageProperties (const ImageProperties &imageProperties) |
Copy constructor from an existing imageProperties object to get an identical copy. | |
MLEXPORT ImageProperties & | operator= (const ImageProperties &imageProperties) |
Assignment operator from an existing imageProperties object to get an identical copy. | |
MLEXPORT void | setImageProperties (const ImageProperties &imageProperties) |
Copy property parameters from another image property instance imageProperties . | |
MLEXPORT bool | operator== (const ImageProperties &imageProperties) const |
Returns true if *this and imageProperties are identical, otherwise false. | |
MLEXPORT bool | operator!= (const ImageProperties &imageProperties) const |
Returns true if *this and imageProperties differ, otherwise false. | |
MLEXPORT void | setImageExtent (const ImageVector &extent) |
Sets the extent of the (sub)image. | |
ImageVector | getImageExtent () const |
Returns the extent of the (sub)image. | |
SubImageBox | getBoxFromImageExtent () const |
Returns size of image as box with origin 0. | |
bool | hasValidExtent () const |
Returns if the image has a valid extent (which means that all components are greater than 0). | |
MLint | getNumVoxels () const |
Returns number of voxels in (sub)image. | |
MLint | getSizeInBytes () const |
Returns number of potential bytes in (sub)image. | |
virtual MLEXPORT void | setDataType (MLDataType dataType) |
Sets type of data to dataType . | |
MLDataType | getDataType () const |
Returns the data type of the image. | |
void | setMinVoxelValue (MLdouble minval) |
Sets assumed minimum value to minval. | |
MLdouble | getMinVoxelValue () const |
Returns the assumed minimum value in data. | |
void | setMaxVoxelValue (MLdouble maxval) |
Sets assumed maximum value to maxval. | |
MLdouble | getMaxVoxelValue () const |
Returns the assumed maximum value in data. | |
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 68 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.
|
override |
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.
|
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 199 of file mlMedicalImageProperties.h.
|
inline |
Definition at line 203 of file mlMedicalImageProperties.h.
|
inline |
Definition at line 215 of file mlMedicalImageProperties.h.
|
inline |
Permits access to the container for user image properties.
Definition at line 214 of file mlMedicalImageProperties.h.
Referenced by ml::PagedImageProperties::PagedImageProperties().
|
inline |
Definition at line 200 of file mlMedicalImageProperties.h.
Definition at line 204 of file mlMedicalImageProperties.h.
|
inline |
Definition at line 201 of file mlMedicalImageProperties.h.
|
inline |
Definition at line 205 of file mlMedicalImageProperties.h.
Vector3 ml::MedicalImageProperties::getVoxelSize | ( | ) | const |
Returns the voxel size.
Referenced by ml::setITKWorldFromMedicalImageProperty().
Returns the voxelToWorld matrix.
Referenced by ml::setITKWorldFromMedicalImageProperty().
double ml::MedicalImageProperties::getVoxelVolumeInCubicMillimeters | ( | ) | const |
Returns the volume of a single voxel in cubic millimeters (mm3).
This returns the correct volume for sheared datasets and calculates fabs( inImg->getVoxelToWorldMatrix().det() ).
double ml::MedicalImageProperties::getVoxelVolumeInMilliliters | ( | ) | const |
Returns the volume of a single voxel in milliliters (ml).
This returns the correct volume for sheared datasets and calculates fabs( inImg->getVoxelToWorldMatrix().det() ) / 1000.
Returns the worlToVoxel matrix.
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.
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.
Sets the voxel size to voxelSize
. The transformation matrix is adapted adequately.
Sets the voxel size to dx
, dy
and dz
. This changes the voxelToWorld matrix.
Sets the matrix which transforms voxel to world coordinates to matrix
.
Referenced by ml::setMLWorldFromITKScaleOriginAndOrientation(), and ml::PCLMLTools::transformTo().
Validates/Invalidates the VoxelToWorld matrix by passing true/false as valid
.
See isVoxelToWorldMatrixValid() for more information.
Translates the voxelToWorld matrix by the offsetVector
.
Referenced by ml::setITKWorldFromMedicalImageProperty(), and ml::setMLWorldFromITKScaleOriginAndOrientation().