RZDCX - Fast Strike DICOM Toolkit  Release
IDCXELM Interface Reference

This inteface is used to get and set DICOM Elements and their value. More...

Inherits IDispatch.

Public Member Functions

HRESULT Init ([in] DICOM_TAG tag)
 Initalize from a DICOM Tag. More...
HRESULT SetValueFromFile ([in] BSTR filename, [in] int offset, [in] int length)
 Set the value from the content of a file. More...
HRESULT SetRawData ([in] int newVal, [in] long newLen)
HRESULT GetRawData ([out] int *Val, [out] long *Len)
 see SetRawData


DICOM_TAG Tag [get]
 Get the Elemenmt TAG. More...
VR_CODE ValueRepresentation [get, set]
 Get/Set The Value Representation (VR) Code. More...
long Length [get, set]
 Get The value length. More...
VARIANT Value [get, set]
 Get/Set the element value. More...
int CStringPtr [get, set]
 Get/Set a string value element from a value pointer (C/C++ optimization). More...
long ValueMultiplicity [get]
 Get the element's value multiplicity (VM). More...
VARIANT ValueArray [get]
 Get a multivalue tag as an array object (safearray). More...

Detailed Description

This inteface is used to get and set DICOM Elements and their value.

The DICOM Element can either be created directly or extracted from a DICOM Object using getElementByTag or Element Iterator. An element can be added to a DICOM Object using the IDCXOBJ insertElement method. For an example of using the DICOM Element Object see CPPDicomObjectExample.cpp

Member Function Documentation

◆ Init()


Initalize from a DICOM Tag.

Use this method to create a new element and then insert it to a IDCXOBJ. The DICOM Tag must be a valid one from the internal or extended Dictionary. This call also resets the Length to 0

◆ SetRawData()

HRESULT IDCXELM::SetRawData ( [in] int  newVal,
[in] long  newLen 

Set/Get raw data into element, overriding all validation checks. The getter returns a pointer to the actual data and setter takes a pointer of buffer to copy into the elements data. Try avoiding this method and use it only for very specific cases when pusing or getting raw data is required. Using this method may cause competibility issues with other toolkits trying to read the brutaly inserted data. After setting this element, avoid calling any other methods of the element.

◆ SetValueFromFile()

HRESULT IDCXELM::SetValueFromFile ( [in] BSTR  filename,
[in] int  offset,
[in] int  length 

Set the value from the content of a file.

Use only with little endian transfer syntax. Use only for byte streams (i.e. for binaries VR OB, not OW). This method is provided in order to enable setting large buffers to elements like for example pixel data of large images or long sequeneces of multiframe objects. Length must be pair.

File must exist prior to calling the method and throught the lifetime of the element and any object it is added to.
If the file doesn't exist, return E_FAIL with description "File not found"
filenameThe name of the data file
offsetThe offset from the begining of the file in bytes, to start reading from
lengthThe number of bytes to read from the file

Property Documentation

◆ CStringPtr

int IDCXELM::CStringPtr

Get/Set a string value element from a value pointer (C/C++ optimization).

This is an unsafe optimization method that is useful mainly for C++ programming. It bypasses the Double/Single byte characters conversions and thus is more efficient.

◆ Length

long IDCXELM::Length

Get The value length.

Caution!!!Use the Set method with special care! The Property set of value length is used only for special cases when the the value representation is OB or OW (e.g. Pixel Data) In these cases only the value is actually a pointer to the data and the Length property set is used.

◆ Tag


Get the Elemenmt TAG.

◆ Value


Get/Set the element value.

Type conversions are supported for string and basic types. The get method may change string values for specific VR's.
The following conversion apply:

  • DA and DT: When getting the value of a DA (date) or DT (date-time) elements the return value is YYYY-MM-DD [HH:MM:SS.TTT]

◆ ValueArray


Get a multivalue tag as an array object (safearray).

◆ ValueMultiplicity

long IDCXELM::ValueMultiplicity

Get the element's value multiplicity (VM).

◆ ValueRepresentation

VR_CODE IDCXELM::ValueRepresentation

Get/Set The Value Representation (VR) Code.

Use the Set property of VR code carefully! This method is intended to override the VR of the element that is set by default according to internal dictionary. It should be used for example to change the VR of Pixel Data element from OW (Default) to OB when creating 8 bit or Color image object.