MeVisLab Toolbox Reference
Loading...
Searching...
No Matches
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
17#include <mlModuleIncludes.h>
18
20
21// Forward to (in derived instances) internally generated or managed image instances.
22class 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 = "",
48 const std::string& segAlgorithmName = "",
49 const Vector3& recommDisplayCIELabValue = Vector3(100.0, 0.0052605, -0.0104082),
50 const double segImageValueRangeMin = 0.999,
52
55
58
61
64 unsigned int segmentNumber;
65
67 std::string segmentLabel;
68
70 std::string segmentDescription;
71
74
77
80
83
86
87 // TODO:
88 // - Segment Property Category Code Sequence
89 // - Code Sequence Baseline CID 7150 “Segmentation Property Categories”
90 // - Segment Property Type Code Sequence
91 // - Code Sequence Baseline CID 7151 “Segmentation Property Types”
92 // - Segment Property TZype Modifier Code Sequence
93 // - Code Sequence Baseline CID 244 “Laterality”
94
96 std::string getAlgorithmTypeAsString() const;
97
101
103 std::string getAsBase64CodedString() const;
104
107 static std::string getVersionNumber(const std::string& codedFirstLine);
108
111 static size_t getNumCodedLinesPerItem(const std::string& codedFirstLine);
112
114 void setFromBase64CodedString(const std::string& codedItem);
115
122 static std::string setUpSegmentSequenceFromLines(std::vector<std::string>& inputLines,
123 std::vector<DicomSegmentItem>& resultItems);
124
125};
126
129typedef std::vector<DicomSegmentItem> DicomSegmentItemVector;
130
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...
DicomSegmentItem & operator=(const DicomSegmentItem &)=default
Default assignment operator.
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.
DicomSegmentItem(const DicomSegmentItem &)=default
Default copy constructor.
std::string getAsBase64CodedString() const
Return the content of the item as a composition of Base64 coded strings.
virtual const DicomSegmentItemImageBase * getSegmentItemImage()
Return a shared pointer to the image stored for this segment item; its type can be identified via get...
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.
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.
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
#define ML_DOUBLE_MAX
Definition mlTypeDefs.h:220
std::vector< DicomSegmentItem > DicomSegmentItemVector
Type describing a sequence of SegmentItems similar to its description in the DICOM standard under SEG...