RZ - Software Services www.roniza.com

IDCXOBJ Interface Reference

The DICOM Object is one of the core interfaces of RZDCX SDK. It is used to read, write, create and modify DICOM Objects. More...

List of all members.

Public Member Functions

HRESULT getElementByTag ([in] DICOM_TAG tag,[out, retval] IDCXELM **e)
 Get an element by its tag.
HRESULT createElement ([in] DICOM_TAG tag,[out, retval] IDCXELM **e)
 Creates a new element.
HRESULT insertElement ([in] IDCXELM *e)
 Inserts the element to the object.
HRESULT iterator ([out, retval] IDCXELMIterator **i)
 Get an iterator to go over the object elements.
HRESULT Dump ([in] BSTR filename)
 Write content to text file.
HRESULT openFile ([in] BSTR filePath)
 Read a DICOM Object from a file.
HRESULT saveFile ([in] BSTR storagePath)
 Write a DICOM Object to a file.
HRESULT GetPixelDataRef ([out, retval] int *pVal)
 Get the Pixel address.
HRESULT Decode ()
 Decode the Image.
HRESULT ClipImage ([in] int left,[in] int top,[in] int right,[in] int bottom,[in] int z,[out, retval] IDCXOBJ **o)
 Get an object holding a region of the original image.
HRESULT insertNextElement ([in] IDCXELM *e)
 Depracated. Use insertElement.
HRESULT getNextSequence ([in] DICOM_TAG tag,[out, retval] IDCXOBJ **o)
 Returns a new sequence object for the tag.
HRESULT getElementsByTag ([in] DICOM_TAG tag,[out, retval] IDCXELMIterator **i)
 Get elements by tag.
HRESULT ReadBuffer ([in] int buffer,[in]long length)
 Read dicom data from a memory buffer.
HRESULT EncodeLosslessJpeg ()
HRESULT EncodeJpeg (long quality)
HRESULT MakePaletteColor (void)
 Converts a Color Image into a Palette Color Image.
HRESULT SaveAs ([in] BSTR filename,[in] TRANSFER_SYNTAX TransferSyntax,[in] int quality,[in] BSTR workDir)
 Save file with specific transfer syntax using temporary files for intermediate compressed frames buffers Implemented only for JPEG lossy.
HRESULT SetJpegFrames ([in] BSTR filenames)
 Set the pixel data from one or more jpeg images (separate filenames by ;).
HRESULT SetBMPFrames ([in] BSTR filenames)
 Set the pixel data from one or more BITMAP images (separate filenames by ;).

Properties

long FrameCount [get]
 Get the number of frames in the image.
TRANSFER_SYNTAX TransferSyntax [set]
 Set the transfer syntax. This method is usful in combination with saveFile. For an example look at CPPCeateImageExample.
IDCXOBJ FileMetaInfo [get, set]
 Set/Get DICOM File Meta Information.
VARIANT_BOOL FileMetaInfoExists [get]
 Check if file meta info was loaded with the file or previously set using the FileMetaInfo property (put).

Detailed Description

The DICOM Object is one of the core interfaces of RZDCX SDK. It is used to read, write, create and modify DICOM Objects.

A DICOM Object Interface.


Member Function Documentation

HRESULT IDCXOBJ::createElement ( [in] DICOM_TAG  tag,
[out, retval] IDCXELM **  e 
)

Creates a new element.

Use this method to create new DICOM elements. This method is actually identical to IDCXELM::Init. The element is not added to the object. To add it, use insertElement after the element data is set.

Returns:
a IDCXELM with no data.
HRESULT IDCXOBJ::Decode (  ) 

Decode the Image.

This method changes the internal representation of the pixel data from compressed to uncompressed.

HRESULT IDCXOBJ::Dump ( [in] BSTR  filename  ) 

Write content to text file.

Parameters:
filename Filename to write to (overwritten)
HRESULT IDCXOBJ::EncodeJpeg ( long  quality  ) 
DICOM Conformance:
Saved file has transfr syntax: 1.2.840.10008.1.2.4.50
Parameters:
quality 0..100 (best) Quality
HRESULT IDCXOBJ::EncodeLosslessJpeg (  ) 
DICOM Conformance:
Saved file has transfr syntax: 1.2.840.10008.1.2.4.70
HRESULT IDCXOBJ::getElementByTag ( [in] DICOM_TAG  tag,
[out, retval] IDCXELM **  e 
)

Get an element by its tag.

Get an element from the object by giving its DICOM_TAG.

Returns:
IDCXELM of the requested element or NULL if not found
HRESULT IDCXOBJ::getElementsByTag ( [in] DICOM_TAG  tag,
[out, retval] IDCXELMIterator **  i 
)

Get elements by tag.

Returns:
IDCXELMIterator of the requested elements or NULL if not found
HRESULT IDCXOBJ::getNextSequence ( [in] DICOM_TAG  tag,
[out, retval] IDCXOBJ **  o 
)

Returns a new sequence object for the tag.

Parameters:
tag The DICOM Tag of the Sequence
o Output DICOM Object holding the
HRESULT IDCXOBJ::GetPixelDataRef ( [out, retval] int *  pVal  ) 

Get the Pixel address.

Returns:
pointer to pixel address
HRESULT IDCXOBJ::iterator ( [out, retval] IDCXELMIterator **  i  ) 

Get an iterator to go over the object elements.

Returns:
IDCXELMIterator
HRESULT IDCXOBJ::openFile ( [in] BSTR  filePath  ) 

Read a DICOM Object from a file.

The content of the DICOM Object in the file is loaded into memory. Some elements with large data may be loaded partially to conserve memory. The data is loaded into memory when required but the file is not locked. When calling saveFile with the same file name that was used in openFile all data is first loaded into memory and only then the file is written again. If the file has a file meta information, it can be read using the FileMetaInfo property.

See also:
FileMetaInfo, saveFile
HRESULT IDCXOBJ::SaveAs ( [in] BSTR  filename,
[in] TRANSFER_SYNTAX  TransferSyntax,
[in] int  quality,
[in] BSTR  workDir 
)

Save file with specific transfer syntax using temporary files for intermediate compressed frames buffers Implemented only for JPEG lossy.

Postcondition:
The work directory may be full with temporary files
Parameters:
filename The DICOM file name to save
TransferSyntax The transfer syntax to use (currently only JPEG Lossy)
quality 0..100 (best) Quality, when relevant
workDir A directory that can be used to save temporary files in order not to take to much memory
HRESULT IDCXOBJ::saveFile ( [in] BSTR  storagePath  ) 

Write a DICOM Object to a file.

If the FileMetaInfo was set, then it is used, otherwise a new file meta information is created. If the object was opened from file using openFile, then the FileMetaInfo of the new file will be different then the one written by this method.

See also:
FileMetaInfo, saveFile
HRESULT IDCXOBJ::SetBMPFrames ( [in] BSTR  filenames  ) 

Set the pixel data from one or more BITMAP images (separate filenames by ;).

See also:
SetJpegFrames
Postcondition:
All attributes
Parameters:
filenames ; separated bitmap files list
HRESULT IDCXOBJ::SetJpegFrames ( [in] BSTR  filenames  ) 

Set the pixel data from one or more jpeg images (separate filenames by ;).

This method sets the pixel data and related elements (rows, columns, number of frames, transfer syntax ...) from jpeg images. The object that is created is a Secondary Capture object. If the filenames parameter contain multiple filenames separated by ;, then the object that is created is a multiframe object. All the images must have the same attributes of size (rows and columns), color sapce, compression (baseline, progressive) and quality.

Postcondition:
All attributes
Parameters:
filenames ; separated jpeg files list

Property Documentation

IDCXOBJ IDCXOBJ::FileMetaInfo [get, set]

Set/Get DICOM File Meta Information.

Note:
The get property requires special license and is not included in the default license. For more information please contact us.

There is no validation of the set File Meta Information content. It should be valid and in particular match the transfer syntax of the object. When setting File Meta Information, only elements of group 0002 are inserted. All other elements are discarded.

For objects that were not read from file (e.g. recived through network or created programatically) there's no File Meta Information unless explicitly set. Calling the get property for these objects returns null (with HRESULT S_FALSE).

The File Meta Information includes identifying information on the encapsulated Data Set. This header consists of a 128 byte File Preamble, followed by a 4 byte DICOM prefix, followed by the File Meta Elements shown in Table 7.1-1 of the DICOM Standard chapter 10 (see for example ftp://medical.nema.org/medical/dicom/2009/09_10pu.pdf) The value returned by the FileMetaInfo property is a DCXOBJ that is a copy of the file meta info. This DICOM object can be modified like any other DICOM Object. You should only set elements of group 0002 into this object and that there's no validations on that. The set property copies all data elements of group 0002 from the provided object to the file meta information of the object. If the transfer syntax in the new file meta information is different then the current one, this will lead to representation change in the same way as setting the TransferSyntax property.

According to the DICOM Standard, the file meta info identifies the application that created the file, thus when reading a file using loadFile and then writing it back using saveFile, the original meta info is replaced with a new one carrying the information of the creating application.

According to the above, when reading information from a file, the get property returns original file meta info from the file that was opened but when calling saveFile a new file meta info is generated.

If the set property was called before the saveFile then this file meta header will be used.

See also:
openFile, saveFile
VARIANT_BOOL IDCXOBJ::FileMetaInfoExists [get]

Check if file meta info was loaded with the file or previously set using the FileMetaInfo property (put).

This is a simple helper property to prevent cases when an exeption is thrown when using C++ COM Auto Pointers that throws exceptions when interface is not returned.


Generated on Thu Feb 2 22:08:32 2012 for RZDCX - DICOM SDK by doxygen 1.6.3