MeVisLab Toolbox Reference
mlDicomToMLTools.h File Reference

Tool class with many tool functions for the conversion of DICOM information and tag values to comparable ML information objects. More...

Go to the source code of this file.

Namespaces

 ml
 Main documentation file for ML users and developers.
 
 ml::DICOMTagTools
 A namespace collecting tools related to DICOM tags and tree tools.
 
 ml::DicomToMLTools
 Tool functions for the extraction and handling of information of specific DICOM frames.
 

Enumerations

enum  ml::DicomToMLTools::FillPageMethods {
  ml::DicomToMLTools::FILL_WITH_IMG_FILE_READER_WO_DICOM = 0 , ml::DicomToMLTools::FILL_WITH_IMG_FILE_READER , ml::DicomToMLTools::FILL_WITH_SPECTROSCOPY_DATA_TAG_DATA , ml::DicomToMLTools::FILL_WITH_PIXEL_DATA_TAG_DATA ,
  ml::DicomToMLTools::FILL_WITH_DEFAULT_FILL_VAL , ml::DicomToMLTools::FILL_DO_NOT_FILL
}
 Methods how to fill a page with data from the DICOM file or tree. More...
 
enum  ml::DicomToMLTools::OutputDataTypeSelector {
  ml::DicomToMLTools::NoChange = 0 , ml::DicomToMLTools::Automatic , ml::DicomToMLTools::UseMLuint8 , ml::DicomToMLTools::UseMLint8 ,
  ml::DicomToMLTools::UseMLuint16 , ml::DicomToMLTools::UseMLint16 , ml::DicomToMLTools::UseMLuint32 , ml::DicomToMLTools::UseMLint32 ,
  ml::DicomToMLTools::UseMLFloat , ml::DicomToMLTools::UseMLDouble
}
 Specifies whether the output voxel type shall be adopted when the data is scaled. More...
 
enum  { ml::DicomToMLTools::NumOutputDataTypeSelectors = UseMLDouble +1 }
 Number of available OutputDataTypeSelectors modes. More...
 

Functions

MLDICOM_TO_ML_TOOLS_EXPORT void ml::DicomToMLTools::convertToImageProperties (DCMTree::StructuredMFPtr &baseSMFPtr, const std::string &firstFileName, PagedImage &resultImgProps, FillPageMethods *fillPageMethod, const ZTUFileNameSet *setOfFileHandles, double defaultFillValue, CalculateMinMaxFromDicomModes minMaxCalcMode, const std::string &versionString, bool anonymize, bool removePrivateMultiFrameSQTag, bool forceOrthogonalWorldMatrix, bool copyPrivateTopLevelSrcTags, DicomMessageCollector &dcmMsgCollector)
 Determines as much PagedImage information from baseSMFPtr as possible and. More...
 
MLDICOM_TO_ML_TOOLS_EXPORT size_t ml::DicomToMLTools::getVoxelSize (DCMTree::Const_TreePtr treePtr, double &voxSizeX, double &voxSizeY, double &voxSizeZ, bool replaceOnlyIfFound, bool *isPrecise, std::vector< DCMTree::RawTagId > *usedTags, DicomMessageCollector &dcmMsgCollector)
 Determine the voxel size from the DICOM tags and returns the number of found extents. More...
 
MLDICOM_TO_ML_TOOLS_EXPORT bool ml::DicomToMLTools::applyPaletteInfosToPagedImage (const DICOMTagTools::DicomPaletteInfo &paletteInfos, PagedImage &pagedImage, const bool adjustToLUTType=false)
 If possible then this function modifies pagedImage according to the settings paletteInfos. More...
 
MLDICOM_TO_ML_TOOLS_EXPORT bool ml::DicomToMLTools::applySubImageColorLookUp (const SubImage &inSubImg, const DICOMTagTools::DicomPaletteInfo &paletteInfo, SubImage &outSubImg)
 Applies an intensity to color look up from valid region of inSubImg and paletteInfo to outSubImg. More...
 
MLDICOM_TO_ML_TOOLS_EXPORT bool ml::DicomToMLTools::applyPhotometricInterpretationChangesToPagedImage (const DCMTree::Const_TreePtr &dcmTree, PagedImage &pagedImage)
 If possible then this function modifies pagedImage according to the photometric interpretation such that pixel values can be translated correctly. More...
 
MLDICOM_TO_ML_TOOLS_EXPORT bool ml::DicomToMLTools::applyPhotometricInterpretationToSubImg (DCMTree::Const_TreePtr dcmTree, const SubImage &inSubImg, const double minVoxelValue, const double maxVoxelValue, SubImage &outSubImg)
 Applies a color format conversion from input subimage to output subimage according to the photometric interpretation tag in dcmTree. More...
 
MLDICOM_TO_ML_TOOLS_EXPORT void ml::DicomToMLTools::getSpectDICOMImageProperties (DCMTree::Const_TreePtr treePtr, const std::string &fileNameUTF8, PagedImage &outInfos, Vector4 &rotAxisAndRadians, Vector3 &ipp, Vector3 &relMRSPositionVector, Vector3 &mrsPositionVector, Vector3 &voiVector, Vector3 &fovVector, bool useOldWorldMatrixCalculation, DicomMessageCollector &dcmMsgCollector)
 Extract spectroscopy image properties and some other infos from the passed DICOM tree. More...
 
MLDICOM_TO_ML_TOOLS_EXPORT bool ml::DicomToMLTools::copySpectData (SubImage &outSubImg, const ImageVector &outImgExtent, const DICOMTagTools::SpectComplex *mrsData, size_t spectDataSizeInBytes)
 Copies the complex spectroscopy data from mrsData to the output subimage assuming appropriate sizes of mrsData which must have been calculated successfully with getSpectDICOMImageProperties and which must match the PagedImage properties calculated in the same routine. More...
 
MLDICOM_TO_ML_TOOLS_EXPORT bool ml::DicomToMLTools::isImageFrameNotOfBits (DCMTree::Const_TreePtr treePtr)
 Returns true if the DICOM tree seems to describe a sensible image with column and row extents > 1 as well as pixels with more than one bit per pixel, otherwise false. More...
 
MLDICOM_TO_ML_TOOLS_EXPORT void ml::DicomToMLTools::setWorldMatrixFromDcmTree (DCMTree::Const_TreePtr treePtr, PagedImage &outInfos, DicomMessageCollector &dcmMsgCollector)
 If possible all image properties from the DcmTree needed to set up the world matrix are searched and converted to a world matrix and voxel size and set in outInfos. More...
 
MLDICOM_TO_ML_TOOLS_EXPORT MLDataType ml::DicomToMLTools::getMLDataTypeFromDCMTree (DCMTree::Const_TreePtr treePtr, DicomMessageCollector &dcmMsgCollector)
 Determines the ML data type of pixel data in the given DICOM tree treePtr. More...
 
MLDICOM_TO_ML_TOOLS_EXPORT void ml::DicomToMLTools::checkAndCorrectImageExtentAccordingToPixelData (DCMTree::Const_TreePtr treePtr, size_t pixelDataSizeInBytes, ImageVector &imgExt, DicomMessageCollector &dcmMsgCollector)
 Check especially whether the extent of the image given in imgExt is larger by a multiple than the pixel data where the multiple is the same as imgExt.z, imgExt.t or imgExt.z*imgExt.t. More...
 
MLDICOM_TO_ML_TOOLS_EXPORT bool ml::DicomToMLTools::determineImageExtentsFromDCMTree (DCMTree::Const_TreePtr treePtr, ImageVector &imgExt, std::vector< std::string > *cDimInfos, bool overrideBadTagInfos, DicomMessageCollector &dcmMsgCollector)
 Update imgExt and - if non nullptr - cDimInfos from treePtr if possible, otherwise they are left unchanged. More...
 
MLDICOM_TO_ML_TOOLS_EXPORT void ml::DicomToMLTools::getAnyDICOMImageProperties (DCMTree::Const_TreePtr treePtr, PagedImage &outInfos, bool overrideBadTagInfos, DicomMessageCollector &dcmMsgCollector)
 Extract as many PagedImage properties from the passed DICOM treePtr as possible. More...
 
MLDICOM_TO_ML_TOOLS_EXPORT std::string ml::DicomToMLTools::determineBasicREGProperties (DCMTree::Const_TreePtr treePtr, size_t extent[3], double voxelSize[3], MLErrorCode &errCode, DicomMessageCollector &dcmMsgCollector)
 Extract basic image properties from a DICOM tree of REG modality and SOP Class UID "1.2.840.10008.5.1.4.1.1.66.3" (Deformable Registration Storage). More...
 
MLDICOM_TO_ML_TOOLS_EXPORT std::string ml::DicomToMLTools::determineREGProperties (DCMTree::Const_TreePtr treePtr, ImageVector &extent, Vector3 &voxelSize, SubImage *subImage, MLErrorCode *errCode, DicomMessageCollector &dcmMsgCollector)
 Extract image properties and deformable vector field from a DICOM tree of REG modality and SOP Class UID "1.2.840.10008.5.1.4.1.1.66.3" (Deformable Registration Storage) Spatial registration storage with SOP Class UID "1.2.840.10008.5.1.4.1.1.66.1" will result to empty return string, ML_RESULT_OK (if errCode is provided), (0,...,0) extent, voxel size (1,1,1), subImage with empty box, nullptr data, and MLuint8Type. More...
 
MLDICOM_TO_ML_TOOLS_EXPORT bool ml::DicomToMLTools::hasValidNonImageModality (DCMTree::Const_TreePtr treePtr)
 Returns true only if the passed string is a known, non-empty and valid modality string which is a non image modality (RTSTRUCT, RTPLAN, RTRECORD, AU, SR, HD, ECG, FID...) and the DCMTree is not a Secondary Capture IOD. More...
 
MLDICOM_TO_ML_TOOLS_EXPORT MLDataType ml::DicomToMLTools::determineOutputVoxelType (DCMTree::StructuredMFPtr &srcVolumeSMFTree, const MLDataType inVoxDataType, const SubImageBox &volumeBox, const double inDataRangeMin, const double inDataRangeMax, const OutputDataTypeSelector voxelTypeSelector, const VoxelDoubleOperations operationMode, const PositionSpecificDoubleVector &posDbls, const VoxelDoubleOperations defaultOperationMode, const double defaultOperationDouble, double &resultRangeMin, double &resultRangeMax)
 Determines a voxel type for an ML output image from some properties of an input image and a set of double values applied to different slices of the input image. More...
 
MLDICOM_TO_ML_TOOLS_EXPORT void ml::DicomToMLTools::determineDCMTreeInfo (DCMTree::Const_TreePtr dcmTree, DCMTreeInfo &dcmTreeInfo)
 Stores some statistical information from dcmTree in dcmTreeInfo. More...
 
MLDICOM_TO_ML_TOOLS_EXPORT DCMTree::Const_StructuredMFPtr ml::DicomToMLTools::getSMFTreeFromPagedImage (const PagedImage &pImg)
 Tries to get the first DICOM image property extension and returns its DCMTree wrapped as Structured MF Tree if possible; otherwise nullptr is returned. More...
 

Variables

MLDICOM_TO_ML_TOOLS_EXPORT const char *const ml::DicomToMLTools::OutputDataTypeSelectorsStrings [NumOutputDataTypeSelectors]
 Strings according to OutputDataTypeSelector. More...
 

Detailed Description

Tool class with many tool functions for the conversion of DICOM information and tag values to comparable ML information objects.

Author
Wolf Spindler
Date
2011-03-03

Definition in file mlDicomToMLTools.h.