This module contains classes to manage DICOM data structures and files. It also provides support for DICOMDIR files as required for DICOM storage media.
The main interface classes are:
Here are some further classes that are of interest:
Tools
This module contains the following command line tools:
Files
The following file provides further documentation:
Examples
The following example shows how to load a DICOM file and output the patient's name:
{
{
cout << "Patient's Name: " << patientName << endl;
} else
cerr << "Error: cannot access Patient's Name!" << endl;
} else
cerr <<
"Error: cannot read DICOM file (" << status.
text() <<
")" << endl;
OFCondition findAndGetOFString(const DcmTagKey &tagKey, OFString &value, const unsigned long pos=0, const OFBool searchIntoSub=OFFalse)
find element and get value as a C++ string (only one component).
General purpose class for condition codes.
Definition: ofcond.h:164
const char * text() const
get a human readable text representation of this error code.
Definition: ofcond.h:277
OFBool good() const
check if the status is OK.
Definition: ofcond.h:293
a simple string class that implements a subset of std::string.
Definition: ofstring.h:76
The following example shows how to create a DICOM dataset and save it to a file:
char uid[100];
cerr <<
"Error: cannot write DICOM file (" << status.
text() <<
")" << endl;
a class handling the DICOM dataset format (files without meta header)
Definition: dcdatset.h:42
OFCondition putAndInsertUint8Array(const DcmTag &tag, const Uint8 *value, const unsigned long count, const OFBool replaceOld=OFTrue)
create a new element, put specified value to it and insert the element into the dataset/item.
OFCondition putAndInsertString(const DcmTag &tag, const char *value, const OFBool replaceOld=OFTrue)
create a new element, put specified value to it and insert the element into the dataset/item.
OFBool bad() const
check if the status is not OK, i.e. error or failure.
Definition: ofcond.h:302
DCMTK_DCMDATA_EXPORT char * dcmGenerateUniqueIdentifier(char *uid, const char *prefix=NULL)
creates a Unique Identifier in uid and returns uid.
#define SITE_INSTANCE_UID_ROOT
UID root for SOP instance UIDs.
Definition: dcuid.h:268
@ EXS_LittleEndianExplicit
Explicit VR Little Endian.
Definition: dcxfer.h:45
The following example shows how to create a general purpose DICOMDIR from multiple files:
{
while ( )
cerr <<
"Error: cannot write DICOMDIR (" << status.
text() <<
")" << endl;
} else
cerr <<
"Error: cannot create DICOMDIR (" << status.
text() <<
")" << endl;
An interface class for simplified creation of a DICOMDIR.
Definition: dcddirif.h:108
OFCondition createNewDicomDir(const E_ApplicationProfile profile=AP_GeneralPurpose, const OFFilename &filename=OFFilename(DEFAULT_DICOMDIR_NAME), const OFString &filesetID=DEFAULT_FILESETID)
create a new DICOMDIR object.
OFCondition addDicomFile(const OFFilename &filename, const OFFilename &directory=OFFilename())
add specified DICOM file to the current DICOMDIR.
OFCondition writeDicomDir(const E_EncodingType encodingType=EET_UndefinedLength, const E_GrpLenEncoding groupLength=EGL_withoutGL)
write the current DICOMDIR object to file.