DCMTK  Version 3.6.1 20170228
OFFIS DICOM Toolkit
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
DcmSegmentation Class Reference

Class representing an object of the "Segmentation SOP Class". More...

+ Inheritance diagram for DcmSegmentation:

Public Member Functions

virtual ~DcmSegmentation ()
 Destructor, frees memory.
 
OFCondition saveFile (const OFString &filename, const E_TransferSyntax writeXfer=EXS_LittleEndianExplicit)
 Save current object to given filename. More...
 
OFCondition writeDataset (DcmItem &dataset)
 Write current object to given item. More...
 
size_t getNumberOfFrames ()
 Get number of frames, based on the number of items in the shared functional functional groups sequence (i.e. the attribute Number of Frames) is not trusted). More...
 
DcmSegTypes::E_SegmentationType getSegmentationType ()
 Get Segmentation Type. More...
 
DcmSegTypes::E_SegmentationFractionalType getSegmentationFractionalType ()
 Get Fractional Segmentation Type. More...
 
size_t getNumberOfSegments ()
 Get the Number of Segments. More...
 
virtual OFBool check ()
 Perform some basic checking. More...
 
virtual FGInterfacegetFunctionalGroups ()
 Get access to functional groups. More...
 
virtual IODGeneralEquipmentModulegetEquipment ()
 Get General Equipment Module. More...
 
virtual
IODSegmentationSeriesModule
getSegmentationSeriesModule ()
 Get Segmentation Series Module. More...
 
virtual OFCondition getModality (OFString &value, const signed long pos=0) const
 Get modality (overwrite from DcmIODCommon. More...
 
virtual DcmSegmentgetSegment (const unsigned int segmentNumber)
 Get segment by providing the logical segment number. More...
 
virtual OFBool getSegmentNumber (const DcmSegment *segment, unsigned int &segmentNumber)
 Get logical segment number by providing a pointer to a given segment. More...
 
virtual SOPInstanceReferenceMacrogetReferencedPPS ()
 Reference to the Performed Procedure Step that led to the creation of this segmentation object. More...
 
virtual const DcmIODTypes::FramegetFrame (const size_t &frameNo)
 Get (const) frame data of a specific frame. More...
 
virtual void getFramesForSegment (const size_t &segmentNumber, OFVector< size_t > &frameNumbers)
 Get the frame numbers that belong to a specific segment number. More...
 
virtual OFCondition addSegment (DcmSegment *seg, Uint16 &segmentNumber)
 Add segment to segmentation object. More...
 
virtual OFCondition addForAllFrames (const FGBase &group)
 Add a functional group for all frames. More...
 
virtual OFCondition addFrame (Uint8 *pixData, const Uint16 segmentNumber, const OFVector< FGBase * > &perFrameInformation)
 Add frame to segmentation object. More...
 
virtual
ContentIdentificationMacro
getContentIdentification ()
 Return reference to content content identification of this segmentation object. More...
 
virtual
IODMultiframeDimensionModule
getDimensions ()
 Return reference to multi-fame dimension module. More...
 
virtual OFCondition setLossyImageCompressionFlag (const OFString &ratios, const OFString &methods, const OFBool checkValues=OFTrue)
 Set lossy compression flag of the segmentation object to "01". More...
 
virtual OFCondition setEquipmentInfo (const IODGeneralEquipmentModule::EquipmentInfo &equipmentInfo, const OFBool checkValue=OFTrue)
 Set equipment info for this segmentation object. More...
 
virtual OFCondition setContentIdentification (const ContentIdentificationMacro &contentIdentification, const OFBool checkValue=OFTrue)
 Set content identification info for this segmentation object. More...
 
- Public Member Functions inherited from DcmIODImage< IODImagePixelModule< Uint8 > >
 DcmIODImage ()
 Constructor, creates new DcmIODImage instance with integer-based pixel data.
 
 DcmIODImage (OFin_place_type_t(ImagePixel))
 Constructor, constructs new DcmIODImage instance with integer, float or double based Image Pixel Module (i. More...
 
virtual ~DcmIODImage ()
 Virtual Destructor.
 
IODGeneralImageModulegetGeneralImage ()
 Get General Image Module. More...
 
IODImagePixelModuleTypegetImagePixel ()
 Get Image Pixel Module (variant) More...
 
- Public Member Functions inherited from DcmIODCommon
 DcmIODCommon ()
 Constructor.
 
 DcmIODCommon (const DcmIODCommon &rhs)
 Copy Constructor. More...
 
OFshared_ptr< IODRulesgetRules ()
 Get rules handled by this IOD. More...
 
OFshared_ptr< DcmItemgetData ()
 Get item managed by this IOD. More...
 
IODPatientModulegetPatient ()
 Get Patient Module. More...
 
IODPatientStudyModulegetPatientStudy ()
 Get Patient Study Module. More...
 
IODGeneralStudyModulegetStudy ()
 Get General Study Module. More...
 
IODGeneralEquipmentModulegetEquipment ()
 Get General Equipment Module. More...
 
IODGeneralSeriesModulegetSeries ()
 Get Series Module. More...
 
IODFoRModulegetFrameOfReference ()
 Get Frame of Reference Module. More...
 
IODSOPCommonModulegetSOPCommon ()
 Get SOP Common Module. More...
 
IODCommonInstanceReferenceModulegetCommonInstanceReference ()
 Get Common Instance Reference Module. More...
 
virtual ~DcmIODCommon ()
 Destructor.
 
virtual void createNewStudy (const OFBool clearEquipment=OFTrue)
 Create new study. More...
 
virtual void createNewSeries (const OFBool clearFoR=OFTrue)
 Create a new series. More...
 
virtual void createNewSOPInstance ()
 Create a new SOP instance. More...
 
virtual void ensureInstanceUIDs (const OFBool correctInvalid=OFFalse)
 Make sure that the IOD contains a SOP Instance, Series Instance and Study Instance UID. More...
 
virtual OFCondition import (DcmItem &dataset, OFBool readPatient, OFBool readStudy, OFBool readFoR=OFFalse, OFBool readSeries=OFFalse)
 Import common module attributes from dataset but only read Patient, Study, Series and/or Frame of Reference level portions. More...
 
OFCondition importPatientStudyFoR (const OFString &filename, const OFBool usePatient, const OFBool useStudy, const OFBool useSeries, const OFBool useFoR=OFFalse)
 Import common module attributes from DICOM file but only read Patient, Study, Series and/or Frame of Reference level portions. More...
 
virtual OFCondition import (const OFString &filename, const OFBool usePatient, const OFBool useStudy, const OFBool useSeries, const OFBool useFoR=OFFalse)
 Import common module attributes from DICOM file but only read Patient, Study, Series and/or Frame of Reference level portions. More...
 

Static Public Member Functions

static OFCondition loadFile (const OFString &filename, DcmSegmentation *&segmentation)
 Static method to load a Segmentation object from a file. More...
 
static OFCondition loadDataset (DcmDataset &dataset, DcmSegmentation *&segmentation)
 Static method to load a Segmentation object from a dataset object. More...
 
static OFCondition createBinarySegmentation (DcmSegmentation *&segmentation, const Uint16 rows, const Uint16 columns, const IODGeneralEquipmentModule::EquipmentInfo &equipmentInfo, const ContentIdentificationMacro &contentIdentification)
 Factory method to create a binary segmentation object from the minimal set of information required. More...
 
static OFCondition createFractionalSegmentation (DcmSegmentation *&segmentation, const Uint16 rows, const Uint16 columns, const DcmSegTypes::E_SegmentationFractionalType fractType, const Uint16 &maxFractionalValue, const IODGeneralEquipmentModule::EquipmentInfo &equipmentInfo, const ContentIdentificationMacro &contentIdentification)
 Factory method to create a fractional segmentation object from the minimal set of information required. More...
 
static FGDerivationImagecreateDerivationImageFG (const OFVector< ImageSOPInstanceReferenceMacro > &derivationImages, const OFString &derivationDescription)
 Helps to create a valid Derivation Image Functional Group Macro The memory of the resulting functional group object has to be freed by the caller. More...
 

Protected Member Functions

 DcmSegmentation ()
 Protected default constructor. More...
 
OFCondition read (DcmItem &dataset)
 Overwrites DcmIODImage::read() More...
 
OFCondition write (DcmItem &dataset)
 Overwrites DcmIODImage::write() More...
 
virtual IODImagePixelModule
< Uint8 > & 
getImagePixel ()
 Hide same function from IODImage since do not want the user to access the image pixel module manually. More...
 
virtual void initIODRules ()
 Initialize IOD rules.
 
virtual OFCondition readSegments (DcmItem &item)
 Read segments from given item. More...
 
virtual OFCondition writeFractionalFrames (DcmItem &dataset)
 Write fractional frames to given item. More...
 
virtual OFCondition writeBinaryFrames (DcmItem &dataset)
 Write binary frames to given item. More...
 
virtual OFCondition writeSegmentationImageModule (DcmItem &dataset)
 Write Segmentation Image Module. More...
 
virtual OFCondition writeSegments (DcmItem &item)
 Write Segments. More...
 
virtual OFCondition writeMultiFrameFunctionalGroupsModule (DcmItem &dataset)
 Write Multi-Frame Functional Groups. More...
 
virtual OFCondition writeMultiFrameDimensionModule (DcmItem &dataset)
 Write Multi-Frame Dimension Module. More...
 
virtual OFCondition readFrames (DcmItem &dataset)
 Read frames. More...
 
virtual OFCondition getAndCheckImagePixelAttributes (DcmItem &dataset, Uint16 &allocated, Uint16 &stored, Uint16 &high, Uint16 &spp, Uint16 &pixelRep, Uint16 &rows, Uint16 &cols, Uint16 &numberOfFrames, OFString &colorModel)
 Get Image Pixel module attributes and perform some basic checking. More...
 
virtual void extractFrames (Uint8 *pixData, const size_t numFrames, const size_t bitsPerFrame, OFVector< DcmIODTypes::Frame * > &results)
 Extracts Frame structures from the given pixel data element. More...
 
virtual void concatFrames (OFVector< DcmIODTypes::Frame * > frames, Uint8 *pixData, const size_t bitsPerFrame)
 This is the counterpart to the extractFrames() function. More...
 
virtual OFCondition addFrame (Uint8 *pixData)
 Add frame to segmentation object. More...
 

Static Protected Member Functions

static OFCondition createCommon (DcmSegmentation *&segmentation, const Uint16 rows, const Uint16 columns, const IODGeneralEquipmentModule::EquipmentInfo &equipmentInfo, const ContentIdentificationMacro &contentIdentification)
 Create those data structures common for binary and fractional segmentations. More...
 

Protected Attributes

const CodeSequenceMacro DERIVATION_CODE
 Constant code (required by Segmentation IOD) used to fill Derivation Image Functional Group.
 
const CodeSequenceMacro PURPOSE_OF_REFERENCE_CODE
 Constant code (required by Segmentation IOD) used to fill Derivation Image Functional Group.
 

Private Member Functions

void clearData ()
 Clear old data.
 
OFBool checkPixDataLength (DcmElement *pixelData, const Uint16 rows, const Uint16 cols, const Uint16 &numberOfFrames)
 Check the length of the pixel data. More...
 
size_t getBitsPerFrame (const Uint16 &rows, const Uint16 &cols)
 Returns the number of bits per frame, taking into account binary versus fractional segmentation (member variables) and the dimensions of the image (parameters) More...
 
size_t getTotalBytesRequired (const Uint16 &rows, const Uint16 &cols, const Uint16 &numberOfFrames)
 Returns the number of total bytes required for the frame data of this segmentation object. More...
 
OFCondition readSegmentationFractionalType (DcmItem &item)
 Read Fractional Type of segmentation. More...
 
OFCondition readSegmentationType (DcmItem &item)
 Read Segmentation Type of segmentation object. More...
 

Static Private Member Functions

static OFCondition loadFile (DcmFileFormat &dcmff, const OFString &filename, DcmDataset *&dset)
 Loads file. More...
 
static OFCondition decompress (DcmDataset &dset)
 Decompress the given dataset. More...
 

Private Attributes

IODSegmentationSeriesModule m_SegmentationSeries
 Segmentation Series Module.
 
IODEnhGeneralEquipmentModule m_EnhancedGeneralEquipmentModule
 IODEnhancedEquipmentModule.
 
IODMultiFrameFGModule m_FG
 Multi-frame Functional Groups module.
 
IODMultiframeDimensionModule m_DimensionModule
 Multi-frame Dimension Module.
 
OFVector< DcmIODTypes::Frame * > m_Frames
 Binary frame data.
 
const OFString m_ImageType
 Image Type: (CS, VM 2-n, Type 1), in Segmentations fixed to "DERIVED\PRIMARY".
 
ContentIdentificationMacro m_ContentIdentificationMacro
 Content Identification Macro.
 
DcmSegTypes::E_SegmentationType m_SegmentationType
 Segmentation Type: (CS, 1, 1)
 
DcmSegTypes::E_SegmentationFractionalType m_SegmentationFractionalType
 Segmentation Fractional Type: (CS, 1, 1C) (required if FRACTIONAL)
 
DcmUnsignedShort m_MaximumFractionalValue
 Maximum Fractional Value: (US, 1, 1C) (required if fractional type is FRACTIONAL)
 
OFVector< DcmSegment * > m_Segments
 Segment descriptions from Segment Sequence.
 
FGInterface m_FGInterface
 Multi-frame Functional Groups high level interface.
 

Additional Inherited Members

- Public Types inherited from DcmIODImage< IODImagePixelModule< Uint8 > >
typedef DcmIODImage IODImage
 typedef for old compilers that do not define the type 'DcmIODImage' in derived classes.
 
typedef IODImagePixelVariant
< OFVARIADIC_TEMPLATE_PARAMETER_PACK(T)> 
IODImagePixelModuleType
 A good comment would be nice, but I have nothing in mind.
 

Detailed Description

Class representing an object of the "Segmentation SOP Class".

Constructor & Destructor Documentation

DcmSegmentation::DcmSegmentation ( )
protected

Protected default constructor.

Library users should the factory create..() method in order to create an object from scratch

Member Function Documentation

virtual OFCondition DcmSegmentation::addForAllFrames ( const FGBase group)
virtual

Add a functional group for all frames.

Parameters
groupThe group to be added as shared functional group. The
Returns
EC_Normal if adding was successful, error otherwise
virtual OFCondition DcmSegmentation::addFrame ( Uint8 *  pixData,
const Uint16  segmentNumber,
const OFVector< FGBase * > &  perFrameInformation 
)
virtual

Add frame to segmentation object.

Parameters
pixDataPixel data to be added. Length must be rows*columns bytes. For binary segmentations (bit depth i.e. Bits Allocated/Stored=1), each byte equal to 0 will be interpreted as "not set", while every other value is interpreted as "set". For fractional segmentations the full byte is copied as is.
segmentNumberThe logical segment number (>=1) this frame refers to. The segment identified by the segmentNumber must already exist.
perFrameInformationThe functional groups that identify this frame (i.e. which are planned to be not common for all other frames). The functional groups are copied, so ownership of each group stays with the caller no matter what the method returns.
Returns
EC_Normal if adding was successful, error otherwise
virtual OFCondition DcmSegmentation::addFrame ( Uint8 *  pixData)
protectedvirtual

Add frame to segmentation object.

Parameters
pixDataPixel data to be added. Length must be rows*columns bytes. Pixel data is copied so it must be freed by the caller.
Returns
EC_Normal if adding was successful, error otherwise
virtual OFCondition DcmSegmentation::addSegment ( DcmSegment seg,
Uint16 &  segmentNumber 
)
virtual

Add segment to segmentation object.

Parameters
segThe segment that should be added
segmentNumberThe logical segment number that was assigned for this segment. Contains 0 if adding failed.
Returns
EC_Normal if adding was successful, error otherwise
virtual OFBool DcmSegmentation::check ( )
virtual

Perform some basic checking.

This method is also invoked when writing the object to a DICOM dataset or file.

Returns
OFTrue, if no errors were found, OFFalse otherwise.
OFBool DcmSegmentation::checkPixDataLength ( DcmElement pixelData,
const Uint16  rows,
const Uint16  cols,
const Uint16 &  numberOfFrames 
)
private

Check the length of the pixel data.

Parameters
pixelDataThe Pixel Data element
rowsNumber of rows
colsNumber of columns
numberOfFramesNumber of frames
Returns
OFTrue if length is valid, OFFalse otherwise
virtual void DcmSegmentation::concatFrames ( OFVector< DcmIODTypes::Frame * >  frames,
Uint8 *  pixData,
const size_t  bitsPerFrame 
)
protectedvirtual

This is the counterpart to the extractFrames() function.

It takes a number of frames that are in binary segmentation format (i.e. "bit-packed") and concatenates them together so the resulting memory block fits the Pixel Data format for binary segmentations. Thus method ensure that frames are aligned bit for bit concatenated to each other with only (if applicable) having unused bits after the last frame.

Parameters
framesThe source frames
pixDataThe pixel data element data to be filled. Size must be at least bitsPerFrame * number of frames.
bitsPerFrameBits required per frame, usually rows * columns
static OFCondition DcmSegmentation::createBinarySegmentation ( DcmSegmentation *&  segmentation,
const Uint16  rows,
const Uint16  columns,
const IODGeneralEquipmentModule::EquipmentInfo equipmentInfo,
const ContentIdentificationMacro contentIdentification 
)
static

Factory method to create a binary segmentation object from the minimal set of information required.

The actual segments and the frame data is added separately. The memory of the resulting Segmentation object has to be freed by the caller.

Parameters
segmentationThe resulting segmentation object if provided data is valid. Otherwise NULL is returned.
rowsNumber of rows of segmentation frame data
columnsNumber of rows of segmentation frame data
equipmentInfoEquipment that is responsible for creating the segmentation
contentIdentificationBasic content identification information
Returns
EC_Normal if creation was successful, error otherwise
static OFCondition DcmSegmentation::createCommon ( DcmSegmentation *&  segmentation,
const Uint16  rows,
const Uint16  columns,
const IODGeneralEquipmentModule::EquipmentInfo equipmentInfo,
const ContentIdentificationMacro contentIdentification 
)
staticprotected

Create those data structures common for binary and fractional segmentations.

Parameters
segmentationThe segmentation object created
rowsThe number of rows for the segmentation
columnsThe number of columns for the segmentation
equipmentInfoEquipment information
contentIdentificationContent meta information
Returns
EC_Normal if creation was successful, error otherwise
static FGDerivationImage* DcmSegmentation::createDerivationImageFG ( const OFVector< ImageSOPInstanceReferenceMacro > &  derivationImages,
const OFString derivationDescription 
)
static

Helps to create a valid Derivation Image Functional Group Macro The memory of the resulting functional group object has to be freed by the caller.

Parameters
derivationImagesto image SOP instances
derivationDescriptionFree text describing how the derivation was achieved.
Returns
The created functional group, or NULL if not successful
static OFCondition DcmSegmentation::createFractionalSegmentation ( DcmSegmentation *&  segmentation,
const Uint16  rows,
const Uint16  columns,
const DcmSegTypes::E_SegmentationFractionalType  fractType,
const Uint16 &  maxFractionalValue,
const IODGeneralEquipmentModule::EquipmentInfo equipmentInfo,
const ContentIdentificationMacro contentIdentification 
)
static

Factory method to create a fractional segmentation object from the minimal set of information required.

The actual segments and the frame data is added separately. The memory of the resulting Segmentation object has to be freed by the caller.

Parameters
segmentationThe resulting segmentation object if provided data is valid. Otherwise NULL is returned.
rowsNumber of rows of segmentation frame data
columnsNumber of rows of segmentation frame data
fractTypeEither probability (SFT_PROBABILITY) or occupancy (SFT_OCCUPANCY)
maxFractionalValueThe value inside the frame data of this segmentation that represents 100% occupancy/probability
equipmentInfoEquipment that is responsible for creating the segmentation
contentIdentificationBasic content identification information
Returns
EC_Normal if creation was successful, error otherwise
static OFCondition DcmSegmentation::decompress ( DcmDataset dset)
staticprivate

Decompress the given dataset.

Parameters
dsetThe dataset to be decompressed
Returns
EC_Normal if decompression worked (or dataset has already been decompressed), IOD_EC_CannotDecompress otherwise
virtual void DcmSegmentation::extractFrames ( Uint8 *  pixData,
const size_t  numFrames,
const size_t  bitsPerFrame,
OFVector< DcmIODTypes::Frame * > &  results 
)
protectedvirtual

Extracts Frame structures from the given pixel data element.

Only applicable for binary segmentations. Within the pixel data element, all frames are packed next to each other, with the end of one frame and the beginning of the next frame packed bit by bit next to each other. The resulting Frames are a bit-by-bit copy of their original counterpart. However, their first bit is aligned to the first bit/byte in the Frame, and the unused bits in the last byte (if any) are zeroed out.

Parameters
pixDataThe pixel data to read from
numFramesThe number of frames to read
bitsPerFrameThe number of bits per frame (usually rows * columns)
resultsThe resulting frames. Memory for the frames is allocated by the method, so the Vector can/should be empty before calling.
virtual OFCondition DcmSegmentation::getAndCheckImagePixelAttributes ( DcmItem dataset,
Uint16 &  allocated,
Uint16 &  stored,
Uint16 &  high,
Uint16 &  spp,
Uint16 &  pixelRep,
Uint16 &  rows,
Uint16 &  cols,
Uint16 &  numberOfFrames,
OFString colorModel 
)
protectedvirtual

Get Image Pixel module attributes and perform some basic checking.

Parameters
datasetItem to read from, usually main dataset level
allocatedBits Allocated
storedBits Stored
highHigh Bit
sppSamples Per Pixel
pixelRepPixel Representation
rowsRows
colsColumns
numberOfFramesThe number of frames (as set in the dataset)
colorModelThe color model used
Returns
EC_Normal if reading/checking was successful, error otherwise
size_t DcmSegmentation::getBitsPerFrame ( const Uint16 &  rows,
const Uint16 &  cols 
)
private

Returns the number of bits per frame, taking into account binary versus fractional segmentation (member variables) and the dimensions of the image (parameters)

Parameters
rowsThe number of rows returned
colsThe number of columns returned
Returns
Bits used by a single frame of the segmentation
virtual ContentIdentificationMacro& DcmSegmentation::getContentIdentification ( )
virtual

Return reference to content content identification of this segmentation object.

Returns
Reference to content identification data
virtual IODMultiframeDimensionModule& DcmSegmentation::getDimensions ( )
virtual

Return reference to multi-fame dimension module.

Returns
Reference to multi-frame dimension module
virtual IODGeneralEquipmentModule& DcmSegmentation::getEquipment ( )
virtual

Get General Equipment Module.

Returns
General Equipment Module
virtual const DcmIODTypes::Frame* DcmSegmentation::getFrame ( const size_t &  frameNo)
virtual

Get (const) frame data of a specific frame.

Parameters
frameNoThe number of the frame to get (starting with 0)
Returns
The frame requested or NULL if not existing
virtual void DcmSegmentation::getFramesForSegment ( const size_t &  segmentNumber,
OFVector< size_t > &  frameNumbers 
)
virtual

Get the frame numbers that belong to a specific segment number.

Parameters
segmentNumberThe segment to search frames for
frameNumbersThe frame numbers belonging to that segment
virtual FGInterface& DcmSegmentation::getFunctionalGroups ( )
virtual

Get access to functional groups.

This is meant for reading data from functional groups that are not actively managed, i.e. made accessible by DcmSegmentation. In rare cases, however, it makes sense to access it for writing too, e.g. in order to add Stacks; use with care!

Returns
Reference to the functional groups
virtual IODImagePixelModule<Uint8>& DcmSegmentation::getImagePixel ( )
protectedvirtual

Hide same function from IODImage since do not want the user to access the image pixel module manually.

Returns
The Image Pixel Module
virtual OFCondition DcmSegmentation::getModality ( OFString value,
const signed long  pos = 0 
) const
virtual

Get modality (overwrite from DcmIODCommon.

We always return "SEG" here)

Parameters
valueReference to variable in which the value should be stored
posIndex of the value to get. Not evaluated (here for consistency with other setter functions).
Returns
status, EC_Normal if successful, an error code otherwise
size_t DcmSegmentation::getNumberOfFrames ( )

Get number of frames, based on the number of items in the shared functional functional groups sequence (i.e. the attribute Number of Frames) is not trusted).

Returns
The number of frames handled by this object
size_t DcmSegmentation::getNumberOfSegments ( )

Get the Number of Segments.

Returns
The number of segments handled by this object
virtual SOPInstanceReferenceMacro& DcmSegmentation::getReferencedPPS ( )
virtual

Reference to the Performed Procedure Step that led to the creation of this segmentation object.

This is required if this object is created in an MPPS or GPPS workflow.

Returns
Reference to the referenced PPS object
virtual DcmSegment* DcmSegmentation::getSegment ( const unsigned int  segmentNumber)
virtual

Get segment by providing the logical segment number.

Parameters
segmentNumberThe logical segment number
Returns
The segment if segment number is valid, NULL otherwise
DcmSegTypes::E_SegmentationFractionalType DcmSegmentation::getSegmentationFractionalType ( )
inline

Get Fractional Segmentation Type.

Returns
Type of the segmentation, as defined by DcmSegTypes::E_SegmentationFractionalTypes (returns SFT_UNKNOWN if not fractional at all)
virtual IODSegmentationSeriesModule& DcmSegmentation::getSegmentationSeriesModule ( )
virtual

Get Segmentation Series Module.

Returns
Segmentation Series Module
DcmSegTypes::E_SegmentationType DcmSegmentation::getSegmentationType ( )
inline

Get Segmentation Type.

Returns
Type of the segmentation, as defined by DcmSegTypes::E_SegmentationType
virtual OFBool DcmSegmentation::getSegmentNumber ( const DcmSegment segment,
unsigned int &  segmentNumber 
)
virtual

Get logical segment number by providing a pointer to a given segment.

Parameters
segmentThe segment to find the logical segment number for
segmentNumberThe segment number. 0 if segment could not be found.
Returns
OFTrue if segment could be found, OFFalse otherwise.
size_t DcmSegmentation::getTotalBytesRequired ( const Uint16 &  rows,
const Uint16 &  cols,
const Uint16 &  numberOfFrames 
)
private

Returns the number of total bytes required for the frame data of this segmentation object.

Takes into account dimensions and number of frames, as well as the type of segmentation (member variables).

Parameters
rowsNumber of rows of a frame
colsNumber of cols of a frame
numberOfFramesThe number of frames of the object
Returns
Number of bytes used by all frames of this segmentation
static OFCondition DcmSegmentation::loadDataset ( DcmDataset dataset,
DcmSegmentation *&  segmentation 
)
static

Static method to load a Segmentation object from a dataset object.

The memory of the resulting Segmentation object has to be freed by the caller.

Parameters
datasetThe dataset to read from
segmentationThe resulting segmentation object. NULL if dataset could not be read successfully.
Returns
EC_Normal if reading was successful, error otherwise
static OFCondition DcmSegmentation::loadFile ( const OFString filename,
DcmSegmentation *&  segmentation 
)
static

Static method to load a Segmentation object from a file.

The memory of the resulting Segmentation object has to be freed by the caller.

Parameters
filenameThe file to read from
segmentationThe resulting segmentation object. NULL if dataset could not be read successfully.
Returns
EC_Normal if reading was successful, error otherwise
static OFCondition DcmSegmentation::loadFile ( DcmFileFormat dcmff,
const OFString filename,
DcmDataset *&  dset 
)
staticprivate

Loads file.

Parameters
dcmffThe file format to load into
filenameThe filename of the file to load
dsetPointer to dataset after loading
Returns
EC_Normal if loading was successful, error otherwise
OFCondition DcmSegmentation::read ( DcmItem dataset)
protectedvirtual

Overwrites DcmIODImage::read()

Parameters
datasetThe dataset to read from
Returns
EC_Normal if reading succeeded, error otherwise

Reimplemented from DcmIODImage< IODImagePixelModule< Uint8 > >.

virtual OFCondition DcmSegmentation::readFrames ( DcmItem dataset)
protectedvirtual

Read frames.

Parameters
datasetItem to read from, usually main dataset level
Returns
EC_Normal if reading was successful, error otherwise
OFCondition DcmSegmentation::readSegmentationFractionalType ( DcmItem item)
private

Read Fractional Type of segmentation.

Parameters
itemThe item to read from
Returns
EC_Normal if type could be read, error otherwise
OFCondition DcmSegmentation::readSegmentationType ( DcmItem item)
private

Read Segmentation Type of segmentation object.

Parameters
itemThe item to read from
Returns
EC_Normal if type could be read, error otherwise
virtual OFCondition DcmSegmentation::readSegments ( DcmItem item)
protectedvirtual

Read segments from given item.

Parameters
itemThe item to read from
Returns
EC_Normal if reading was successful, error otherwise
OFCondition DcmSegmentation::saveFile ( const OFString filename,
const E_TransferSyntax  writeXfer = EXS_LittleEndianExplicit 
)

Save current object to given filename.

Parameters
filenameThe file to write to
writeXferThe transfer syntax to be used
Returns
EC_Normal if writing was successful, error otherwise.
virtual OFCondition DcmSegmentation::setContentIdentification ( const ContentIdentificationMacro contentIdentification,
const OFBool  checkValue = OFTrue 
)
virtual

Set content identification info for this segmentation object.

Parameters
contentIdentificationThe content identification of this segmentation
checkValueIf OFTrue, the data provided is checked for validity (as possible)
Returns
EC_Normal if content identification could be set correctly, OFFalse otherwise
virtual OFCondition DcmSegmentation::setEquipmentInfo ( const IODGeneralEquipmentModule::EquipmentInfo equipmentInfo,
const OFBool  checkValue = OFTrue 
)
virtual

Set equipment info for this segmentation object.

Parameters
equipmentInfoThe description of the equipment used to create this segmentation
checkValueIf OFTrue, the data provided is checked for validity
Returns
EC_Normal if equipment information could be set successfully, error otherwise
virtual OFCondition DcmSegmentation::setLossyImageCompressionFlag ( const OFString ratios,
const OFString methods,
const OFBool  checkValues = OFTrue 
)
virtual

Set lossy compression flag of the segmentation object to "01".

If one of the source images of this segmentation has undergone lossy compression then this function should be called.

Parameters
ratiosCompression ratios (separated by backslash) of the applied lossy compression steps. Only one value (and no backslash) if only one step was performed.
methodsMethods (separated by backslash) of the applied lossy compression steps. Only one value (and no backslash) if only one step was performed.
checkValuesIf OFTrue, the data provided is checked for validity
Returns
EC_Normal if lossy compression info could be set, error code otherwise
OFCondition DcmSegmentation::write ( DcmItem dataset)
protectedvirtual

Overwrites DcmIODImage::write()

Parameters
datasetThe dataset to write to
Returns
EC_Normal if writing succeeded, error otherwise

Reimplemented from DcmIODImage< IODImagePixelModule< Uint8 > >.

virtual OFCondition DcmSegmentation::writeBinaryFrames ( DcmItem dataset)
protectedvirtual

Write binary frames to given item.

Parameters
datasetThe item to write to, usually main dataset level
Returns
EC_Normal if writing was successful, error otherwise
OFCondition DcmSegmentation::writeDataset ( DcmItem dataset)

Write current object to given item.

Parameters
datasetThe item to write to
Returns
EC_Normal if writing was successful, error otherwise.
virtual OFCondition DcmSegmentation::writeFractionalFrames ( DcmItem dataset)
protectedvirtual

Write fractional frames to given item.

Parameters
datasetThe item to write to, usually main dataset level
Returns
EC_Normal if writing was successful, error otherwise
virtual OFCondition DcmSegmentation::writeMultiFrameDimensionModule ( DcmItem dataset)
protectedvirtual

Write Multi-Frame Dimension Module.

Parameters
datasetThe item to write to, usually main dataset level
Returns
EC_Normal if writing was successful, error otherwise
virtual OFCondition DcmSegmentation::writeMultiFrameFunctionalGroupsModule ( DcmItem dataset)
protectedvirtual

Write Multi-Frame Functional Groups.

Parameters
datasetThe item to write to, usually main dataset level
Returns
EC_Normal if writing was successful, error otherwise
virtual OFCondition DcmSegmentation::writeSegmentationImageModule ( DcmItem dataset)
protectedvirtual

Write Segmentation Image Module.

Parameters
datasetThe item to write to, usually main dataset level
Returns
EC_Normal if writing was successful, error otherwise
virtual OFCondition DcmSegmentation::writeSegments ( DcmItem item)
protectedvirtual

Write Segments.

Parameters
itemThe item to write to
Returns
EC_Normal if writing was successful, error otherwise

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


Generated on Tue Feb 28 2017 for DCMTK Version 3.6.1 20170228 by Doxygen 1.8.8