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
15#include <mlModuleIncludes.h>
16#include <DCMTree_Lib.h>
17
19
20// Forward of volume representation of DirectDicomImport module.
22class BitImage;
23
26namespace MLToDicomTools {
27
50 std::string *issueMessages=nullptr);
51
78 double *minVal=nullptr,
79 double *maxVal=nullptr,
80 const SubImageBox *overrideBox=nullptr);
81
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,
135 const std::vector<std::string> &cDimInfos=std::vector<std::string>());
136
144 const BitImage &inputBitImage);
145
146
155
156 // Forward to the internally used parameter container describing for
157 // example additional multiframe parameters.
159
198 Vector3 *srcImgPosPatient = nullptr,
199 Vector3 *dstImgPosPatient = nullptr,
200 std::string *errorMessage = nullptr,
203
217 const std::vector<std::string> &cDimInfos);
218
262 // TODO: Support DCMTree_FloatPixelData and DCMTree_DoubleFloatPixelData
301 bool adjustSliceWise,
304};
305
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 (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:
The class PagedImage, representing a fragmented image that manages properties and data of an image lo...
#define ML_INVALID_DATA_TYPE
Defines an invalid MLDataType.
Definition mlTypeDefs.h:613
MLint32 MLDataType
MLDataType.
Definition mlTypeDefs.h:596
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
MLint64 MLint
A signed ML integer type with at least 64 bits used for index calculations on very large images even ...
Definition mlTypeDefs.h:490
boost::shared_ptr< Tag > TagPtr
Shared pointer to tag.
Definition DCMTree_Lib.h:56
boost::shared_ptr< Tree > TreePtr
Shared pointer to a DCMTree::Tree.
Definition DCMTree_Lib.h:66
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 ...