MeVisLab Toolbox Reference
ml::DicomSegmentItem Class Reference

Class implementing a segmentation item according to the DICOM Segmentation Image Modul as described in the DICOM standard under SEGMENTATION IMAGE MODULE ATTRIBUTES. More...

#include <mlDicomSegmentItem.h>

Public Types

enum  SegmentAlgorithmType { AUTOMATIC = 0 , SEMIAUTOMATIC , MANUAL }
 Types of algorithms how the segment was calculated, according to the DICOM standard. More...
 
enum  { NumberOfSegmentAlgorithmTypes = 3 }
 Number of available segmentation algorithm types. More...
 

Public Member Functions

 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, and MANUAL algorithm and a nearly white CIELabDefault value. More...
 
virtual ~DicomSegmentItem ()
 Virtual destructor. More...
 
std::string getAlgorithmTypeAsString () const
 Get algorithm type as string. More...
 
virtual const DicomSegmentItemImageBasegetSegmentItemImage ()
 Return a shared pointer to the image stored for this segment item; its type can be identified via getImageType() if pointer is not nullptr. More...
 
std::string getAsBase64CodedString () const
 Return the content of the item as a composition of Base64 coded strings. More...
 
void setFromBase64CodedString (const std::string &codedItem)
 Return the content of the item as a composition of Base64 coded strings. More...
 

Static Public Member Functions

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 returns the non empty version on success, otherwise an empty string. More...
 
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 item or item list and returns a non zero number of lines on success, otherwise 0 is returned. More...
 
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 empty inputLines vector will lead error free to an empty resultItems vector. More...
 

Public Attributes

unsigned int segmentNumber
 Number of the segment, must be >= 1 when added as tag; if 0 then number must be generated automatically when segment tags are added to DICOM tree. More...
 
std::string segmentLabel
 Label of the segment. More...
 
std::string segmentDescription
 Description of the segment. More...
 
SegmentAlgorithmType segmentAlgorithmType
 Segment algorithm type (AUTOMATIC, SEMIAUTOMATIC, MANUAL), currently only MANUAL. More...
 
std::string segmentAlgorithmName
 Name of the segmentation algorithm used to create the segment if segmentAlgorithmType is not MANUAL. More...
 
Vector3 recommendedDisplayCIELabValue
 Recommended Display CIELab value defining the color of the segment. More...
 
double segmentImageValueRangeMin
 Lower border of range in which values are considered as part of the segment; not stored in DICOM file. More...
 
double segmentImageValueRangeMax
 Upper border of range in which values are considered as part of the segment; not stored in DICOM file. More...
 

Static Public Attributes

static const char *const SegmentAlgorithmTypeStrings [NumberOfSegmentAlgorithmTypes]
 Strings corresponding to the SegmentAlgorithmType. More...
 

Detailed Description

Class implementing a segmentation item according to the DICOM Segmentation Image Modul as described in the DICOM standard under SEGMENTATION IMAGE MODULE ATTRIBUTES.

Definition at line 26 of file mlDicomSegmentItem.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

Number of available segmentation algorithm types.

Enumerator
NumberOfSegmentAlgorithmTypes 

Definition at line 37 of file mlDicomSegmentItem.h.

◆ SegmentAlgorithmType

Types of algorithms how the segment was calculated, according to the DICOM standard.

Enumerator
AUTOMATIC 

calculated segment

SEMIAUTOMATIC 

calculated segment with user assistance

MANUAL 

user-entered segment

Definition at line 30 of file mlDicomSegmentItem.h.

Constructor & Destructor Documentation

◆ DicomSegmentItem()

ml::DicomSegmentItem::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, and MANUAL algorithm and a nearly white CIELabDefault value.

◆ ~DicomSegmentItem()

virtual ml::DicomSegmentItem::~DicomSegmentItem ( )
virtual

Virtual destructor.

Member Function Documentation

◆ getAlgorithmTypeAsString()

std::string ml::DicomSegmentItem::getAlgorithmTypeAsString ( ) const

Get algorithm type as string.

◆ getAsBase64CodedString()

std::string ml::DicomSegmentItem::getAsBase64CodedString ( ) const

Return the content of the item as a composition of Base64 coded strings.

◆ getNumCodedLinesPerItem()

static size_t ml::DicomSegmentItem::getNumCodedLinesPerItem ( const std::string &  codedFirstLine)
static

Tries to determine the number of coded string lines per item from the from the first line of a coded item or item list and returns a non zero number of lines on success, otherwise 0 is returned.

◆ getSegmentItemImage()

virtual const DicomSegmentItemImageBase* ml::DicomSegmentItem::getSegmentItemImage ( )
virtual

Return a shared pointer to the image stored for this segment item; its type can be identified via getImageType() if pointer is not nullptr.

◆ getVersionNumber()

static std::string ml::DicomSegmentItem::getVersionNumber ( const std::string &  codedFirstLine)
static

Tries to determine the file version number from the first line of a coded item or item list and returns the non empty version on success, otherwise an empty string.

◆ setFromBase64CodedString()

void ml::DicomSegmentItem::setFromBase64CodedString ( const std::string &  codedItem)

Return the content of the item as a composition of Base64 coded strings.

◆ setUpSegmentSequenceFromLines()

static std::string ml::DicomSegmentItem::setUpSegmentSequenceFromLines ( std::vector< std::string > &  inputLines,
std::vector< DicomSegmentItem > &  resultItems 
)
static

Tries to convert the coded string lines from inputLines to a valid list of DicomSegmentItems; an empty inputLines vector will lead error free to an empty resultItems vector.

Parameters
inputLinesThe string lines containing coded Dicom Segement Items.
resultItemsThe vector of decoded DicomSegmentItems on successful conversion or empty otherwise.
Returns
An empty string on successful conversion or a descriptive error string otherwise. If not empty then resultItem will be empty.

Member Data Documentation

◆ recommendedDisplayCIELabValue

Vector3 ml::DicomSegmentItem::recommendedDisplayCIELabValue

Recommended Display CIELab value defining the color of the segment.

Definition at line 73 of file mlDicomSegmentItem.h.

◆ segmentAlgorithmName

std::string ml::DicomSegmentItem::segmentAlgorithmName

Name of the segmentation algorithm used to create the segment if segmentAlgorithmType is not MANUAL.

Definition at line 70 of file mlDicomSegmentItem.h.

◆ segmentAlgorithmType

SegmentAlgorithmType ml::DicomSegmentItem::segmentAlgorithmType

Segment algorithm type (AUTOMATIC, SEMIAUTOMATIC, MANUAL), currently only MANUAL.

Definition at line 67 of file mlDicomSegmentItem.h.

◆ SegmentAlgorithmTypeStrings

const char* const ml::DicomSegmentItem::SegmentAlgorithmTypeStrings[NumberOfSegmentAlgorithmTypes]
static

Strings corresponding to the SegmentAlgorithmType.

Definition at line 40 of file mlDicomSegmentItem.h.

◆ segmentDescription

std::string ml::DicomSegmentItem::segmentDescription

Description of the segment.

Definition at line 64 of file mlDicomSegmentItem.h.

◆ segmentImageValueRangeMax

double ml::DicomSegmentItem::segmentImageValueRangeMax

Upper border of range in which values are considered as part of the segment; not stored in DICOM file.

Definition at line 79 of file mlDicomSegmentItem.h.

◆ segmentImageValueRangeMin

double ml::DicomSegmentItem::segmentImageValueRangeMin

Lower border of range in which values are considered as part of the segment; not stored in DICOM file.

Definition at line 76 of file mlDicomSegmentItem.h.

◆ segmentLabel

std::string ml::DicomSegmentItem::segmentLabel

Label of the segment.

Definition at line 61 of file mlDicomSegmentItem.h.

◆ segmentNumber

unsigned int ml::DicomSegmentItem::segmentNumber

Number of the segment, must be >= 1 when added as tag; if 0 then number must be generated automatically when segment tags are added to DICOM tree.

Definition at line 58 of file mlDicomSegmentItem.h.


The documentation for this class was generated from the following file: