MeVisLab Toolbox Reference
mlApplyDicomPixelModifiers.h
Go to the documentation of this file.
1 // Copyright (c) Fraunhofer MEVIS, Germany. All rights reserved.
2 // **InsertLicense** code
3 //----------------------------------------------------------------------------------
7 
12 //----------------------------------------------------------------------------------
13 #pragma once
14 
15 // Local includes
16 #include "MLDicomModifySystem.h"
17 
18 // ML basics.
19 #include <mlModuleIncludes.h>
20 
21 // General DICOM tag access and conversion tools.
22 #include <mlDicomToMLTools.h>
23 #include <mlDICOMTagPaletteTools.h>
24 
25 // Include transfer function and look up table class headers.
26 #include "mlLUTFLinear.h"
27 
28 ML_START_NAMESPACE
29 
30 //----------------------------------------------------------------------------------
34 //----------------------------------------------------------------------------------
36 {
37 public:
38 
41 
42 protected:
43 
45  void activateAttachments() override;
46 
48  void handleNotification(Field *field) override;
49 
51  void calculateOutputImageProperties (int outIndex, PagedImage* outImg) override;
52 
54  SubImageBox calculateInputSubImageBox(int inIdx, const SubImageBox &outBox, int outIdx) override;
55 
57  void calculateOutputSubImage(SubImage *outSubImg, int outIdx, SubImage *inSubImgs) override;
58 
59 private:
60 
61  //-----------------------------------------------------------------------
62  // Color model conversions according to PhotometricInterpretation tags:
63  //-----------------------------------------------------------------------
68  BoolField *_applyPaletteInformationFld;
69 
75  BoolField *_useBestColorTypeFld;
76 
78  DICOMTagTools::DicomPaletteInfo _intensityToRGBALUT;
79 
83  BoolField *_applyPhotometricInterpretationFld;
84 
86  DCMTree::Const_TreePtr _dcmTree;
87 
89  bool _hasAtMostOneGridEntry;
90 
92  DCMTree::TreePtr _outputDCMTree;
93 
95  void _updateLUTOutput();
96 
98  BaseField *_outputLUTFld;
99 
102  LUTFLinear _outLUT;
103 
104 
105  //-----------------------------------------------------------------------
106  // RTDose: Frame specific DoseGridScaling tags.
107  //-----------------------------------------------------------------------
108 
111  bool _setUpRTDoseProperties(PagedImage &outImg);
112 
115  BoolField *_applyDoseGridScalingFld;
116 
119 
121  EnumField *_rtDoseOutputDataTypeSelectorFld;
122 
123  //-----------------------------------------------------------------------
124  // DICOM Rescale / Intercept
125  //-----------------------------------------------------------------------
126 
129  bool _setUpRescaleProperties(PagedImage &outImg);
130 
133  BoolField *_applyRescaleFld;
134 
137 
140 
142  EnumField *_rescaleOutputDataTypeSelectorFld;
143 
144 
145  //-----------------------------------------------------------------------
146  // Overlay frames
147  //-----------------------------------------------------------------------
148 
151 
152  //-----------------------------------------------------------------------
153  // Tag tree adaption
154  //-----------------------------------------------------------------------
161  virtual void adaptDCMTreeTags(DCMTree::TagId tagId,
162  const std::string &newVal);
163 
165  BoolField *_adaptTagsFld;
166 
169 
170 };
171 
172 ML_END_NAMESPACE
Project global and OS specific declarations.
#define ML_DICOM_MODIFY_EXPORT
DLL export macro definition.
Class to wrap a tag-id.
Definition: DCMTree_TagId.h:40
ML module class ApplyDicomPixelModifiers which provides the modification of an ML image according to ...
void calculateOutputImageProperties(int outIndex, PagedImage *outImg) override
Sets properties of the output image at output outIndex.
void handleNotification(Field *field) override
Handles field changes.
SubImageBox calculateInputSubImageBox(int inIdx, const SubImageBox &outBox, int outIdx) override
Determines box required from the input image for a specific output image.
ApplyDicomPixelModifiers()
Constructor:
void activateAttachments() override
Update field dependent content after restoring fields without notifications.
void calculateOutputSubImage(SubImage *outSubImg, int outIdx, SubImage *inSubImgs) override
Page calculation for the output image.
Field to encapsulate a pointer to an ML base object.
Definition: mlFields.h:1187
Field to encapsulate a boolean value.
Definition: mlFields.h:62
Field to encapsulate an enumerated value.
Definition: mlFields.h:363
Base class for all fields used in the ML.
Definition: mlField.h:73
A color/gray LUT with sampling points and linear, nearest neighbor or truncated interpolation inbetwe...
Definition: mlLUTFLinear.h:115
Base class for an image processing module of the ML.
Definition: mlModule.h:156
Class which represents an image, which manages properties of an image and image data which is located...
Definition: mlPagedImage.h:70
This class manages/represents a rectangular 6d image region which is organized linearly in memory.
Definition: mlSubImage.h:75
#define ML_MODULE_CLASS_HEADER(className)
Like ML_CLASS_HEADER for the usage of derived classes from Module.
A collection of tools related to DICOM palette tags.
Tool class with many tool functions for the conversion of DICOM information and tag values to compara...
boost::shared_ptr< const Tree > Const_TreePtr
Definition: DCMTree_Lib.h:73
boost::shared_ptr< Tree > TreePtr
shared pointer to a DCMTree::Tree
Definition: DCMTree_Lib.h:70
std::vector< FrameSpecificTags > FrameSpecificTagsVector
Often used std::vector type of FrameSpecificTag elements.
std::vector< PositionSpecificDouble > PositionSpecificDoubleVector
Often used std::vector type of PositionSpecificDouble elements.
DICOM palette container which is to be used for ML index image to RGB image voxel translation.