MeVisLab Toolbox Reference
mlMLToDicomTools.h
Go to the documentation of this file.
1 // Copyright (c) Fraunhofer MEVIS, Germany. All rights reserved.
2 // **InsertLicense** code
3 //----------------------------------------------------------------------------------
5 
10 //----------------------------------------------------------------------------------
11 
12 #pragma once
13 
14 #include "MLMLToDicomToolsSystem.h"
15 #include <mlModuleIncludes.h>
16 #include <DCMTree_Lib.h>
17 
18 ML_START_NAMESPACE
19 
20 // Forward of volume representation of DirectDicomImport module.
21 class _DicomDateTimeTagIds;
22 class BitImage;
23 
26 namespace MLToDicomTools {
27 
47  Vector3 &pixelSpacing,
48  Vector3 &imagePositionPatient,
49  Vector6 &imageOrientationPatient,
50  std::string *issueMessages=nullptr);
51 
76  PagedImage &inImg,
77  MLDataType overrideDataType=ML_INVALID_DATA_TYPE,
78  double *minVal=nullptr,
79  double *maxVal=nullptr,
80  const SubImageBox *overrideBox=nullptr);
81 
98  PagedImage &inImg);
99 
110  const BitImage &bitImage,
111  bool writePadded);
112 
121  unsigned int samplesPerPixel,
122  const std::string &photometricInterpretation,
123  unsigned int rows,
124  unsigned int columns,
125  unsigned int bitsAllocated,
126  unsigned int bitsStored,
127  unsigned int highBit,
128  unsigned int pixelRepresentation,
129  bool writePlanarConfiguration=false,
130  unsigned int planarConfiguration=0,
131  bool writeMinMaxPixelValue=false,
132  double smallestPixelValue=0,
133  double largestPixelValue=0,
134  MLint numberOfColorChannels=0,
135  const std::vector<std::string> &cDimInfos=std::vector<std::string>());
136 
144  const BitImage &inputBitImage);
145 
146 
154  const PagedImage &inputBitImage);
155 
156  // Forward to the internally used parameter container describing for
157  // example additional multiframe parameters.
158  class AdvancedTagSetUpArgs;
159 
196  const FieldContainer *treeInfos,
197  PagedImage &inImg,
198  Vector3 *srcImgPosPatient = nullptr,
199  Vector3 *dstImgPosPatient = nullptr,
200  std::string *errorMessage = nullptr,
201  bool useFullTUDimExtentFromInImgInSliceWiseUpdate=false,
202  AdvancedTagSetUpArgs *configParams = nullptr);
203 
216  MLint numColorChannels,
217  const std::vector<std::string> &cDimInfos);
218 
262  // TODO: Support DCMTree_FloatPixelData and DCMTree_DoubleFloatPixelData
299  const FieldContainer *treeInfos,
300  PagedImage &inImg,
301  bool adjustSliceWise,
302  bool reportNonOrthoWorldMatrix,
303  AdvancedTagSetUpArgs *configParams=nullptr);
304 };
305 
306 ML_END_NAMESPACE
Project global and OS specific declarations.
#define ML_MLToDicomTools_EXPORT
Only for diagnostic purposes.
Class to manage a binary image.
Definition: mlBitImage.h:67
Defines the class FieldContainer to encapsulate a vector of fields for (see class Field).
Some dedicated parameters for advanced tag setups when setting pixel data and related tags in DICOM f...
This class encapsulates basic medical image properties:
Class which represents an image, which manages properties of an image and image data which is located...
Definition: mlPagedImage.h:70
#define ML_INVALID_DATA_TYPE
Defines an invalid MLDataType.
Definition: mlTypeDefs.h:715
MLint32 MLDataType
MLDataType.
Definition: mlTypeDefs.h:684
MLint64 MLint
A signed ML integer type with at least 64 bits used for index calculations on very large images even ...
Definition: mlTypeDefs.h:578
boost::shared_ptr< Tag > TagPtr
shared-pointer to tag
Definition: DCMTree_Lib.h:59
boost::shared_ptr< Tree > TreePtr
shared pointer to a DCMTree::Tree
Definition: DCMTree_Lib.h:70
ML_MLToDicomTools_EXPORT SubImageBox determineFrameRegion(DCMTree::TreePtr dcmTree, const FieldContainer *treeInfos, PagedImage &inImg, Vector3 *srcImgPosPatient=nullptr, Vector3 *dstImgPosPatient=nullptr, std::string *errorMessage=nullptr, bool useFullTUDimExtentFromInImgInSliceWiseUpdate=false, AdvancedTagSetUpArgs *configParams=nullptr)
If possible then determine and return the region in inImg which corresponds to the region the dcmTree...
ML_MLToDicomTools_EXPORT void setVectorGridData(DCMTree::TagPtr vecGridDataTag, PagedImage &inImg)
Gets a floating point vector field with getTile from inImg and sets it as OF value of the vecGridData...
ML_MLToDicomTools_EXPORT std::string appendImagePixelModuleTags(DCMTree::TreePtr resultTree, unsigned int samplesPerPixel, const std::string &photometricInterpretation, unsigned int rows, unsigned int columns, unsigned int bitsAllocated, unsigned int bitsStored, unsigned int highBit, unsigned int pixelRepresentation, bool writePlanarConfiguration=false, unsigned int planarConfiguration=0, bool writeMinMaxPixelValue=false, double smallestPixelValue=0, double largestPixelValue=0, MLint numberOfColorChannels=0, const std::vector< std::string > &cDimInfos=std::vector< std::string >())
Appends required DICOM tags to resultTree according to DICOM standard, C.7.6.3 Image Pixel Module Att...
ML_MLToDicomTools_EXPORT std::string setSegmentationBinaryImagePixelTags(DCMTree::TreePtr &dcmTree, const BitImage &inputBitImage)
Set Image Pixel / Segmentation Image Module Attribute tags for a binary segmentation image using setI...
ML_MLToDicomTools_EXPORT void setPixelData(DCMTree::TagPtr pixelDataTag, PagedImage &inImg, MLDataType overrideDataType=ML_INVALID_DATA_TYPE, double *minVal=nullptr, double *maxVal=nullptr, const SubImageBox *overrideBox=nullptr)
Gets an input image as pixel data with getTile from inImg and sets it as value of pixelDataTag.
ML_MLToDicomTools_EXPORT void getSpacingImagePositionAndOrientationPatientFromMLWorldMatrix(MedicalImageProperties imgProps, Vector3 &pixelSpacing, Vector3 &imagePositionPatient, Vector6 &imageOrientationPatient, std::string *issueMessages=nullptr)
Gets DICOM compliant values for tags Pixel Spacing, Image Position Patient, and Image Orientation Pat...
ML_MLToDicomTools_EXPORT std::string setSegmentationFractionalImagePixelTags(DCMTree::TreePtr &dcmTree, const PagedImage &inputBitImage)
Set Image Pixel / Segmentation Image Module Attribute tags for a fractional segmentation image using ...
ML_MLToDicomTools_EXPORT bool setUpPhotometricInterpretation(DCMTree::TreePtr dcmTree, MLint numColorChannels, const std::vector< std::string > &cDimInfos)
Evaluates the number of color channels and the cDimInfos of the input image, checks for valid setting...
ML_MLToDicomTools_EXPORT std::string setImagePixelTags(DCMTree::TreePtr dcmTree, const FieldContainer *treeInfos, PagedImage &inImg, bool adjustSliceWise, bool reportNonOrthoWorldMatrix, AdvancedTagSetUpArgs *configParams=nullptr)
Gets the input image and its properties, checks whether it is DICOM-like and if yes it sets image pix...
ML_MLToDicomTools_EXPORT std::string addAndSetSEGPixelDataTag(DCMTree::TreePtr dcmTree, const BitImage &bitImage, bool writePadded)
Stores the bit mask given by BitImage in newly created PixelData tag in dcmTree; it does not set any ...