MeVisLab Toolbox Reference
mlDicomFrameSelectionTools.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 "MLDicomToMLToolsSystem.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 
28 namespace DicomToMLTools {
29 
32  Copy = 0,
33  Add,
34  Multiply
35  };
36 
38  enum {
40  };
41 
44 
49  inline FrameSpecificTags(MLint z=0, MLint t=0, MLint u=0):
50  zPosition(z), tPosition(t), uPosition(u), tagMap() {}
51 
54 
57 
60 
63  std::map<DCMTree::RawTagId, DCMTree::Const_TagPtr> tagMap;
64  };
65 
67  typedef std::vector< FrameSpecificTags > FrameSpecificTagsVector;
68 
72  inline PositionSpecificDouble(MLint z=0, MLint t=0, MLint u=0, MLdouble v=0.):
73  zPosition(z), tPosition(t), uPosition(u), doubleVal(v) {}
74 
77 
80 
83 
86  };
87 
89  typedef std::vector< PositionSpecificDouble > PositionSpecificDoubleVector;
90 
99  // any tagId could be found then tagPtr is non nullptr, otherwise nullptr for that frame.
101  const std::vector<DCMTree::RawTagId> &tagIds);
102 
110  // tagId could be found then tagPtr is non nullptr, otherwise nullptr for that frame.
112  DCMTree::RawTagId tagId);
113 
126  PositionSpecificDoubleVector &frameSpecificDoubles);
127 
155  const SubImage &srcSubImage,
156  SubImage &dstSubImage,
157  const PositionSpecificDoubleVector &positionDoubles,
158  const VoxelDoubleOperations dummyOperationMode = Copy,
159  const MLdouble dummyOperationValue = 0.0,
160  PositionSpecificDoubleVector *valueFreePositions = nullptr,
161  bool isOldMultiFrameDICOM = false);
162 
166  MLint z, MLint t, MLint u);
167 
171  const SubImageBox &volume);
172 
178  double &rangeMin,
179  double &rangeMax,
180  bool &hasFractionalParts);
181 
182 };
183 
184 ML_END_NAMESPACE
Project global and OS specific declarations.
#define MLDICOM_TO_ML_TOOLS_EXPORT
DLL export macro definition.
This class manages/represents a rectangular 6d image region which is organized linearly in memory.
Definition: mlSubImage.h:75
double MLdouble
Definition: mlTypeDefs.h:223
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< const StructuredMF > Const_StructuredMFPtr
Definition: DCMTree_Lib.h:170
unsigned int RawTagId
Definition: DCMTree_Lib.h:147
std::vector< FrameSpecificTags > FrameSpecificTagsVector
Often used std::vector type of FrameSpecificTag elements.
MLDICOM_TO_ML_TOOLS_EXPORT bool isVolumeCovered(const PositionSpecificDoubleVector &positions, const SubImageBox &volume)
Returns true if the (z,t,u) positions in positions cover all (z,t,u) slices in volume,...
MLDICOM_TO_ML_TOOLS_EXPORT FrameSpecificTagsVector getFrameSpecificTags(const DCMTree::Const_StructuredMFPtr &smfTree, DCMTree::RawTagId tagId)
Returns an entry for each frame in which a tag with id tagId can be found and store the corresponding...
std::vector< PositionSpecificDouble > PositionSpecificDoubleVector
Often used std::vector type of PositionSpecificDouble elements.
MLDICOM_TO_ML_TOOLS_EXPORT const char *const VoxelDoubleOperationsStrings[NumberOfVoxelDoubleOperations]
Strings according to VoxelDoubleOperations.
VoxelDoubleOperations
Defines some modes how a (voxel) value can be manipulated with a double value.
@ Copy
Copy the input value to output without modification.
@ Add
Copy the sum of the input value and the double to output.
@ Multiply
Copy the product of the input value and the double to output.
MLDICOM_TO_ML_TOOLS_EXPORT bool getPositionSpecificDoubleProperties(const PositionSpecificDoubleVector &positions, double &rangeMin, double &rangeMax, bool &hasFractionalParts)
Returns some properties of the double values in valuePositions, the minimum / maximum range,...
MLDICOM_TO_ML_TOOLS_EXPORT const FrameSpecificTags * getFrameSpecificTagsSet(const FrameSpecificTagsVector &tagSet, MLint z, MLint t, MLint u)
Returns pointer to the first occurrence of a FrameSpecificTags entry which has the given z,...
MLDICOM_TO_ML_TOOLS_EXPORT bool applyFrameSpecificOperation(const VoxelDoubleOperations &operationMode, const SubImage &srcSubImage, SubImage &dstSubImage, const PositionSpecificDoubleVector &positionDoubles, const VoxelDoubleOperations dummyOperationMode=Copy, const MLdouble dummyOperationValue=0.0, PositionSpecificDoubleVector *valueFreePositions=nullptr, bool isOldMultiFrameDICOM=false)
Copy voxels from overlapping regions of srcSubImage to dstSubImage and apply the operationMode if f...
MLDICOM_TO_ML_TOOLS_EXPORT FrameSpecificTagsVector getFrameSpecificTagSet(const DCMTree::Const_StructuredMFPtr &smfTree, const std::vector< DCMTree::RawTagId > &tagIds)
Returns an entry for each frame and each tag id from tagIds in which any tagId can be found and store...
MLDICOM_TO_ML_TOOLS_EXPORT size_t convertToFrameSpecificDoubles(const FrameSpecificTagsVector &frameSpecificTags, PositionSpecificDoubleVector &frameSpecificDoubles)
Converts first entries of each entries in FrameSpecificTagsVector to a PositionSpecificDoubleVector o...
Helper structure to store a z, t, u position of a frame in a structured multi-frame tree,...
FrameSpecificTags(MLint z=0, MLint t=0, MLint u=0)
Default and convenience constructor.
MLint tPosition
Temporal position of the frame.
MLint uPosition
U-Dimension position of the frame.
std::map< DCMTree::RawTagId, DCMTree::Const_TagPtr > tagMap
Storage for found pointers (does not use DCMTree::Tree because it supports no addition of constant ta...
MLint zPosition
Spatial position of the frame.
Helper structure to store a z, t, u position with an associated double value.
MLint tPosition
Temporal position of the frame.
PositionSpecificDouble(MLint z=0, MLint t=0, MLint u=0, MLdouble v=0.)
Default and convenience constructor.
MLint uPosition
U-Dimension position of the frame.
MLdouble doubleVal
Pointer to a tag from that frame.
MLint zPosition
Spatial position of the frame.