MeVisLab Toolbox Reference
mlDicomSegmentItem.h
Go to the documentation of this file.
1 // Copyright (c) Fraunhofer MEVIS, Germany. All rights reserved.
2 // **InsertLicense** code
3 //----------------------------------------------------------------------------------
7 
12 //----------------------------------------------------------------------------------
13 
14 #pragma once
15 
16 #include "MLMLToDicomToolsSystem.h"
17 #include <mlModuleIncludes.h>
18 
19 ML_START_NAMESPACE
20 
21 // Forward to (in derived instances) internally generated or managed image instances.
22 class DicomSegmentItemImageBase;
23 
27  public:
28 
31  AUTOMATIC = 0,
33  MANUAL
34  };
35 
37  enum { NumberOfSegmentAlgorithmTypes = 3 };
38 
40  static const char * const SegmentAlgorithmTypeStrings[NumberOfSegmentAlgorithmTypes];
41 
44  DicomSegmentItem(unsigned int segNumber = 1u,
45  const std::string& segLabel = "",
46  const std::string& segDescription = "",
47  SegmentAlgorithmType segAlgorithmType = MANUAL,
48  const std::string& segAlgorithmName = "",
49  const Vector3& recommDisplayCIELabValue = Vector3(100.0, 0.0052605, -0.0104082),
50  const double segImageValueRangeMin = 0.999,
51  const double segImageValueRangeMax = ML_DOUBLE_MAX);
52 
54  virtual ~DicomSegmentItem();
55 
58  unsigned int segmentNumber;
59 
61  std::string segmentLabel;
62 
64  std::string segmentDescription;
65 
68 
70  std::string segmentAlgorithmName;
71 
74 
77 
80 
81  // TODO:
82  // - Segment Property Category Code Sequence
83  // - Code Sequence Baseline CID 7150 “Segmentation Property Categories”
84  // - Segment Property Type Code Sequence
85  // - Code Sequence Baseline CID 7151 “Segmentation Property Types”
86  // - Segment Property TZype Modifier Code Sequence
87  // - Code Sequence Baseline CID 244 “Laterality”
88 
90  std::string getAlgorithmTypeAsString() const;
91 
95 
97  std::string getAsBase64CodedString() const;
98 
101  static std::string getVersionNumber(const std::string& codedFirstLine);
102 
105  static size_t getNumCodedLinesPerItem(const std::string& codedFirstLine);
106 
108  void setFromBase64CodedString(const std::string& codedItem);
109 
116  static std::string setUpSegmentSequenceFromLines(std::vector<std::string>& inputLines,
117  std::vector<DicomSegmentItem>& resultItems);
118 
119 };
120 
123 typedef std::vector<DicomSegmentItem> DicomSegmentItemVector;
124 
125 ML_END_NAMESPACE
Project global and OS specific declarations.
#define ML_MLToDicomTools_EXPORT
Only for diagnostic purposes.
Pure virtual base class describing an abstract image type to be read/written as DICOM SEG image as it...
Class implementing a segmentation item according to the DICOM Segmentation Image Modul as described i...
static size_t getNumCodedLinesPerItem(const std::string &codedFirstLine)
Tries to determine the number of coded string lines per item from the from the first line of a coded ...
SegmentAlgorithmType
Types of algorithms how the segment was calculated, according to the DICOM standard.
@ SEMIAUTOMATIC
calculated segment with user assistance
DicomSegmentItem(unsigned int segNumber=1u, const std::string &segLabel="", const std::string &segDescription="", SegmentAlgorithmType segAlgorithmType=MANUAL, const std::string &segAlgorithmName="", const Vector3 &recommDisplayCIELabValue=Vector3(100.0, 0.0052605, -0.0104082), const double segImageValueRangeMin=0.999, const double segImageValueRangeMax=ML_DOUBLE_MAX)
Default constructor creating a dummy segment with number 1, empty label and description,...
static std::string setUpSegmentSequenceFromLines(std::vector< std::string > &inputLines, std::vector< DicomSegmentItem > &resultItems)
Tries to convert the coded string lines from inputLines to a valid list of DicomSegmentItems; an empt...
double segmentImageValueRangeMax
Upper border of range in which values are considered as part of the segment; not stored in DICOM file...
std::string segmentLabel
Label of the segment.
void setFromBase64CodedString(const std::string &codedItem)
Return the content of the item as a composition of Base64 coded strings.
SegmentAlgorithmType segmentAlgorithmType
Segment algorithm type (AUTOMATIC, SEMIAUTOMATIC, MANUAL), currently only MANUAL.
std::string getAsBase64CodedString() const
Return the content of the item as a composition of Base64 coded strings.
std::string getAlgorithmTypeAsString() const
Get algorithm type as string.
virtual ~DicomSegmentItem()
Virtual destructor.
Vector3 recommendedDisplayCIELabValue
Recommended Display CIELab value defining the color of the segment.
std::string segmentAlgorithmName
Name of the segmentation algorithm used to create the segment if segmentAlgorithmType is not MANUAL.
virtual const DicomSegmentItemImageBase * getSegmentItemImage()
Return a shared pointer to the image stored for this segment item; its type can be identified via get...
unsigned int segmentNumber
Number of the segment, must be >= 1 when added as tag; if 0 then number must be generated automatical...
static std::string getVersionNumber(const std::string &codedFirstLine)
Tries to determine the file version number from the first line of a coded item or item list and retur...
double segmentImageValueRangeMin
Lower border of range in which values are considered as part of the segment; not stored in DICOM file...
std::string segmentDescription
Description of the segment.
#define ML_DOUBLE_MAX
Definition: mlTypeDefs.h:226
std::vector< DicomSegmentItem > DicomSegmentItemVector
Type describing a sequence of SegmentItems similar to its description in the DICOM standard under SEG...
Tvec3< MLdouble > Vector3
A vector with 3 components of type double.
Definition: mlVector3.h:300