13 #ifndef ML_MEDICAL_IMAGE_PROPERTIES_H
14 #define ML_MEDICAL_IMAGE_PROPERTIES_H
28 #pragma warning( push )
33 #pragma warning(disable : 4275 )
227 void updateVoxelSizeFromToWorldMatrix();
234 void updateToWorldMatrixFromVoxelSize();
239 void correctToWorldMatrix();
272 bool _isToWorldMatrixValid;
281 std::vector<std::string> _cDimInfos;
282 std::vector<DateTime> _tDimInfos;
283 std::vector<std::string> _uDimInfos;
295 #if ML_DEPRECATED_SINCE(3,5,0)
307 inline ML_DEPRECATED bool isToWorldMatrixValid()
const {
return isVoxelToWorldMatrixValid(); }
310 inline ML_DEPRECATED void setToWorldMatrixValid(
bool valid) { setVoxelToWorldMatrixValid(valid); }
361 inline ML_DEPRECATED std::vector<std::string>& getCDimInfos() {
return getCDimensionInfos(); };
364 inline ML_DEPRECATED std::vector<DateTime>& getTDimInfos() {
return getTDimensionInfos(); };
367 inline ML_DEPRECATED std::vector<std::string>& getUDimInfos() {
return getUDimensionInfos(); };
370 inline ML_DEPRECATED const std::vector<std::string> &getConstCDimInfos()
const {
return getCDimensionInfos(); };
373 inline ML_DEPRECATED const std::vector<DateTime> &getConstTDimInfos()
const {
return getTDimensionInfos(); };
376 inline ML_DEPRECATED const std::vector<std::string> &getConstUDimInfos()
const {
return getUDimensionInfos(); };
387 #pragma warning( pop )
This class represents basic image properties:
MLEXPORT void setImageProperties(const ImageProperties &imageProperties)
Copy property parameters from another image property instance imageProperties.
This class is a container for extended image properties derived from ImagePropertyExtension.
This class encapsulates basic medical image properties:
void setVoxelSize(const Vector3 &voxelSize)
Sets the voxel size to voxelSize. The transformation matrix is adapted adequately.
std::vector< std::string > & getUDimensionInfos()
Vector3 getVoxelSize() const
Returns the voxel size.
MedicalImageProperties()
Constructor.
const Matrix4 & getVoxelToWorldMatrix() const
Returns the voxelToWorld matrix.
bool isVoxelToWorldMatrixValid() const
Shows the validity state of the VoxelToWorldMatrix (default=true=valid).
void setVoxelToWorldMatrix(const Matrix4 &matrix)
Sets the matrix which transforms voxel to world coordinates to matrix.
void setImageProperties(const MedicalImageProperties &medicalImageProperties)
Sets a copy of the passed image properties medicalImageProperties.
std::vector< DateTime > & getTDimensionInfos()
Vector3 mapWorldToVoxel(const Vector3 &worldPosition) const
Maps the worldPosition vector to voxel coordinates and returns it.
const Matrix4 & getWorldToVoxelMatrix() const
Returns the worlToVoxel matrix.
bool operator!=(const MedicalImageProperties &medicalImageProperties) const
Returns true if *this and medicalImageProperties differ, otherwise false.
const ImagePropertyExtensionContainer & getConstImagePropertyContainer() const
const std::vector< DateTime > & getTDimensionInfos() const
bool operator==(const MedicalImageProperties &medicalImageProperties) const
Returns true if *this and medicalImageProperties are identical, otherwise false.
void setVoxelToWorldMatrixValid(bool valid)
Validates/Invalidates the VoxelToWorld matrix by passing true/false as valid.
~MedicalImageProperties() override
Destructor. Cleans up dynamically allocated memory.
void setVoxelSize(MLdouble dx, MLdouble dy, MLdouble dz)
Sets the voxel size to dx, dy and dz. This changes the voxelToWorld matrix.
double getVoxelVolumeInMilliliters() const
Returns the volume of a single voxel in milliliters (ml).
std::vector< std::string > & getCDimensionInfos()
Permits access to the additional information for subimages on the c-, t- and u-dimensions.
Vector3 mapVoxelToWorld(const Vector3 &voxelPosition) const
Maps the voxelPosition vector to world coordinates and returns it.
const std::vector< std::string > & getCDimensionInfos() const
ImagePropertyExtensionContainer & getImagePropertyContainer()
Permits access to the container for user image properties.
const std::vector< std::string > & getUDimensionInfos() const
MedicalImageProperties(const MedicalImageProperties &medicalImageProperties)
Copy constructor from an existing medicalImageProperties object to get a copy.
void translateVoxelToWorldMatrix(const Vector3 &offsetVector)
Translates the voxelToWorld matrix by the offsetVector.
void scaleVoxelToWorldMatrix(const Vector3 &scaleFactors)
Scales the voxelToWorld matrix by the vector scaleFactors and updates the image's voxel size.
MedicalImageProperties & operator=(const MedicalImageProperties &medicalImageProperties)
Assignment operator from an existing edicalImageProperties object to get a copy.
double getVoxelVolumeInCubicMillimeters() const
Returns the volume of a single voxel in cubic millimeters (mm3).
#define MLEXPORT
To export symbols from a dll/shared object, we need to mark them with the MLEXPORT symbol.
Tmat4< MLdouble > Matrix4
The standard 4x4 matrix of type double.
Tvec3< MLdouble > Vector3
A vector with 3 components of type double.