DCMTK  Version 3.6.6
OFFIS DICOM Toolkit
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes | List of all members
DiDocument Class Reference

Interface class to DICOM data management (dcmdata). More...

+ Inheritance diagram for DiDocument:

Public Member Functions

 DiDocument (const char *filename, const unsigned long flags=0, const unsigned long fstart=0, const unsigned long fcount=0)
 constructor, open a DICOM file More...
 
 DiDocument (DcmObject *object, const E_TransferSyntax xfer, const unsigned long flags=0, const unsigned long fstart=0, const unsigned long fcount=0)
 constructor, use a given DcmObject More...
 
virtual ~DiDocument ()
 destructor
 
int good () const
 check whether current document is valid More...
 
DcmObjectgetDicomObject () const
 get current DICOM object (dataset) More...
 
DcmDatasetgetDataset () const
 get current DICOM dataset More...
 
unsigned long getFrameStart () const
 get first frame to be processed More...
 
unsigned long getFrameCount () const
 get number of frames to be processed More...
 
unsigned long getFlags () const
 get configuration flags More...
 
E_TransferSyntax getTransferSyntax () const
 get transfer syntax of the DICOM dataset More...
 
const char * getPhotometricInterpretation () const
 get photometric interpretation (color model). More...
 
DcmPixelDatagetPixelData () const
 get pixel data object More...
 
OFBool isCompressed () const
 check whether pixel data only exist in compressed format More...
 
DcmElementsearch (const DcmTagKey &tag, DcmObject *obj=NULL) const
 search for given tag More...
 
int search (const DcmTagKey &tag, DcmStack &stack) const
 search for given tag and put result(s) on a stack More...
 
unsigned long getVM (const DcmTagKey &tag) const
 get value multiplicity (VM) of given tag More...
 
unsigned long getValue (const DcmTagKey &tag, Uint16 &returnVal, const unsigned long pos=0, DcmItem *item=NULL, const OFBool allowSigned=OFFalse) const
 get value of given tag (Uint16) More...
 
unsigned long getValue (const DcmTagKey &tag, Sint16 &returnVal, const unsigned long pos=0, DcmItem *item=NULL) const
 get value of given tag (Sint16) More...
 
unsigned long getValue (const DcmTagKey &tag, Uint32 &returnVal, const unsigned long pos=0, DcmItem *item=NULL) const
 get value of given tag (Uint32) More...
 
unsigned long getValue (const DcmTagKey &tag, Sint32 &returnVal, const unsigned long pos=0, DcmItem *item=NULL) const
 get value of given tag (Sint32) More...
 
unsigned long getValue (const DcmTagKey &tag, double &returnVal, const unsigned long pos=0, DcmItem *item=NULL) const
 get value of given tag (double) More...
 
unsigned long getValue (const DcmTagKey &tag, const Uint16 *&returnVal, DcmItem *item=NULL) const
 get value of given tag (Uint16 array) More...
 
unsigned long getValue (const DcmTagKey &tag, const char *&returnVal, DcmItem *item=NULL) const
 get value of given tag (const char *) More...
 
unsigned long getValue (const DcmTagKey &tag, OFString &returnVal, const unsigned long pos=0, DcmItem *item=NULL) const
 get value of given tag (OFString) More...
 
unsigned long getSequence (const DcmTagKey &tag, DcmSequenceOfItems *&seq, DcmItem *item=NULL) const
 get sequence of given tag More...
 
- Public Member Functions inherited from DiObjectCounter
void addReference ()
 add a reference. More...
 
void removeReference ()
 remove a reference. More...
 

Static Public Member Functions

static unsigned long getElemValue (const DcmElement *elem, Uint16 &returnVal, const unsigned long pos=0, const OFBool allowSigned=OFFalse)
 get value of given element (Uint16) More...
 
static unsigned long getElemValue (const DcmElement *elem, const Uint16 *&returnVal)
 get value of given element (Uint16 array) More...
 
static unsigned long getElemValue (const DcmElement *elem, const char *&returnVal)
 get value of given element (const char *) More...
 
static unsigned long getElemValue (const DcmElement *elem, OFString &returnVal, const unsigned long pos=0)
 get value of given element (OFString) More...
 

Protected Member Functions

void convertPixelData ()
 convert pixel data to uncompressed representation (if required)
 
- Protected Member Functions inherited from DiObjectCounter
 DiObjectCounter ()
 constructor. More...
 
virtual ~DiObjectCounter ()
 destructor
 

Private Attributes

DcmObjectObject
 reference to DICOM dataset (in memory)
 
DcmFileFormatFileFormat
 reference to DICOM fileformat (read from file, maybe NULL)
 
DcmPixelDataPixelData
 reference to pixel data object
 
E_TransferSyntax Xfer
 transfer syntax used for reading the dataset
 
unsigned long FrameStart
 first frame to be processed
 
unsigned long FrameCount
 number of frames to be processed
 
unsigned long Flags
 configuration flags
 
OFString PhotometricInterpretation
 photometric interpretation (color model)
 

Detailed Description

Interface class to DICOM data management (dcmdata).

NB: This is an internal class of module dcmimgle/dcmimage. Please do not use it for accessing DICOM data structures. Instead use the classes and functions provided by dcmdata (e.g. class DcmFileFormat, DcmItem).

Constructor & Destructor Documentation

◆ DiDocument() [1/2]

DiDocument::DiDocument ( const char *  filename,
const unsigned long  flags = 0,
const unsigned long  fstart = 0,
const unsigned long  fcount = 0 
)

constructor, open a DICOM file

Parameters
filenamethe DICOM file
flagsconfiguration flags (only stored for later use)
fstartfirst frame to be processed (only stored for later use)
fcountnumber of frames (only stored for later use)

◆ DiDocument() [2/2]

DiDocument::DiDocument ( DcmObject object,
const E_TransferSyntax  xfer,
const unsigned long  flags = 0,
const unsigned long  fstart = 0,
const unsigned long  fcount = 0 
)

constructor, use a given DcmObject

Parameters
objectpointer to DICOM data structures (fileformat, dataset or item)
xfertransfer syntax of the 'object'. (could also be EXS_Unknown in case of fileformat or dataset)
flagsconfiguration flags (only stored for later use)
fstartfirst frame to be processed (only stored for later use)
fcountnumber of frames (only stored for later use)

Member Function Documentation

◆ getDataset()

DcmDataset* DiDocument::getDataset ( ) const
inline

get current DICOM dataset

Returns
pointer to DICOM dataset

◆ getDicomObject()

DcmObject* DiDocument::getDicomObject ( ) const
inline

get current DICOM object (dataset)

Returns
pointer to DICOM object

◆ getElemValue() [1/4]

static unsigned long DiDocument::getElemValue ( const DcmElement elem,
const char *&  returnVal 
)
static

get value of given element (const char *)

Parameters
elemelement where the value is stored
returnValreference to the storage area for the resulting value
Returns
VM if successful, 0 otherwise

◆ getElemValue() [2/4]

static unsigned long DiDocument::getElemValue ( const DcmElement elem,
const Uint16 *&  returnVal 
)
static

get value of given element (Uint16 array)

Parameters
elemelement where the value is stored
returnValreference to the storage area for the resulting value
Returns
VM / number of values if successful, 0 otherwise

◆ getElemValue() [3/4]

static unsigned long DiDocument::getElemValue ( const DcmElement elem,
OFString returnVal,
const unsigned long  pos = 0 
)
static

get value of given element (OFString)

Parameters
elemelement where the value is stored
returnValreference to the storage area for the resulting value
posposition in multi-valued elements (starting with 0)
Returns
VM if successful, 0 otherwise

◆ getElemValue() [4/4]

static unsigned long DiDocument::getElemValue ( const DcmElement elem,
Uint16 &  returnVal,
const unsigned long  pos = 0,
const OFBool  allowSigned = OFFalse 
)
static

get value of given element (Uint16)

Parameters
elemelement where the value is stored
returnValreference to the storage area for the resulting value
posposition in multi-valued elements (starting with 0)
allowSignedalso allow signed value (Sint16) if true
Returns
VM if successful, 0 otherwise

◆ getFlags()

unsigned long DiDocument::getFlags ( ) const
inline

get configuration flags

Returns
configuration flags

◆ getFrameCount()

unsigned long DiDocument::getFrameCount ( ) const
inline

get number of frames to be processed

Returns
number of frames to be processed

◆ getFrameStart()

unsigned long DiDocument::getFrameStart ( ) const
inline

get first frame to be processed

Returns
first frame to be processed

◆ getPhotometricInterpretation()

const char* DiDocument::getPhotometricInterpretation ( ) const
inline

get photometric interpretation (color model).

Please note that this is the color model of the decompressed image which might deviate from the color model of the original compressed image.

Returns
photometric interpretation of the DICOM object

◆ getPixelData()

DcmPixelData* DiDocument::getPixelData ( ) const
inline

get pixel data object

Returns
reference to pixel data object (might be NULL)

◆ getSequence()

unsigned long DiDocument::getSequence ( const DcmTagKey tag,
DcmSequenceOfItems *&  seq,
DcmItem item = NULL 
) const

get sequence of given tag

Parameters
tagtag to search for
seqreference to the storage area for the resulting value
itempointer to item in dataset where to start (default: main dataset)
Returns
cardinality if successful, 0 otherwise

◆ getTransferSyntax()

E_TransferSyntax DiDocument::getTransferSyntax ( ) const
inline

get transfer syntax of the DICOM dataset

Returns
transfer syntax

◆ getValue() [1/8]

unsigned long DiDocument::getValue ( const DcmTagKey tag,
const char *&  returnVal,
DcmItem item = NULL 
) const

get value of given tag (const char *)

Parameters
tagtag to search for
returnValreference to the storage area for the resulting value
itempointer to item in dataset where to start (default: main dataset)
Returns
VM if successful, 0 otherwise

◆ getValue() [2/8]

unsigned long DiDocument::getValue ( const DcmTagKey tag,
const Uint16 *&  returnVal,
DcmItem item = NULL 
) const

get value of given tag (Uint16 array)

Parameters
tagtag to search for
returnValreference to the storage area for the resulting value
itempointer to item in dataset where to start (default: main dataset)
Returns
VM / number of values if successful, 0 otherwise

◆ getValue() [3/8]

unsigned long DiDocument::getValue ( const DcmTagKey tag,
double &  returnVal,
const unsigned long  pos = 0,
DcmItem item = NULL 
) const

get value of given tag (double)

Parameters
tagtag to search for
returnValreference to the storage area for the resulting value
posposition in multi-valued elements (starting with 0)
itempointer to item in dataset where to start (default: main dataset)
Returns
VM if successful, 0 otherwise

◆ getValue() [4/8]

unsigned long DiDocument::getValue ( const DcmTagKey tag,
OFString returnVal,
const unsigned long  pos = 0,
DcmItem item = NULL 
) const

get value of given tag (OFString)

Parameters
tagtag to search for
returnValreference to the storage area for the resulting value
posposition in multi-valued elements (starting with 0)
itempointer to item in dataset where to start (default: main dataset)
Returns
VM if successful, 0 otherwise

◆ getValue() [5/8]

unsigned long DiDocument::getValue ( const DcmTagKey tag,
Sint16 &  returnVal,
const unsigned long  pos = 0,
DcmItem item = NULL 
) const

get value of given tag (Sint16)

Parameters
tagtag to search for
returnValreference to the storage area for the resulting value
posposition in multi-valued elements (starting with 0)
itempointer to item in dataset where to start (default: main dataset)
Returns
VM if successful, 0 otherwise

◆ getValue() [6/8]

unsigned long DiDocument::getValue ( const DcmTagKey tag,
Sint32 &  returnVal,
const unsigned long  pos = 0,
DcmItem item = NULL 
) const

get value of given tag (Sint32)

Parameters
tagtag to search for
returnValreference to the storage area for the resulting value
posposition in multi-valued elements (starting with 0)
itempointer to item in dataset where to start (default: main dataset)
Returns
VM if successful, 0 otherwise

◆ getValue() [7/8]

unsigned long DiDocument::getValue ( const DcmTagKey tag,
Uint16 &  returnVal,
const unsigned long  pos = 0,
DcmItem item = NULL,
const OFBool  allowSigned = OFFalse 
) const

get value of given tag (Uint16)

Parameters
tagtag to search for
returnValreference to the storage area for the resulting value
posposition in multi-valued elements (starting with 0)
itempointer to item in dataset where to start (default: main dataset)
allowSignedalso allow signed value (Sint16) if true
Returns
VM if successful, 0 otherwise

◆ getValue() [8/8]

unsigned long DiDocument::getValue ( const DcmTagKey tag,
Uint32 &  returnVal,
const unsigned long  pos = 0,
DcmItem item = NULL 
) const

get value of given tag (Uint32)

Parameters
tagtag to search for
returnValreference to the storage area for the resulting value
posposition in multi-valued elements (starting with 0)
itempointer to item in dataset where to start (default: main dataset)
Returns
VM if successful, 0 otherwise

◆ getVM()

unsigned long DiDocument::getVM ( const DcmTagKey tag) const

get value multiplicity (VM) of given tag

Parameters
tagtag to be searched
Returns
VM if successful, 0 otherwise

◆ good()

int DiDocument::good ( ) const
inline

check whether current document is valid

Returns
status, true if successful, false otherwise

◆ isCompressed()

OFBool DiDocument::isCompressed ( ) const
inline

check whether pixel data only exist in compressed format

Returns
true if pixel data is compressed, false if an uncompressed version exists

References DcmXfer::isEncapsulated().

◆ search() [1/2]

DcmElement* DiDocument::search ( const DcmTagKey tag,
DcmObject obj = NULL 
) const

search for given tag

Parameters
tagtag to search for
objelement in the dataset where the search should start (default: root)
Returns
pointer to element if successful, NULL otherwise

◆ search() [2/2]

int DiDocument::search ( const DcmTagKey tag,
DcmStack stack 
) const

search for given tag and put result(s) on a stack

Parameters
tagtag to search for
stackstack where the result(s) should be stored
Returns
status, true if successful, false otherwise

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


Generated on Thu Jan 14 2021 for DCMTK Version 3.6.6 by Doxygen 1.8.18