MeVisLab Toolbox Reference
mlDicomToMLTools.h
Go to the documentation of this file.
1// Copyright (c) Fraunhofer MEVIS, Germany. All rights reserved.
2// **InsertLicense** code
3//----------------------------------------------------------------------------------
6
11//----------------------------------------------------------------------------------
12#pragma once
13
14// Local includes
19#include "mlDicomOverlayTools.h"
22
23// ML includes
24#include <mlModuleIncludes.h>
25
26// DICOM tree prototypes.
27#include <DCMTree_Lib.h>
28
29ML_START_NAMESPACE
30
31// Forwards
32class DicomMessageCollector;
33class ZTUFileNameSet;
34
35namespace DICOMTagTools{
36 struct DicomPaletteInfo;
37}
38
39struct ImageToMultiFileVolumeConversionParameters;
40
41//----------------------------------------------------------------------------------
44//----------------------------------------------------------------------------------
45namespace DicomToMLTools {
46
47 // Forward(s) to internally used classes.
48 class DCMTreeInfo;
49
59
91 const std::string &firstFileName,
92 PagedImage &resultImgProps,
93 FillPageMethods *fillPageMethod,
94 const ZTUFileNameSet *setOfFileHandles,
95 double defaultFillValue,
96 const ImageToMultiFileVolumeConversionParameters &conversionParameters,
97 const std::string &versionString,
98 DicomMessageCollector &dcmMsgCollector);
99
135 double &voxSizeX,
136 double &voxSizeY,
137 double &voxSizeZ,
138 bool replaceOnlyIfFound,
139 bool *isPrecise,
140 std::vector<DCMTree::RawTagId> *usedTags,
141 DicomMessageCollector &dcmMsgCollector);
142
155 PagedImage &pagedImage,
156 const bool adjustToLUTType=false);
157
172 const DICOMTagTools::DicomPaletteInfo &paletteInfo,
173 SubImage &outSubImg);
174
193 PagedImage &pagedImage);
194
222 const SubImage &inSubImg,
223 const double minVoxelValue,
224 const double maxVoxelValue,
225 SubImage &outSubImg);
226
264 const std::string &fileNameUTF8,
265 PagedImage &outInfos,
266 Vector4 &rotAxisAndRadians,
267 Vector3 &ipp,
268 Vector3 &relMRSPositionVector,
269 Vector3 &mrsPositionVector,
270 Vector3 &voiVector,
271 Vector3 &fovVector,
272 bool useOldWorldMatrixCalculation,
273 DicomMessageCollector &dcmMsgCollector);
274
281 const ImageVector &outImgExtent,
282 const DICOMTagTools::SpectComplex *mrsData,
283 size_t spectDataSizeInBytes);
284
290
299 PagedImage &outInfos,
300 DicomMessageCollector &dcmMsgCollector);
301
308 DicomMessageCollector &dcmMsgCollector);
309
323 size_t pixelDataSizeInBytes,
324 ImageVector &imgExt,
325 DicomMessageCollector &dcmMsgCollector);
326
343 ImageVector &imgExt,
344 std::vector<std::string> *cDimInfos,
345 bool overrideBadTagInfos,
346 DicomMessageCollector &dcmMsgCollector);
347
365 PagedImage &outInfos,
366 bool overrideBadTagInfos,
367 DicomMessageCollector &dcmMsgCollector);
368
383 size_t extent[3],
384 double voxelSize[3],
385 MLErrorCode &errCode,
386 DicomMessageCollector &dcmMsgCollector);
387
411 ImageVector &extent,
412 Vector3 &voxelSize,
413 SubImage *subImage,
414 MLErrorCode *errCode,
415 DicomMessageCollector &dcmMsgCollector);
416
427
441
444
446 extern MLDICOM_TO_ML_TOOLS_EXPORT const char * const OutputDataTypeSelectorsStrings[NumOutputDataTypeSelectors];
447
478 const MLDataType inVoxDataType,
479 const SubImageBox &volumeBox,
480 const double inDataRangeMin,
481 const double inDataRangeMax,
482 const OutputDataTypeSelector voxelTypeSelector,
483 const VoxelDoubleOperations operationMode,
484 const PositionSpecificDoubleVector &posDbls,
485 const VoxelDoubleOperations defaultOperationMode,
486 const double defaultOperationDouble,
487 double &resultRangeMin,
488 double &resultRangeMax);
489
492 DCMTreeInfo &dcmTreeInfo);
493
497};
498
499ML_END_NAMESPACE
Project global and OS specific declarations.
#define MLDICOM_TO_ML_TOOLS_EXPORT
DLL export macro definition.
Class to collect messages and errors related to a given frame handle.
Small container for statistical information about a DCMTree.
MLint32 MLDataType
Definition mlTypeDefs.h:595
MLint32 MLErrorCode
Type of an ML Error code.
Definition mlTypeDefs.h:715
A collection of tools related to spectroscopy DICOM tags.
Header file of tool functions for the extraction and handling of information of specific DICOM frames...
Tool class for the min/max value handling from and in DICOM frame sets.
Tool functions for the conversion of DICOM information to ML overlay images.
Collection of tool functions for copy operations from DICOM pixel data to ML SubImages.
boost::shared_ptr< const StructuredMF > Const_StructuredMFPtr
boost::shared_ptr< StructuredMF > StructuredMFPtr
boost::shared_ptr< const Tree > Const_TreePtr
Definition DCMTree_Lib.h:67
std::complex< float > SpectComplex
Define a complex data type to be used for spectroscopy data.
std::vector< PositionSpecificDouble > PositionSpecificDoubleVector
Often used std::vector type of PositionSpecificDouble elements.
FillPageMethods
Methods how to fill a page with data from the DICOM file or tree.
@ FILL_WITH_SPECTROSCOPY_DATA_TAG_DATA
Content of Spectroscopy data tag is copied.
@ FILL_DO_NOT_FILL
Do not fill at all.
@ FILL_WITH_DEFAULT_FILL_VAL
Page is filled with default value.
@ FILL_WITH_IMG_FILE_READER_WO_DICOM
Uses ImgFileReader to read and copy the file, suppress direct DICOM read.
@ FILL_WITH_PIXEL_DATA_TAG_DATA
Content of PixelData tag is copied.
@ FILL_WITH_IMG_FILE_READER
Uses only MFL ImgFileReader to read and copy files, allowing optimized DICOM read.
MLDICOM_TO_ML_TOOLS_EXPORT size_t getVoxelSize(DCMTree::Const_TreePtr treePtr, double &voxSizeX, double &voxSizeY, double &voxSizeZ, bool replaceOnlyIfFound, bool *isPrecise, std::vector< DCMTree::RawTagId > *usedTags, DicomMessageCollector &dcmMsgCollector)
MLDICOM_TO_ML_TOOLS_EXPORT bool isImageFrameNotOfBits(DCMTree::Const_TreePtr treePtr)
VoxelDoubleOperations
Defines some modes how a (voxel) value can be manipulated with a double value.
MLDICOM_TO_ML_TOOLS_EXPORT bool determineImageExtentsFromDCMTree(DCMTree::Const_TreePtr treePtr, ImageVector &imgExt, std::vector< std::string > *cDimInfos, bool overrideBadTagInfos, DicomMessageCollector &dcmMsgCollector)
MLDICOM_TO_ML_TOOLS_EXPORT void determineDCMTreeInfo(DCMTree::Const_TreePtr dcmTree, DCMTreeInfo &dcmTreeInfo)
Stores some statistical information from dcmTree in dcmTreeInfo.
MLDICOM_TO_ML_TOOLS_EXPORT MLDataType 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)
MLDICOM_TO_ML_TOOLS_EXPORT MLDataType getMLDataTypeFromDCMTree(DCMTree::Const_TreePtr treePtr, DicomMessageCollector &dcmMsgCollector)
MLDICOM_TO_ML_TOOLS_EXPORT bool applySubImageColorLookUp(const SubImage &inSubImg, const DICOMTagTools::DicomPaletteInfo &paletteInfo, SubImage &outSubImg)
MLDICOM_TO_ML_TOOLS_EXPORT bool hasValidNonImageModality(DCMTree::Const_TreePtr treePtr)
MLDICOM_TO_ML_TOOLS_EXPORT bool applyPhotometricInterpretationToSubImg(DCMTree::Const_TreePtr dcmTree, const SubImage &inSubImg, const double minVoxelValue, const double maxVoxelValue, SubImage &outSubImg)
MLDICOM_TO_ML_TOOLS_EXPORT void convertToImageProperties(DCMTree::StructuredMFPtr &baseSMFPtr, const std::string &firstFileName, PagedImage &resultImgProps, FillPageMethods *fillPageMethod, const ZTUFileNameSet *setOfFileHandles, double defaultFillValue, const ImageToMultiFileVolumeConversionParameters &conversionParameters, const std::string &versionString, DicomMessageCollector &dcmMsgCollector)
MLDICOM_TO_ML_TOOLS_EXPORT void getAnyDICOMImageProperties(DCMTree::Const_TreePtr treePtr, PagedImage &outInfos, bool overrideBadTagInfos, DicomMessageCollector &dcmMsgCollector)
MLDICOM_TO_ML_TOOLS_EXPORT void 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)
MLDICOM_TO_ML_TOOLS_EXPORT DCMTree::Const_StructuredMFPtr getSMFTreeFromPagedImage(const PagedImage &pImg)
MLDICOM_TO_ML_TOOLS_EXPORT bool applyPaletteInfosToPagedImage(const DICOMTagTools::DicomPaletteInfo &paletteInfos, PagedImage &pagedImage, const bool adjustToLUTType=false)
MLDICOM_TO_ML_TOOLS_EXPORT std::string determineREGProperties(DCMTree::Const_TreePtr treePtr, ImageVector &extent, Vector3 &voxelSize, SubImage *subImage, MLErrorCode *errCode, DicomMessageCollector &dcmMsgCollector)
OutputDataTypeSelector
Specifies whether the output voxel type shall be adopted when the data is scaled.
@ UseMLuint16
Always use MLuint16 as output type.
@ UseMLint8
Always use MLint8 as output type.
@ UseMLint16
Always use MLint16 as output type.
@ UseMLDouble
Always use double as output type.
@ UseMLuint32
Always use MLuint32 as output type.
@ UseMLint32
Always use MLint32 as output type.
@ Automatic
Adopts the data type such that range and precision is always maintained.
@ NoChange
Do not change the voxel type.
@ UseMLuint8
Always use MLuint8 as output type.
@ UseMLFloat
Always use float as output type.
MLDICOM_TO_ML_TOOLS_EXPORT bool applyPhotometricInterpretationChangesToPagedImage(const DCMTree::Const_TreePtr &dcmTree, PagedImage &pagedImage)
MLDICOM_TO_ML_TOOLS_EXPORT void checkAndCorrectImageExtentAccordingToPixelData(DCMTree::Const_TreePtr treePtr, size_t pixelDataSizeInBytes, ImageVector &imgExt, DicomMessageCollector &dcmMsgCollector)
MLDICOM_TO_ML_TOOLS_EXPORT bool copySpectData(SubImage &outSubImg, const ImageVector &outImgExtent, const DICOMTagTools::SpectComplex *mrsData, size_t spectDataSizeInBytes)
MLDICOM_TO_ML_TOOLS_EXPORT std::string determineBasicREGProperties(DCMTree::Const_TreePtr treePtr, size_t extent[3], double voxelSize[3], MLErrorCode &errCode, DicomMessageCollector &dcmMsgCollector)
MLDICOM_TO_ML_TOOLS_EXPORT void setWorldMatrixFromDcmTree(DCMTree::Const_TreePtr treePtr, PagedImage &outInfos, DicomMessageCollector &dcmMsgCollector)
Tvec4< MLdouble > Vector4
A vector with four components of type double.
Definition mlVector4.h:162
Tvec3< MLdouble > Vector3
A vector with three components of type double.
Definition mlVector3.h:286
TSubImageBox< MLint > SubImageBox
Defines the standard SubImageBox type used in the ML. Its size varies with the size of the MLint type...
TImageVector< MLint > ImageVector
Defines the standard ImageVector type that is used by the ML for indexing and coordinates.
DICOM palette container which is to be used for ML index image to RGB image voxel translation.
Container for all parameters needed to convert a DPL::Image to MultiFileVolume(s).