Public Types | |
enum | E_ApplicationProfile { AP_GeneralPurpose, AP_Default = AP_GeneralPurpose, AP_GeneralPurposeDVD, AP_GeneralPurposeMIME, AP_USBandFlash, AP_MPEG2MPatMLDVD, AP_BasicCardiac, AP_XrayAngiographic, AP_XrayAngiographicDVD, AP_DentalRadiograph, AP_CTandMR, AP_UltrasoundIDSF, AP_UltrasoundSCSF, AP_UltrasoundCCSF, AP_UltrasoundIDMF, AP_UltrasoundSCMF, AP_UltrasoundCCMF, AP_TwelveLeadECG, AP_HemodynamicWaveform } |
list of supported media storage application profiles More... | |
Public Member Functions | |
DicomDirInterface () | |
constructor (default). | |
virtual | ~DicomDirInterface () |
destructor (virtual). | |
void | cleanup () |
reset the object to its initial state. | |
OFBool | isDicomDirValid () const |
check whether current DICOMDIR is valid. | |
OFCondition | createNewDicomDir (const E_ApplicationProfile profile=AP_GeneralPurpose, const char *filename=DEFAULT_DICOMDIR_NAME, const char *filesetID=DEFAULT_FILESETID) |
create a new DICOMDIR object. | |
OFCondition | appendToDicomDir (const E_ApplicationProfile profile, const char *filename) |
create a DICOMDIR object based on an existing DICOMDIR file (append). | |
OFCondition | updateDicomDir (const E_ApplicationProfile profile, const char *filename) |
create a DICOMDIR object based on an existing DICOMDIR file (update). | |
OFCondition | writeDicomDir (const E_EncodingType encodingType=EET_UndefinedLength, const E_GrpLenEncoding groupLength=EGL_withoutGL) |
write the current DICOMDIR object to file. | |
OFBool | isFilenameValid (const char *filename, const OFBool allowEmpty=OFFalse) |
check whether specified filename is valid. | |
OFBool | isCharsetValid (const char *charset) |
check whether given charset identifier is valid. | |
OFCondition | checkDicomFile (const char *filename, const char *directory=NULL) |
check whether specified DICOM file is suitable to be included into the DICOMDIR. | |
OFCondition | addDicomFile (const char *filename, const char *directory=NULL) |
add specified DICOM file to the current DICOMDIR. | |
OFCondition | setFilesetDescriptor (const char *filename, const char *charset=DEFAULT_DESCRIPTOR_CHARSET) |
set the fileset descriptor file ID and character set. | |
OFCondition | setIconSize (const unsigned int size) |
set preferred size of the icon images. | |
OFCondition | setIconPrefix (const char *prefix) |
set filename prefix for alternative icon images. | |
OFCondition | setDefaultIcon (const char *filename) |
set filename of default icon image. | |
OFBool | abortMode () const |
get current status of the "abort on first error" mode. | |
OFBool | mapFilenamesMode () const |
get current status of the "map filenames" mode. | |
OFBool | inventMode () const |
get current status of the "invent missing values" mode. | |
OFBool | inventPatientIDMode () const |
get current status of the "invent missing patient ID" mode. | |
OFBool | retiredSOPClassSupport () const |
get current status of the "retired SOP class support" mode. | |
OFBool | iconImageMode () const |
get current status of the "create icon images" mode. | |
OFBool | backupMode () const |
get current status of the "create backup" mode. | |
OFBool | encodingCheck () const |
get current status of the "pixel encoding check" mode. | |
OFBool | resolutionCheck () const |
get current status of the "spatial resolution check" mode. | |
OFBool | transferSyntaxCheck () const |
get current status of the "transfer syntax check" mode. | |
OFBool | consistencyCheck () const |
get current status of the "consistency check" mode. | |
OFBool | enableAbortMode (const OFBool newMode=OFTrue) |
enable/disable the "abort on first error" mode. | |
OFBool | enableMapFilenamesMode (const OFBool newMode=OFTrue) |
enable/disable the "map filenames" mode. | |
OFBool | enableInventMode (const OFBool newMode=OFTrue) |
enable/disable the "invent missing values" mode. | |
OFBool | enableInventPatientIDMode (const OFBool newMode=OFTrue) |
enable/disable the "invent new patient ID" mode. | |
OFBool | enableRetiredSOPClassSupport (const OFBool newMode=OFTrue) |
enable/disable the "retired SOP class support" mode. | |
OFBool | enableIconImageMode (const OFBool newMode=OFTrue) |
enable/disable the "create icon images" mode. | |
OFBool | disableBackupMode (const OFBool newMode=OFFalse) |
disable/enable the "create backup file" mode. | |
OFBool | disableEncodingCheck (const OFBool newMode=OFFalse) |
disable/enable the "pixel encoding check". | |
OFBool | disableResolutionCheck (const OFBool newMode=OFFalse) |
disable/enable the "spatial resolution check". | |
OFBool | disableTransferSyntaxCheck (const OFBool newMode=OFFalse) |
disable/enable the "transfer syntax check". | |
OFBool | disableConsistencyCheck (const OFBool newMode=OFFalse) |
disable/enable the "consistency check". | |
OFBool | addImageSupport (DicomDirImagePlugin *plugin) |
add pluggable image support. | |
Static Public Member Functions | |
static const char * | getProfileName (const E_ApplicationProfile profile) |
get name/identifier associated with the given application profile | |
Protected Member Functions | |
OFCondition | selectApplicationProfile (const E_ApplicationProfile profile) |
select given application profile | |
OFCondition | loadAndCheckDicomFile (const char *filename, const char *directory, DcmFileFormat &fileformat) |
load and check DICOM file regarding the current application profile | |
OFCondition | checkSOPClassAndXfer (DcmMetaInfo *metainfo, DcmItem *dataset, const char *filename) |
check SOP class and transfer syntax for compliance with current profile | |
OFCondition | checkBasicCardiacAttributes (DcmItem *dataset, const char *filename) |
check attributes for compliance with Basic Cardiac application profile | |
OFCondition | checkXrayAngiographicAttributes (DcmItem *dataset, const OFString &sopClass, const char *filename) |
check attributes for compliance with X-ray Angiography application profile | |
OFCondition | checkDentalRadiographAttributes (DcmItem *dataset, const char *filename) |
check attributes for compliance with dental radiograph application profile | |
OFCondition | checkCTandMRAttributes (DcmItem *dataset, const OFString &sopClass, const char *filename) |
check attributes for compliance with CT and MR application profile | |
OFCondition | checkUltrasoundAttributes (DcmItem *dataset, const OFString &transferSyntax, const char *filename) |
check attributes for compliance with Ultrasound application profiles | |
OFCondition | checkMandatoryAttributes (DcmMetaInfo *metainfo, DcmItem *dataset, const char *filename) |
check attributes for comliance with current application profile | |
OFBool | recordMatchesDataset (DcmDirectoryRecord *record, DcmItem *dataset) |
check whether given directory record matches dataset. | |
DcmDirectoryRecord * | findExistingRecord (DcmDirectoryRecord *parent, const E_DirRecType recordType, DcmItem *dataset) |
search for a given directory record | |
DcmDirectoryRecord * | buildPatientRecord (DcmDirectoryRecord *record, DcmItem *dataset, const OFString &sourceFilename) |
create or update patient record and copy required values from dataset | |
DcmDirectoryRecord * | buildStudyRecord (DcmDirectoryRecord *record, DcmItem *dataset, const OFString &sourceFilename) |
create or update study record and copy required values from dataset | |
DcmDirectoryRecord * | buildSeriesRecord (DcmDirectoryRecord *record, DcmItem *dataset, const OFString &sourceFilename) |
create or update new series record and copy required values from dataset | |
DcmDirectoryRecord * | buildOverlayRecord (DcmDirectoryRecord *record, DcmItem *dataset, const OFString &referencedFileID, const OFString &sourceFilename) |
create or update overlay record and copy required values from dataset | |
DcmDirectoryRecord * | buildModalityLutRecord (DcmDirectoryRecord *record, DcmItem *dataset, const OFString &referencedFileID, const OFString &sourceFilename) |
create or update modality LUT record and copy required values from dataset | |
DcmDirectoryRecord * | buildVoiLutRecord (DcmDirectoryRecord *record, DcmItem *dataset, const OFString &referencedFileID, const OFString &sourceFilename) |
create or update VOI LUT record and copy required values from dataset | |
DcmDirectoryRecord * | buildCurveRecord (DcmDirectoryRecord *record, DcmItem *dataset, const OFString &referencedFileID, const OFString &sourceFilename) |
create or update curve record and copy required values from dataset | |
DcmDirectoryRecord * | buildStructReportRecord (DcmDirectoryRecord *record, DcmItem *dataset, const OFString &referencedFileID, const OFString &sourceFilename) |
create or update structure reporting record and copy required values from dataset | |
DcmDirectoryRecord * | buildPresentationRecord (DcmDirectoryRecord *record, DcmItem *dataset, const OFString &referencedFileID, const OFString &sourceFilename) |
create or update presentation state record and copy required values from dataset | |
DcmDirectoryRecord * | buildWaveformRecord (DcmDirectoryRecord *record, DcmItem *dataset, const OFString &referencedFileID, const OFString &sourceFilename) |
create or update waveform record and copy required values from dataset | |
DcmDirectoryRecord * | buildRTDoseRecord (DcmDirectoryRecord *record, DcmItem *dataset, const OFString &referencedFileID, const OFString &sourceFilename) |
create or update RT dose record and copy required values from dataset | |
DcmDirectoryRecord * | buildRTStructureSetRecord (DcmDirectoryRecord *record, DcmItem *dataset, const OFString &referencedFileID, const OFString &sourceFilename) |
create or update RT structure set record and copy required values from dataset | |
DcmDirectoryRecord * | buildRTPlanRecord (DcmDirectoryRecord *record, DcmItem *dataset, const OFString &referencedFileID, const OFString &sourceFilename) |
create or update RT plan record and copy required values from dataset | |
DcmDirectoryRecord * | buildRTTreatmentRecord (DcmDirectoryRecord *record, DcmItem *dataset, const OFString &referencedFileID, const OFString &sourceFilename) |
create or update RT treatment record and copy required values from dataset | |
DcmDirectoryRecord * | buildStoredPrintRecord (DcmDirectoryRecord *record, DcmItem *dataset, const OFString &referencedFileID, const OFString &sourceFilename) |
create or update stored print record and copy required values from dataset | |
DcmDirectoryRecord * | buildKeyObjectDocRecord (DcmDirectoryRecord *record, DcmItem *dataset, const OFString &referencedFileID, const OFString &sourceFilename) |
create or update key object doc record and copy required values from dataset | |
DcmDirectoryRecord * | buildRegistrationRecord (DcmDirectoryRecord *record, DcmItem *dataset, const OFString &referencedFileID, const OFString &sourceFilename) |
create or update registration record and copy required values from dataset | |
DcmDirectoryRecord * | buildFiducialRecord (DcmDirectoryRecord *record, DcmItem *dataset, const OFString &referencedFileID, const OFString &sourceFilename) |
create or update fiducial record and copy required values from dataset | |
DcmDirectoryRecord * | buildRawDataRecord (DcmDirectoryRecord *record, DcmItem *dataset, const OFString &referencedFileID, const OFString &sourceFilename) |
create or update raw data record and copy required values from dataset | |
DcmDirectoryRecord * | buildSpectroscopyRecord (DcmDirectoryRecord *record, DcmItem *dataset, const OFString &referencedFileID, const OFString &sourceFilename) |
create or update spectroscopy record and copy required values from dataset | |
DcmDirectoryRecord * | buildEncapDocRecord (DcmDirectoryRecord *record, DcmItem *dataset, const OFString &referencedFileID, const OFString &sourceFilename) |
create or update encap doc record and copy required values from dataset | |
DcmDirectoryRecord * | buildValueMapRecord (DcmDirectoryRecord *record, DcmItem *dataset, const OFString &referencedFileID, const OFString &sourceFilename) |
create or update value map record and copy required values from dataset | |
DcmDirectoryRecord * | buildHangingProtocolRecord (DcmDirectoryRecord *record, DcmItem *dataset, const OFString &referencedFileID, const OFString &sourceFilename) |
create or update hanging protocol record and copy required values from dataset | |
DcmDirectoryRecord * | buildStereometricRecord (DcmDirectoryRecord *record, DcmItem *dataset, const OFString &referencedFileID, const OFString &sourceFilename) |
create or update stereometric record and copy required values from dataset | |
DcmDirectoryRecord * | buildPaletteRecord (DcmDirectoryRecord *record, DcmItem *dataset, const OFString &referencedFileID, const OFString &sourceFilename) |
create or update palette record and copy required values from dataset | |
DcmDirectoryRecord * | buildSurfaceRecord (DcmDirectoryRecord *record, DcmItem *dataset, const OFString &referencedFileID, const OFString &sourceFilename) |
create or update surface record and copy required values from dataset | |
DcmDirectoryRecord * | buildMeasurementRecord (DcmDirectoryRecord *record, DcmItem *dataset, const OFString &referencedFileID, const OFString &sourceFilename) |
create or update measurement record and copy required values from dataset | |
DcmDirectoryRecord * | buildImplantRecord (DcmDirectoryRecord *record, DcmItem *dataset, const OFString &referencedFileID, const OFString &sourceFilename) |
create or update implant record and copy required values from dataset | |
DcmDirectoryRecord * | buildImplantGroupRecord (DcmDirectoryRecord *record, DcmItem *dataset, const OFString &referencedFileID, const OFString &sourceFilename) |
create or update implant group record and copy required values from dataset | |
DcmDirectoryRecord * | buildImplantAssyRecord (DcmDirectoryRecord *record, DcmItem *dataset, const OFString &referencedFileID, const OFString &sourceFilename) |
create or update implant assy record and copy required values from dataset | |
DcmDirectoryRecord * | buildImageRecord (DcmDirectoryRecord *record, DcmItem *dataset, const OFString &referencedFileID, const OFString &sourceFilename) |
create or update image record and copy required values from dataset | |
OFBool | getIconFromFile (const OFString &filename, Uint8 *pixel, const unsigned long count, const unsigned int width, const unsigned int height) |
create icon image from given PGM (portable gray map) file. | |
OFBool | getIconFromDataset (DcmItem *dataset, Uint8 *pixel, const unsigned long count, const unsigned int width, const unsigned int height) |
create icon image from DICOM dataset. | |
OFCondition | addIconImage (DcmDirectoryRecord *record, DcmItem *dataset, const unsigned int size, const OFString &sourceFilename) |
add icon image sequence to directory record. | |
DcmDirectoryRecord * | addRecord (DcmDirectoryRecord *parent, const E_DirRecType recordType, DcmItem *dataset, const OFString &referencedFileID, const OFString &sourceFilename) |
add child record to a given parent record. | |
OFBool | checkReferencedSOPInstance (DcmDirectoryRecord *record, DcmItem *dataset, const OFString &referencedFileID, const OFString &sourceFilename) |
check referenced SOP instance for consistency with a new directory record | |
void | inventMissingAttributes (DcmDirectoryRecord *parent, const OFBool recurse=OFTrue) |
invent missing type 1 attributes for all child records (from patient level) | |
void | inventMissingStudyLevelAttributes (DcmDirectoryRecord *parent) |
invent missing type 1 attributes for all child records (from study level) | |
void | inventMissingSeriesLevelAttributes (DcmDirectoryRecord *parent) |
invent missing type 1 attributes for all child records (from series level) | |
void | inventMissingInstanceLevelAttributes (DcmDirectoryRecord *parent) |
invent missing type 1 attributes for all child records (from instance level) | |
void | createDicomDirBackup (const char *filename) |
create backup of a given file | |
void | deleteDicomDirBackup () |
delete backup file if one has been created | |
void | printUnexpectedValueMessage (const DcmTagKey &key, const char *filename=NULL, const OFBool errorMsg=OFTrue) |
print a message that the value of a given tag is unexpected. | |
void | printRequiredAttributeMessage (const DcmTagKey &key, const char *filename=NULL, const OFBool emptyMsg=OFFalse) |
print an error message that a required attribute is missing/empty. | |
void | printAttributeErrorMessage (const DcmTagKey &key, const OFCondition &error, const char *operation) |
print an error message that something went wrong with an attribute. | |
void | printRecordErrorMessage (const OFCondition &error, const E_DirRecType recordType, const char *operation) |
print an error message that something went wrong with a given record. | |
OFBool | copyFile (const char *fromFilename, const char *toFilename) |
copy contents of specified file | |
OFBool | warnAboutInconsistentAttributes (DcmDirectoryRecord *record, DcmItem *dataset, const OFString &sourceFilename, const OFBool abortCheck=OFFalse) |
see if all the attributes in record match the values in dataset and warn if not | |
OFBool | checkFilesetID (const OFString &filesetID) |
check whether given fileset ID is valid | |
OFBool | checkExists (DcmItem *dataset, const DcmTagKey &key, const char *filename=NULL) |
check whether given tag exists in the DICOM dataset | |
OFBool | checkExistsWithValue (DcmItem *dataset, const DcmTagKey &key, const char *filename=NULL) |
check whether given tag exists with a value in the DICOM dataset | |
OFBool | checkExistsWithStringValue (DcmItem *dataset, const DcmTagKey &key, const OFString &value, const char *filename=NULL) |
check whether given tag exists in the DICOM dataset and has the expected string value | |
OFBool | checkExistsWithIntegerValue (DcmItem *dataset, const DcmTagKey &key, const long value, const char *filename=NULL, const OFBool reject=OFTrue) |
check whether given tag exists in the DICOM dataset and has the expected integer value | |
OFBool | checkExistsWithMinMaxValue (DcmItem *dataset, const DcmTagKey &key, const long min, const long max, const char *filename=NULL, const OFBool reject=OFTrue) |
check whether given tag exists in the DICOM dataset and has an integer value in the expected range | |
OFString & | getStringFromDataset (DcmItem *dataset, const DcmTagKey &key, OFString &result, OFBool searchIntoSub=OFFalse) |
get string value from dataset and report an error (if any) | |
OFString & | getStringComponentFromDataset (DcmItem *dataset, const DcmTagKey &key, OFString &result, const unsigned long pos, OFBool searchIntoSub=OFFalse) |
get string value component from dataset and report an error (if any) | |
OFString & | getStringFromFile (const char *filename, const DcmTagKey &key, OFString &result, OFBool searchIntoSub=OFFalse) |
get string value from file and report an error (if any) | |
void | copyElement (DcmItem *dataset, const DcmTagKey &key, DcmDirectoryRecord *record, const OFString &sourceFilename, const OFBool optional=OFFalse, const OFBool copyEmpty=OFTrue) |
copy element from dataset to directory record | |
void | copyElementType1 (DcmItem *dataset, const DcmTagKey &key, DcmDirectoryRecord *record, const OFString &sourceFilename) |
copy type 1 element from dataset to directory record | |
void | copyElementType1C (DcmItem *dataset, const DcmTagKey &key, DcmDirectoryRecord *record, const OFString &sourceFilename) |
copy type 1C element from dataset to directory record | |
void | copyElementType2 (DcmItem *dataset, const DcmTagKey &key, DcmDirectoryRecord *record, const OFString &sourceFilename) |
copy type 2 element from dataset to directory record | |
void | copyElementType3 (DcmItem *dataset, const DcmTagKey &key, DcmDirectoryRecord *record, const OFString &sourceFilename) |
copy type 3 element from dataset to directory record | |
void | copyStringWithDefault (DcmItem *dataset, const DcmTagKey &key, DcmDirectoryRecord *record, const OFString &sourceFilename, const char *defaultValue="", const OFBool printWarning=OFFalse) |
copy optional string value from dataset to directory record | |
OFBool | compareStringAttributes (DcmItem *dataset, const DcmTagKey &datKey, DcmDirectoryRecord *record, const DcmTagKey &recKey, const OFString &sourceFilename, const OFBool errorMsg=OFFalse) |
compare string attribute from dataset and record and report any deviation | |
OFBool | compareSequenceAttributes (DcmItem *dataset, DcmTagKey &key, DcmDirectoryRecord *record, const OFString &sourceFilename) |
compare sequence attribute from dataset and record and report any deviation | |
void | setDefaultValue (DcmDirectoryRecord *record, const DcmTagKey &key, const unsigned long number, const char *prefix=NULL) |
set default value (number or prefix and number) to a given tag | |
Private Member Functions | |
DicomDirInterface (const DicomDirInterface &obj) | |
private undefined copy constructor | |
DicomDirInterface & | operator= (const DicomDirInterface &obj) |
private undefined assignment operator | |
Private Attributes | |
DcmDicomDir * | DicomDir |
pointer to the current DICOMDIR object | |
DicomDirImagePlugin * | ImagePlugin |
pointer to the optional image plugin (required for icon image support) | |
E_ApplicationProfile | ApplicationProfile |
currently selected application profile | |
OFBool | BackupMode |
create DICOMDIR backup | |
OFBool | AbortMode |
abort on first inconsistent record | |
OFBool | MapFilenamesMode |
automatically map filenames | |
OFBool | InventMode |
invent missing attributes mode | |
OFBool | InventPatientIDMode |
invent missing patient ID mode | |
OFBool | RetiredSOPClassSupport |
support retired SOP classes | |
OFBool | EncodingCheck |
check pixel encoding | |
OFBool | ResolutionCheck |
check image resolution | |
OFBool | TransferSyntaxCheck |
check transfer syntax | |
OFBool | ConsistencyCheck |
check consistency of newly added record | |
OFBool | IconImageMode |
create icon images | |
OFBool | FilesetUpdateMode |
update existing fileset | |
OFString | BackupFilename |
name of the DICOMDIR backup file | |
OFBool | BackupCreated |
flag indicating whether a backup has been created | |
unsigned int | IconSize |
size of the optional icon image in pixels | |
OFString | IconPrefix |
filename prefix for the external icon images | |
OFString | DefaultIcon |
filename of the default icon (if any) | |
OFBool | RLESupport |
flag indicating whether RLE decompression is supported | |
OFBool | JPEGSupport |
flag indicating whether JPEG decompression is supported | |
OFBool | JP2KSupport |
flag indicating whether JPEG 2000 decompression is supported | |
unsigned long | AutoPatientNumber |
current patient number used to invent missing attribute values | |
unsigned long | AutoStudyNumber |
current study number used to invent missing attribute values | |
unsigned long | AutoSeriesNumber |
current series number used to invent missing attribute values | |
unsigned long | AutoInstanceNumber |
current instance number used to invent missing attribute values | |
unsigned long | AutoOverlayNumber |
current overlay number used to invent missing attribute values | |
unsigned long | AutoLutNumber |
current LUT number used to invent missing attribute values | |
unsigned long | AutoCurveNumber |
current curve number used to invent missing attribute values |
Definition at line 111 of file dcddirif.h.
list of supported media storage application profiles
Definition at line 118 of file dcddirif.h.
DicomDirInterface::DicomDirInterface | ( | ) |
constructor (default).
No DICOMDIR object is created by default (see methods createNewDicomDir, appendToDicomDir and updateDicomDir).
virtual DicomDirInterface::~DicomDirInterface | ( | ) | [virtual] |
destructor (virtual).
Free all memory allocated by this class.
void DicomDirInterface::cleanup | ( | ) |
reset the object to its initial state.
That means e.g. free memory.
OFBool DicomDirInterface::isDicomDirValid | ( | ) | const |
check whether current DICOMDIR is valid.
That means e.g. that it can be written to a file.
OFCondition DicomDirInterface::createNewDicomDir | ( | const E_ApplicationProfile | profile = AP_GeneralPurpose , |
|
const char * | filename = DEFAULT_DICOMDIR_NAME , |
|||
const char * | filesetID = DEFAULT_FILESETID | |||
) |
create a new DICOMDIR object.
This function replaces any previously existing DICOMDIR file with the specified 'filename'. If the backup mode (see 'enableBackupMode') is enabled a backup copy ('filename' + ".BAK") is created from the existing file and automatically deleted after the new file has been written without any errors.
profile | media storage application profile to be used for the DICOMDIR | |
filename | name of the DICOMDIR file to be created (default: 'DICOMDIR'). The filename may include a fully qualified pathname. | |
filesetID | value of the attribute FileSetID (default: 'DCMTK_MEDIA_DEMO') |
OFCondition DicomDirInterface::appendToDicomDir | ( | const E_ApplicationProfile | profile, | |
const char * | filename | |||
) |
create a DICOMDIR object based on an existing DICOMDIR file (append).
This function can be used to append new entries to an existing DICOMDIR file. If the backup mode (see 'enableBackupMode') is enabled a backup copy ('filename' + ".BAK") is created from the existing file and automatically deleted after the new file has been written without any errors.
profile | media storage application profile to be used for the DICOMDIR. NB: The same profile should be used as for the creation of the DICOMDIR file. | |
filename | name of the DICOMDIR file to be appended. The filename may include a fully qualified pathname. |
OFCondition DicomDirInterface::updateDicomDir | ( | const E_ApplicationProfile | profile, | |
const char * | filename | |||
) |
create a DICOMDIR object based on an existing DICOMDIR file (update).
This function can be used to append new entries to and update existing entries in an existing DICOMDIR file. If the backup mode (see 'enableBackupMode') is enabled a backup copy ('filename' + ".BAK") is created from the existing file and automatically deleted after the new file has been written without any errors.
profile | media storage application profile to be used for the DICOMDIR | |
filename | name of the DICOMDIR file to be appended. The filename may include a fully qualified pathname. |
OFCondition DicomDirInterface::writeDicomDir | ( | const E_EncodingType | encodingType = EET_UndefinedLength , |
|
const E_GrpLenEncoding | groupLength = EGL_withoutGL | |||
) |
write the current DICOMDIR object to file.
NB: The filename has already been specified for the object creation (see above).
encodingType | flag, specifying the encoding with undefined or explicit length | |
groupLength | flag, specifying how to handle the group length tags |
OFBool DicomDirInterface::isFilenameValid | ( | const char * | filename, | |
const OFBool | allowEmpty = OFFalse | |||
) |
check whether specified filename is valid.
i.e. conforms to the DICOM standard requirements (length, number of components and proper characters). This function is called automatically for the following methods: checkDicomFile(), addDicomFile() and setFilesetDescriptor(). So usually there's no need to call it manually (especially not in addition to the above mentioned methods).
filename | filename to be checked for standard conformance | |
allowEmpty | empty filename (zero length) allowed if OFTrue |
OFBool DicomDirInterface::isCharsetValid | ( | const char * | charset | ) |
check whether given charset identifier is valid.
Valid character sets are (see DICOM PS3.3 for details): ISO_IR 100, ISO_IR 101, ISO_IR 109, ISO_IR 110, ISO_IR 144, ISO_IR 127, ISO_IR 126, ISO_IR 138, ISO_IR 148, ISO_IR 166, ISO_IR 13, ISO_IR 192.
charset | character set identifier to be checked |
OFCondition DicomDirInterface::checkDicomFile | ( | const char * | filename, | |
const char * | directory = NULL | |||
) |
check whether specified DICOM file is suitable to be included into the DICOMDIR.
This method loads the given file and checks whether it conforms to the current application profile. Since this check is also performed by addDicomFile() there is usually no need to call this method directly.
filename | name of the DICOM file to be checked | |
directory | directory where the DICOM file is stored (optional). This parameter might be useful in cases where the DICOM file is not (yet) stored in the final directory (i.e. "relative" to the DICOMDIR location). |
OFCondition DicomDirInterface::addDicomFile | ( | const char * | filename, | |
const char * | directory = NULL | |||
) |
add specified DICOM file to the current DICOMDIR.
This method loads the given file, checks whether it conforms to the current application profile and finally adds it to the DICOMDIR (in case of conformance).
filename | name of the DICOM file to be added | |
directory | directory where the DICOM file is stored (optional). This parameter might be useful in cases where the DICOM file is not (yet) stored in the final directory (i.e. "relative" to the DICOMDIR location). |
OFCondition DicomDirInterface::setFilesetDescriptor | ( | const char * | filename, | |
const char * | charset = DEFAULT_DESCRIPTOR_CHARSET | |||
) |
set the fileset descriptor file ID and character set.
Prior to any internal modification both 'filename' and 'charset' are checked using the above checking routines. Existence of 'filename' is not checked. NB: Requires a DICOMDIR to exist (see createNewDicomDir and appendToDicomDir).
filename | name of the fileset descriptor file to be set | |
charset | character set of the fileset descriptor file to be set. default: ISO Latin 1 ("ISO_IR 100"), use NULL or empty string to omit value. |
OFCondition DicomDirInterface::setIconSize | ( | const unsigned int | size | ) |
set preferred size of the icon images.
NB: some application profiles require a particicular icon size. In those cases this manual setting is implicitly ignored.
size | size of the icon images in pixels (1..256, initial: 64) |
OFCondition DicomDirInterface::setIconPrefix | ( | const char * | prefix | ) |
set filename prefix for alternative icon images.
If non-empty the filename prefix is used to create the icon image from an externally stored PGM (portable gray map, 8 bit binary) file instead of the DICOM image file. The PGM filename is: 'prefix' + 'dicom_filename'. The image does not need to have the correct size as it is scaled automatically.
prefix | filename prefix (NULL to disable = default) |
OFCondition DicomDirInterface::setDefaultIcon | ( | const char * | filename | ) |
set filename of default icon image.
For cases that the icon image cannot be created (neither from PGM nor from DICOM file, respectively) a default icon (8 bit binary PGM) can be specified. If this image also fails to load a black icon (filled with zeros) is used.
filename | name of the default PGM file |
OFBool DicomDirInterface::abortMode | ( | ) | const [inline] |
get current status of the "abort on first error" mode.
See enableAbortMode() for more details.
Definition at line 323 of file dcddirif.h.
References AbortMode.
OFBool DicomDirInterface::mapFilenamesMode | ( | ) | const [inline] |
get current status of the "map filenames" mode.
See enableMapFilenamesMode() for more details.
Definition at line 332 of file dcddirif.h.
References MapFilenamesMode.
OFBool DicomDirInterface::inventMode | ( | ) | const [inline] |
get current status of the "invent missing values" mode.
See enableInventMode() for more details.
Definition at line 341 of file dcddirif.h.
References InventMode.
OFBool DicomDirInterface::inventPatientIDMode | ( | ) | const [inline] |
get current status of the "invent missing patient ID" mode.
See enableInventPatientIDMode() for more details.
Definition at line 350 of file dcddirif.h.
References InventPatientIDMode.
OFBool DicomDirInterface::retiredSOPClassSupport | ( | ) | const [inline] |
get current status of the "retired SOP class support" mode.
See enableRetiredSOPClassSupport() for more details.
Definition at line 359 of file dcddirif.h.
References RetiredSOPClassSupport.
OFBool DicomDirInterface::iconImageMode | ( | ) | const [inline] |
get current status of the "create icon images" mode.
See enableIconImageMode() for more details.
Definition at line 368 of file dcddirif.h.
References IconImageMode.
OFBool DicomDirInterface::backupMode | ( | ) | const [inline] |
get current status of the "create backup" mode.
See enableBackupMode() for more details.
Definition at line 377 of file dcddirif.h.
References BackupMode.
OFBool DicomDirInterface::encodingCheck | ( | ) | const [inline] |
get current status of the "pixel encoding check" mode.
See disableEncodingCheck() for more details.
Definition at line 386 of file dcddirif.h.
References EncodingCheck.
OFBool DicomDirInterface::resolutionCheck | ( | ) | const [inline] |
get current status of the "spatial resolution check" mode.
See disableResolutionCheck() for more details.
Definition at line 395 of file dcddirif.h.
References ResolutionCheck.
OFBool DicomDirInterface::transferSyntaxCheck | ( | ) | const [inline] |
get current status of the "transfer syntax check" mode.
See disableTransferSyntaxCheck() for more details.
Definition at line 404 of file dcddirif.h.
References TransferSyntaxCheck.
OFBool DicomDirInterface::consistencyCheck | ( | ) | const [inline] |
get current status of the "consistency check" mode.
See enableConsistencyCheck() for more details.
Definition at line 413 of file dcddirif.h.
References ConsistencyCheck.
OFBool DicomDirInterface::enableAbortMode | ( | const OFBool | newMode = OFTrue |
) |
enable/disable the "abort on first error" mode.
If the mode is enabled addDicomFile() reports an error message and returns with an error status code if something went wrong. Default: off, do not abort
newMode | enable mode if OFTrue, disable if OFFalse |
OFBool DicomDirInterface::enableMapFilenamesMode | ( | const OFBool | newMode = OFTrue |
) |
enable/disable the "map filenames" mode.
If the mode is enabled filenames are automatically mapped to DICOM format (convert lower case to upper case characters and remove trailing period). Default: off, do not map filenames
newMode | enable mode if OFTrue, disable if OFFalse |
OFBool DicomDirInterface::enableInventMode | ( | const OFBool | newMode = OFTrue |
) |
enable/disable the "invent missing values" mode.
If the mode is enabled required DICOMDIR attributes (type 1) are invented when missing in the DICOM file. Default: off, do not invent attribute values
newMode | enable mode if OFTrue, disable if OFFalse |
OFBool DicomDirInterface::enableInventPatientIDMode | ( | const OFBool | newMode = OFTrue |
) |
enable/disable the "invent new patient ID" mode.
If the mode is enabled a new PatientID is invented in case of inconsistent PatientName attributes, i.e. when different patients share the same ID. Default: off, do not invent new patient ID
newMode | enable mode if OFTrue, disable if OFFalse |
OFBool DicomDirInterface::enableRetiredSOPClassSupport | ( | const OFBool | newMode = OFTrue |
) |
enable/disable the "retired SOP class support" mode.
If the mode is enabled retired SOP classes defined in previous editions of the DICOM standard are also accepted. Default: off, do not accept retired SOP classes
newMode | enable mode if OFTrue, disable if OFFalse |
OFBool DicomDirInterface::enableIconImageMode | ( | const OFBool | newMode = OFTrue |
) |
enable/disable the "create icon images" mode.
If the mode is enabled icon images are created for each IMAGE record. Please note that particular application profiles (e.g. Basic Cardiac) require an icon images to be present. Therefore, this mode does not affect the icon images creation of such profiles. Default: off, do not create (optional) icon images
newMode | enable mode if OFTrue, disable if OFFalse |
OFBool DicomDirInterface::disableBackupMode | ( | const OFBool | newMode = OFFalse |
) |
disable/enable the "create backup file" mode.
If this mode is disabled no backup file of an existing DICOMDIR is created. However, when appending new files to an existing DICOMDIR a _temporary_ backup file "<dicomdir>.$$$" is always created. Default: on, create a backup file "<dicomdir>.BAK"
newMode | disable mode if OFFalse, enable if OFTrue |
OFBool DicomDirInterface::disableEncodingCheck | ( | const OFBool | newMode = OFFalse |
) |
disable/enable the "pixel encoding check".
If this mode is disabled the pixel encoding is not check for compliance with the selected application profile. Please use this switch with care since the resulting DICOMDIR will probably violate the rules for the selected application profile. Default: on, check pixel encoding (bits allocated/stored, high bit)
newMode | disable check if OFFalse, enable if OFTrue |
OFBool DicomDirInterface::disableResolutionCheck | ( | const OFBool | newMode = OFFalse |
) |
disable/enable the "spatial resolution check".
If this mode is disabled the spatial resolution is not check for compliance with the selected application profile. Please use this switch with care since the resulting DICOMDIR will probably violate the rules for the selected application profile. Default: on, check spatial resolution
newMode | disable check if OFFalse, enable if OFTrue |
OFBool DicomDirInterface::disableTransferSyntaxCheck | ( | const OFBool | newMode = OFFalse |
) |
disable/enable the "transfer syntax check".
If this mode is disabled the transfer syntax is not check for compliance with the selected application profile. Please use this switch with care since the resulting DICOMDIR will probably violate the rules for the selected application profile. Default: on, check transfer syntax
newMode | disable check if OFFalse, enable if OFTrue |
OFBool DicomDirInterface::disableConsistencyCheck | ( | const OFBool | newMode = OFFalse |
) |
disable/enable the "consistency check".
If this mode is disabled the consistency of newly added records with already existing ones is not checked (see 'warnAboutInconsistentAttributes' for details). Default: on, perform consistency check
newMode | disable check if OFFalse, enable if OFTrue |
OFBool DicomDirInterface::addImageSupport | ( | DicomDirImagePlugin * | plugin | ) |
add pluggable image support.
NB: This plugin is required to create icon images from DICOM files!
plugin | pointer to an instance of the plugin implementation. See class DicomDirImageImplementation (dcmjpeg/include/ddpiimpl.h). |
static const char* DicomDirInterface::getProfileName | ( | const E_ApplicationProfile | profile | ) | [static] |
get name/identifier associated with the given application profile
profile | media storage application profile |
OFCondition DicomDirInterface::selectApplicationProfile | ( | const E_ApplicationProfile | profile | ) | [protected] |
select given application profile
profile | storage media application profile to be selected |
OFCondition DicomDirInterface::loadAndCheckDicomFile | ( | const char * | filename, | |
const char * | directory, | |||
DcmFileFormat & | fileformat | |||
) | [protected] |
load and check DICOM file regarding the current application profile
filename | name of the DICOM file to be checked | |
directory | directory where the DICOM file is stored (optional) | |
fileformat | object in which the loaded data is stored |
OFCondition DicomDirInterface::checkSOPClassAndXfer | ( | DcmMetaInfo * | metainfo, | |
DcmItem * | dataset, | |||
const char * | filename | |||
) | [protected] |
check SOP class and transfer syntax for compliance with current profile
metainfo | object where the DICOM file meta information is stored | |
dataset | object where the DICOM dataset is stored | |
filename | name of the DICOM file to be checked |
OFCondition DicomDirInterface::checkBasicCardiacAttributes | ( | DcmItem * | dataset, | |
const char * | filename | |||
) | [protected] |
check attributes for compliance with Basic Cardiac application profile
dataset | object where the DICOM dataset is stored | |
filename | name of the DICOM file to be checked |
OFCondition DicomDirInterface::checkXrayAngiographicAttributes | ( | DcmItem * | dataset, | |
const OFString & | sopClass, | |||
const char * | filename | |||
) | [protected] |
check attributes for compliance with X-ray Angiography application profile
dataset | object where the DICOM dataset is stored | |
sopClass | SOP class of the DICOM data to be checked | |
filename | name of the DICOM file to be checked |
OFCondition DicomDirInterface::checkDentalRadiographAttributes | ( | DcmItem * | dataset, | |
const char * | filename | |||
) | [protected] |
check attributes for compliance with dental radiograph application profile
dataset | object where the DICOM dataset is stored | |
filename | name of the DICOM file to be checked |
OFCondition DicomDirInterface::checkCTandMRAttributes | ( | DcmItem * | dataset, | |
const OFString & | sopClass, | |||
const char * | filename | |||
) | [protected] |
check attributes for compliance with CT and MR application profile
dataset | object where the DICOM dataset is stored | |
sopClass | SOP class of the DICOM data to be checked | |
filename | name of the DICOM file to be checked |
OFCondition DicomDirInterface::checkUltrasoundAttributes | ( | DcmItem * | dataset, | |
const OFString & | transferSyntax, | |||
const char * | filename | |||
) | [protected] |
check attributes for compliance with Ultrasound application profiles
dataset | object where the DICOM dataset is stored | |
transferSyntax | transfer syntax of the DICOM data to be checked | |
filename | name of the DICOM file to be checked |
OFCondition DicomDirInterface::checkMandatoryAttributes | ( | DcmMetaInfo * | metainfo, | |
DcmItem * | dataset, | |||
const char * | filename | |||
) | [protected] |
check attributes for comliance with current application profile
metainfo | object where the DICOM file meta information is stored | |
dataset | object where the DICOM dataset is stored | |
filename | name of the DICOM file to be checked |
OFBool DicomDirInterface::recordMatchesDataset | ( | DcmDirectoryRecord * | record, | |
DcmItem * | dataset | |||
) | [protected] |
check whether given directory record matches dataset.
The check depends on the record type and is performed mainly based on the unique key defined for the particular record type (e.g. SOPInstanceUID for IMAGE records). For PATIENT records the PatientName may also be used if the PatientID is absent.
record | directory record to be checked | |
dataset | DICOM dataset of the current file |
DcmDirectoryRecord* DicomDirInterface::findExistingRecord | ( | DcmDirectoryRecord * | parent, | |
const E_DirRecType | recordType, | |||
DcmItem * | dataset | |||
) | [protected] |
search for a given directory record
parent | higher-level structure where the records are stored | |
recordType | type of directory record to be searched for | |
dataset | DICOM dataset of the current file |
DcmDirectoryRecord* DicomDirInterface::buildPatientRecord | ( | DcmDirectoryRecord * | record, | |
DcmItem * | dataset, | |||
const OFString & | sourceFilename | |||
) | [protected] |
create or update patient record and copy required values from dataset
record | record to be updated, use NULL to create a new one | |
dataset | DICOM dataset of the current file | |
sourceFilename | name of the source DICOM file |
DcmDirectoryRecord* DicomDirInterface::buildStudyRecord | ( | DcmDirectoryRecord * | record, | |
DcmItem * | dataset, | |||
const OFString & | sourceFilename | |||
) | [protected] |
create or update study record and copy required values from dataset
record | record to be updated, use NULL to create a new one | |
dataset | DICOM dataset of the current file | |
sourceFilename | name of the source DICOM file |
DcmDirectoryRecord* DicomDirInterface::buildSeriesRecord | ( | DcmDirectoryRecord * | record, | |
DcmItem * | dataset, | |||
const OFString & | sourceFilename | |||
) | [protected] |
create or update new series record and copy required values from dataset
record | record to be updated, use NULL to create a new one | |
dataset | DICOM dataset of the current file | |
sourceFilename | name of the source DICOM file |
DcmDirectoryRecord* DicomDirInterface::buildOverlayRecord | ( | DcmDirectoryRecord * | record, | |
DcmItem * | dataset, | |||
const OFString & | referencedFileID, | |||
const OFString & | sourceFilename | |||
) | [protected] |
create or update overlay record and copy required values from dataset
record | record to be updated, use NULL to create a new one | |
dataset | DICOM dataset of the current file | |
referencedFileID | value of the Referenced File ID attribute | |
sourceFilename | name of the source DICOM file |
DcmDirectoryRecord* DicomDirInterface::buildModalityLutRecord | ( | DcmDirectoryRecord * | record, | |
DcmItem * | dataset, | |||
const OFString & | referencedFileID, | |||
const OFString & | sourceFilename | |||
) | [protected] |
create or update modality LUT record and copy required values from dataset
record | record to be updated, use NULL to create a new one | |
dataset | DICOM dataset of the current file | |
referencedFileID | value of the Referenced File ID attribute | |
sourceFilename | name of the source DICOM file |
DcmDirectoryRecord* DicomDirInterface::buildVoiLutRecord | ( | DcmDirectoryRecord * | record, | |
DcmItem * | dataset, | |||
const OFString & | referencedFileID, | |||
const OFString & | sourceFilename | |||
) | [protected] |
create or update VOI LUT record and copy required values from dataset
record | record to be updated, use NULL to create a new one | |
dataset | DICOM dataset of the current file | |
referencedFileID | value of the Referenced File ID attribute | |
sourceFilename | name of the source DICOM file |
DcmDirectoryRecord* DicomDirInterface::buildCurveRecord | ( | DcmDirectoryRecord * | record, | |
DcmItem * | dataset, | |||
const OFString & | referencedFileID, | |||
const OFString & | sourceFilename | |||
) | [protected] |
create or update curve record and copy required values from dataset
record | record to be updated, use NULL to create a new one | |
dataset | DICOM dataset of the current file | |
referencedFileID | value of the Referenced File ID attribute | |
sourceFilename | name of the source DICOM file |
DcmDirectoryRecord* DicomDirInterface::buildStructReportRecord | ( | DcmDirectoryRecord * | record, | |
DcmItem * | dataset, | |||
const OFString & | referencedFileID, | |||
const OFString & | sourceFilename | |||
) | [protected] |
create or update structure reporting record and copy required values from dataset
record | record to be updated, use NULL to create a new one | |
dataset | DICOM dataset of the current file | |
referencedFileID | value of the Referenced File ID attribute | |
sourceFilename | name of the source DICOM file |
DcmDirectoryRecord* DicomDirInterface::buildPresentationRecord | ( | DcmDirectoryRecord * | record, | |
DcmItem * | dataset, | |||
const OFString & | referencedFileID, | |||
const OFString & | sourceFilename | |||
) | [protected] |
create or update presentation state record and copy required values from dataset
record | record to be updated, use NULL to create a new one | |
dataset | DICOM dataset of the current file | |
referencedFileID | value of the Referenced File ID attribute | |
sourceFilename | name of the source DICOM file |
DcmDirectoryRecord* DicomDirInterface::buildWaveformRecord | ( | DcmDirectoryRecord * | record, | |
DcmItem * | dataset, | |||
const OFString & | referencedFileID, | |||
const OFString & | sourceFilename | |||
) | [protected] |
create or update waveform record and copy required values from dataset
record | record to be updated, use NULL to create a new one | |
dataset | DICOM dataset of the current file | |
referencedFileID | value of the Referenced File ID attribute | |
sourceFilename | name of the source DICOM file |
DcmDirectoryRecord* DicomDirInterface::buildRTDoseRecord | ( | DcmDirectoryRecord * | record, | |
DcmItem * | dataset, | |||
const OFString & | referencedFileID, | |||
const OFString & | sourceFilename | |||
) | [protected] |
create or update RT dose record and copy required values from dataset
record | record to be updated, use NULL to create a new one | |
dataset | DICOM dataset of the current file | |
referencedFileID | value of the Referenced File ID attribute | |
sourceFilename | name of the source DICOM file |
DcmDirectoryRecord* DicomDirInterface::buildRTStructureSetRecord | ( | DcmDirectoryRecord * | record, | |
DcmItem * | dataset, | |||
const OFString & | referencedFileID, | |||
const OFString & | sourceFilename | |||
) | [protected] |
create or update RT structure set record and copy required values from dataset
record | record to be updated, use NULL to create a new one | |
dataset | DICOM dataset of the current file | |
referencedFileID | value of the Referenced File ID attribute | |
sourceFilename | name of the source DICOM file |
DcmDirectoryRecord* DicomDirInterface::buildRTPlanRecord | ( | DcmDirectoryRecord * | record, | |
DcmItem * | dataset, | |||
const OFString & | referencedFileID, | |||
const OFString & | sourceFilename | |||
) | [protected] |
create or update RT plan record and copy required values from dataset
record | record to be updated, use NULL to create a new one | |
dataset | DICOM dataset of the current file | |
referencedFileID | value of the Referenced File ID attribute | |
sourceFilename | name of the source DICOM file |
DcmDirectoryRecord* DicomDirInterface::buildRTTreatmentRecord | ( | DcmDirectoryRecord * | record, | |
DcmItem * | dataset, | |||
const OFString & | referencedFileID, | |||
const OFString & | sourceFilename | |||
) | [protected] |
create or update RT treatment record and copy required values from dataset
record | record to be updated, use NULL to create a new one | |
dataset | DICOM dataset of the current file | |
referencedFileID | value of the Referenced File ID attribute | |
sourceFilename | name of the source DICOM file |
DcmDirectoryRecord* DicomDirInterface::buildStoredPrintRecord | ( | DcmDirectoryRecord * | record, | |
DcmItem * | dataset, | |||
const OFString & | referencedFileID, | |||
const OFString & | sourceFilename | |||
) | [protected] |
create or update stored print record and copy required values from dataset
record | record to be updated, use NULL to create a new one | |
dataset | DICOM dataset of the current file | |
referencedFileID | value of the Referenced File ID attribute | |
sourceFilename | name of the source DICOM file |
DcmDirectoryRecord* DicomDirInterface::buildKeyObjectDocRecord | ( | DcmDirectoryRecord * | record, | |
DcmItem * | dataset, | |||
const OFString & | referencedFileID, | |||
const OFString & | sourceFilename | |||
) | [protected] |
create or update key object doc record and copy required values from dataset
record | record to be updated, use NULL to create a new one | |
dataset | DICOM dataset of the current file | |
referencedFileID | value of the Referenced File ID attribute | |
sourceFilename | name of the source DICOM file |
DcmDirectoryRecord* DicomDirInterface::buildRegistrationRecord | ( | DcmDirectoryRecord * | record, | |
DcmItem * | dataset, | |||
const OFString & | referencedFileID, | |||
const OFString & | sourceFilename | |||
) | [protected] |
create or update registration record and copy required values from dataset
record | record to be updated, use NULL to create a new one | |
dataset | DICOM dataset of the current file | |
referencedFileID | value of the Referenced File ID attribute | |
sourceFilename | name of the source DICOM file |
DcmDirectoryRecord* DicomDirInterface::buildFiducialRecord | ( | DcmDirectoryRecord * | record, | |
DcmItem * | dataset, | |||
const OFString & | referencedFileID, | |||
const OFString & | sourceFilename | |||
) | [protected] |
create or update fiducial record and copy required values from dataset
record | record to be updated, use NULL to create a new one | |
dataset | DICOM dataset of the current file | |
referencedFileID | value of the Referenced File ID attribute | |
sourceFilename | name of the source DICOM file |
DcmDirectoryRecord* DicomDirInterface::buildRawDataRecord | ( | DcmDirectoryRecord * | record, | |
DcmItem * | dataset, | |||
const OFString & | referencedFileID, | |||
const OFString & | sourceFilename | |||
) | [protected] |
create or update raw data record and copy required values from dataset
record | record to be updated, use NULL to create a new one | |
dataset | DICOM dataset of the current file | |
referencedFileID | value of the Referenced File ID attribute | |
sourceFilename | name of the source DICOM file |
DcmDirectoryRecord* DicomDirInterface::buildSpectroscopyRecord | ( | DcmDirectoryRecord * | record, | |
DcmItem * | dataset, | |||
const OFString & | referencedFileID, | |||
const OFString & | sourceFilename | |||
) | [protected] |
create or update spectroscopy record and copy required values from dataset
record | record to be updated, use NULL to create a new one | |
dataset | DICOM dataset of the current file | |
referencedFileID | value of the Referenced File ID attribute | |
sourceFilename | name of the source DICOM file |
DcmDirectoryRecord* DicomDirInterface::buildEncapDocRecord | ( | DcmDirectoryRecord * | record, | |
DcmItem * | dataset, | |||
const OFString & | referencedFileID, | |||
const OFString & | sourceFilename | |||
) | [protected] |
create or update encap doc record and copy required values from dataset
record | record to be updated, use NULL to create a new one | |
dataset | DICOM dataset of the current file | |
referencedFileID | value of the Referenced File ID attribute | |
sourceFilename | name of the source DICOM file |
DcmDirectoryRecord* DicomDirInterface::buildValueMapRecord | ( | DcmDirectoryRecord * | record, | |
DcmItem * | dataset, | |||
const OFString & | referencedFileID, | |||
const OFString & | sourceFilename | |||
) | [protected] |
create or update value map record and copy required values from dataset
record | record to be updated, use NULL to create a new one | |
dataset | DICOM dataset of the current file | |
referencedFileID | value of the Referenced File ID attribute | |
sourceFilename | name of the source DICOM file |
DcmDirectoryRecord* DicomDirInterface::buildHangingProtocolRecord | ( | DcmDirectoryRecord * | record, | |
DcmItem * | dataset, | |||
const OFString & | referencedFileID, | |||
const OFString & | sourceFilename | |||
) | [protected] |
create or update hanging protocol record and copy required values from dataset
record | record to be updated, use NULL to create a new one | |
dataset | DICOM dataset of the current file | |
referencedFileID | value of the Referenced File ID attribute | |
sourceFilename | name of the source DICOM file |
DcmDirectoryRecord* DicomDirInterface::buildStereometricRecord | ( | DcmDirectoryRecord * | record, | |
DcmItem * | dataset, | |||
const OFString & | referencedFileID, | |||
const OFString & | sourceFilename | |||
) | [protected] |
create or update stereometric record and copy required values from dataset
record | record to be updated, use NULL to create a new one | |
dataset | DICOM dataset of the current file | |
referencedFileID | value of the Referenced File ID attribute | |
sourceFilename | name of the source DICOM file |
DcmDirectoryRecord* DicomDirInterface::buildPaletteRecord | ( | DcmDirectoryRecord * | record, | |
DcmItem * | dataset, | |||
const OFString & | referencedFileID, | |||
const OFString & | sourceFilename | |||
) | [protected] |
create or update palette record and copy required values from dataset
record | record to be updated, use NULL to create a new one | |
dataset | DICOM dataset of the current file | |
referencedFileID | value of the Referenced File ID attribute | |
sourceFilename | name of the source DICOM file |
DcmDirectoryRecord* DicomDirInterface::buildSurfaceRecord | ( | DcmDirectoryRecord * | record, | |
DcmItem * | dataset, | |||
const OFString & | referencedFileID, | |||
const OFString & | sourceFilename | |||
) | [protected] |
create or update surface record and copy required values from dataset
record | record to be updated, use NULL to create a new one | |
dataset | DICOM dataset of the current file | |
referencedFileID | value of the Referenced File ID attribute | |
sourceFilename | name of the source DICOM file |
DcmDirectoryRecord* DicomDirInterface::buildMeasurementRecord | ( | DcmDirectoryRecord * | record, | |
DcmItem * | dataset, | |||
const OFString & | referencedFileID, | |||
const OFString & | sourceFilename | |||
) | [protected] |
create or update measurement record and copy required values from dataset
record | record to be updated, use NULL to create a new one | |
dataset | DICOM dataset of the current file | |
referencedFileID | value of the Referenced File ID attribute | |
sourceFilename | name of the source DICOM file |
DcmDirectoryRecord* DicomDirInterface::buildImplantRecord | ( | DcmDirectoryRecord * | record, | |
DcmItem * | dataset, | |||
const OFString & | referencedFileID, | |||
const OFString & | sourceFilename | |||
) | [protected] |
create or update implant record and copy required values from dataset
record | record to be updated, use NULL to create a new one | |
dataset | DICOM dataset of the current file | |
referencedFileID | value of the Referenced File ID attribute | |
sourceFilename | name of the source DICOM file |
DcmDirectoryRecord* DicomDirInterface::buildImplantGroupRecord | ( | DcmDirectoryRecord * | record, | |
DcmItem * | dataset, | |||
const OFString & | referencedFileID, | |||
const OFString & | sourceFilename | |||
) | [protected] |
create or update implant group record and copy required values from dataset
record | record to be updated, use NULL to create a new one | |
dataset | DICOM dataset of the current file | |
referencedFileID | value of the Referenced File ID attribute | |
sourceFilename | name of the source DICOM file |
DcmDirectoryRecord* DicomDirInterface::buildImplantAssyRecord | ( | DcmDirectoryRecord * | record, | |
DcmItem * | dataset, | |||
const OFString & | referencedFileID, | |||
const OFString & | sourceFilename | |||
) | [protected] |
create or update implant assy record and copy required values from dataset
record | record to be updated, use NULL to create a new one | |
dataset | DICOM dataset of the current file | |
referencedFileID | value of the Referenced File ID attribute | |
sourceFilename | name of the source DICOM file |
DcmDirectoryRecord* DicomDirInterface::buildImageRecord | ( | DcmDirectoryRecord * | record, | |
DcmItem * | dataset, | |||
const OFString & | referencedFileID, | |||
const OFString & | sourceFilename | |||
) | [protected] |
create or update image record and copy required values from dataset
record | record to be updated, use NULL to create a new one | |
dataset | DICOM dataset of the current file | |
referencedFileID | value of the Referenced File ID attribute | |
sourceFilename | name of the source DICOM file |
OFBool DicomDirInterface::getIconFromFile | ( | const OFString & | filename, | |
Uint8 * | pixel, | |||
const unsigned long | count, | |||
const unsigned int | width, | |||
const unsigned int | height | |||
) | [protected] |
create icon image from given PGM (portable gray map) file.
Please note that only grayscale images in binary format are currently supported (magic word "P5"). Memory has to be allocated by the caller.
filename | name of the PGM file to be loaded | |
pixel | pointer to memory buffer where the pixel data are to be stored | |
count | number of bytes allocated for the 'pixel' memory buffer | |
width | width of the scaled icon image (in pixels ) | |
height | height of the scaled icon image (in pixels) |
OFBool DicomDirInterface::getIconFromDataset | ( | DcmItem * | dataset, | |
Uint8 * | pixel, | |||
const unsigned long | count, | |||
const unsigned int | width, | |||
const unsigned int | height | |||
) | [protected] |
create icon image from DICOM dataset.
Please note that the memory buffer has to be allocated by the caller.
dataset | DICOM dataset from which the icon image is created | |
pixel | pointer to memory buffer where the pixel data are to be stored | |
count | number of bytes allocated for the 'pixel' memory buffer | |
width | width of the scaled icon image (in pixels ) | |
height | height of the scaled icon image (in pixels) |
OFCondition DicomDirInterface::addIconImage | ( | DcmDirectoryRecord * | record, | |
DcmItem * | dataset, | |||
const unsigned int | size, | |||
const OFString & | sourceFilename | |||
) | [protected] |
add icon image sequence to directory record.
If the icon image cannot be created from the DICOM dataset and there is no PGM file specified (neither for the particular image not a default one) a black image is used instead.
record | directory record where the icon image is stored | |
dataset | DICOM dataset from which the icon image is possibly created | |
size | resolution of the icon image to be created (width and height) | |
sourceFilename | name of the source DICOM file |
DcmDirectoryRecord* DicomDirInterface::addRecord | ( | DcmDirectoryRecord * | parent, | |
const E_DirRecType | recordType, | |||
DcmItem * | dataset, | |||
const OFString & | referencedFileID, | |||
const OFString & | sourceFilename | |||
) | [protected] |
add child record to a given parent record.
A new record is only added if it does not already exist.
parent | parent record (add new record as a child of this one) | |
recordType | type of directory record to be created | |
dataset | DICOM dataset containing data of the new record | |
referencedFileID | value of the Referenced File ID attribute | |
sourceFilename | name of the source DICOM file |
OFBool DicomDirInterface::checkReferencedSOPInstance | ( | DcmDirectoryRecord * | record, | |
DcmItem * | dataset, | |||
const OFString & | referencedFileID, | |||
const OFString & | sourceFilename | |||
) | [protected] |
check referenced SOP instance for consistency with a new directory record
record | directory record to be checked | |
dataset | DICOM dataset containing data of the new record | |
referencedFileID | value of the Referenced File ID attribute | |
sourceFilename | name of the source DICOM file |
void DicomDirInterface::inventMissingAttributes | ( | DcmDirectoryRecord * | parent, | |
const OFBool | recurse = OFTrue | |||
) | [protected] |
invent missing type 1 attributes for all child records (from patient level)
parent | invent missing attributes for all children of this record (root) | |
recurse | invent missing attributes also for lower level records if OFTrue. Only invent attributes for the top (patient) level if OFFalse. |
void DicomDirInterface::inventMissingStudyLevelAttributes | ( | DcmDirectoryRecord * | parent | ) | [protected] |
invent missing type 1 attributes for all child records (from study level)
parent | invent missing attributes for all children of this record |
void DicomDirInterface::inventMissingSeriesLevelAttributes | ( | DcmDirectoryRecord * | parent | ) | [protected] |
invent missing type 1 attributes for all child records (from series level)
parent | invent missing attributes for all children of this record |
void DicomDirInterface::inventMissingInstanceLevelAttributes | ( | DcmDirectoryRecord * | parent | ) | [protected] |
invent missing type 1 attributes for all child records (from instance level)
parent | invent missing attributes for all children of this record |
void DicomDirInterface::createDicomDirBackup | ( | const char * | filename | ) | [protected] |
create backup of a given file
filename | name of the file to be backuped |
void DicomDirInterface::printUnexpectedValueMessage | ( | const DcmTagKey & | key, | |
const char * | filename = NULL , |
|||
const OFBool | errorMsg = OFTrue | |||
) | [protected] |
print a message that the value of a given tag is unexpected.
The output format is: "{Error|Warning}: attribute <key.tagName()> <key> has other value than expected[ in file: <filename>]"
key | affected tag | |
filename | name of the file (optional, might be NULL) | |
errorMsg | print error message if OFTrue, a warning message otherwise |
void DicomDirInterface::printRequiredAttributeMessage | ( | const DcmTagKey & | key, | |
const char * | filename = NULL , |
|||
const OFBool | emptyMsg = OFFalse | |||
) | [protected] |
print an error message that a required attribute is missing/empty.
The output format is: "Error: <error.text()>: required attribute <key.tagName()> <key>\ {empty|missing}[ in file: <filename>]"
key | affected tag | |
filename | name of the file (optional, might be NULL) | |
emptyMsg | print "empty" if OFTrue, "missing" otherwise |
void DicomDirInterface::printAttributeErrorMessage | ( | const DcmTagKey & | key, | |
const OFCondition & | error, | |||
const char * | operation | |||
) | [protected] |
print an error message that something went wrong with an attribute.
The output format is: "Error: <error.text()>: [cannot <operation> ]<key.tagName()> <key>"
key | affected tag | |
error | status to be reported (only if ".bad()") | |
operation | name of the operation that failed (optional, might be NULL) |
void DicomDirInterface::printRecordErrorMessage | ( | const OFCondition & | error, | |
const E_DirRecType | recordType, | |||
const char * | operation | |||
) | [protected] |
print an error message that something went wrong with a given record.
The output format is: "Error: <error.text()>: [cannot <operation> ]<recordType> directory record"
error | status to be reported (only if ".bad()") | |
recordType | type of directory record which caused the error | |
operation | name of the operation that failed (optional, might be NULL) |
OFBool DicomDirInterface::copyFile | ( | const char * | fromFilename, | |
const char * | toFilename | |||
) | [protected] |
copy contents of specified file
fromFilename | name of the file to be copied | |
toFilename | name of the new file (copy of 'fromFilename') |
OFBool DicomDirInterface::warnAboutInconsistentAttributes | ( | DcmDirectoryRecord * | record, | |
DcmItem * | dataset, | |||
const OFString & | sourceFilename, | |||
const OFBool | abortCheck = OFFalse | |||
) | [protected] |
see if all the attributes in record match the values in dataset and warn if not
record | directory record to be checked | |
dataset | DICOM dataset to be compared with the directory record | |
sourceFilename | name of the source DICOM file | |
abortCheck | flag indicating whether to abort on the first inconsistent record |
OFBool DicomDirInterface::checkFilesetID | ( | const OFString & | filesetID | ) | [protected] |
check whether given fileset ID is valid
filesetID | fileset ID to be checked |
OFBool DicomDirInterface::checkExists | ( | DcmItem * | dataset, | |
const DcmTagKey & | key, | |||
const char * | filename = NULL | |||
) | [protected] |
check whether given tag exists in the DICOM dataset
dataset | DICOM dataset to be checked | |
key | tag to be searched for | |
filename | of the file (optional, report any error if specified) |
OFBool DicomDirInterface::checkExistsWithValue | ( | DcmItem * | dataset, | |
const DcmTagKey & | key, | |||
const char * | filename = NULL | |||
) | [protected] |
check whether given tag exists with a value in the DICOM dataset
dataset | DICOM dataset to be checked | |
key | tag to be searched for | |
filename | of the file (optional, report any error if specified) |
OFBool DicomDirInterface::checkExistsWithStringValue | ( | DcmItem * | dataset, | |
const DcmTagKey & | key, | |||
const OFString & | value, | |||
const char * | filename = NULL | |||
) | [protected] |
check whether given tag exists in the DICOM dataset and has the expected string value
dataset | DICOM dataset to be checked | |
key | tag to be searched for | |
value | expected string value | |
filename | of the file (optional, report any error if specified) |
OFBool DicomDirInterface::checkExistsWithIntegerValue | ( | DcmItem * | dataset, | |
const DcmTagKey & | key, | |||
const long | value, | |||
const char * | filename = NULL , |
|||
const OFBool | reject = OFTrue | |||
) | [protected] |
check whether given tag exists in the DICOM dataset and has the expected integer value
dataset | DICOM dataset to be checked | |
key | tag to be searched for | |
value | expected integer value | |
filename | of the file (optional, report any error if specified) | |
reject | report an "Error" if OFTrue, a "Warning" if OFFalse |
OFBool DicomDirInterface::checkExistsWithMinMaxValue | ( | DcmItem * | dataset, | |
const DcmTagKey & | key, | |||
const long | min, | |||
const long | max, | |||
const char * | filename = NULL , |
|||
const OFBool | reject = OFTrue | |||
) | [protected] |
check whether given tag exists in the DICOM dataset and has an integer value in the expected range
dataset | DICOM dataset to be checked | |
key | tag to be searched for | |
min | minimum integer value of the expected range | |
max | maximum integer value of the expected range | |
filename | of the file (optional, report any error if specified) | |
reject | report an "Error" if OFTrue, a "Warning" if OFFalse |
OFString& DicomDirInterface::getStringFromDataset | ( | DcmItem * | dataset, | |
const DcmTagKey & | key, | |||
OFString & | result, | |||
OFBool | searchIntoSub = OFFalse | |||
) | [protected] |
get string value from dataset and report an error (if any)
dataset | dataset from which the string value is to be retrieved | |
key | tag of the attribute to be retrieved | |
result | string variable in which the resulting value is stored | |
searchIntoSub | flag indicating whether to do a deep search or not |
OFString& DicomDirInterface::getStringComponentFromDataset | ( | DcmItem * | dataset, | |
const DcmTagKey & | key, | |||
OFString & | result, | |||
const unsigned long | pos, | |||
OFBool | searchIntoSub = OFFalse | |||
) | [protected] |
get string value component from dataset and report an error (if any)
dataset | dataset from which the string value is to be retrieved | |
key | tag of the attribute to be retrieved | |
result | string variable in which the resulting value is stored | |
pos | index of the component in case of multi-valued elements (0..vm-1) | |
searchIntoSub | flag indicating whether to do a deep search or not |
OFString& DicomDirInterface::getStringFromFile | ( | const char * | filename, | |
const DcmTagKey & | key, | |||
OFString & | result, | |||
OFBool | searchIntoSub = OFFalse | |||
) | [protected] |
get string value from file and report an error (if any)
filename | name of the file from which the string value is to be retrieved | |
key | tag of the attribute to be retrieved | |
result | string variable in which the resulting value is stored | |
searchIntoSub | flag indicating whether to do a deep search or not |
void DicomDirInterface::copyElement | ( | DcmItem * | dataset, | |
const DcmTagKey & | key, | |||
DcmDirectoryRecord * | record, | |||
const OFString & | sourceFilename, | |||
const OFBool | optional = OFFalse , |
|||
const OFBool | copyEmpty = OFTrue | |||
) | [protected] |
copy element from dataset to directory record
dataset | DICOM dataset containing the original data | |
key | tag of the element to be copied | |
record | directory record to which the element is to be copied | |
sourceFilename | name of the source DICOM file | |
optional | flag indicating whether the element is optional or required | |
copyEmpty | flag indicating whether to copy an empty element (no value) |
Referenced by copyElementType1(), copyElementType1C(), copyElementType2(), and copyElementType3().
void DicomDirInterface::copyElementType1 | ( | DcmItem * | dataset, | |
const DcmTagKey & | key, | |||
DcmDirectoryRecord * | record, | |||
const OFString & | sourceFilename | |||
) | [inline, protected] |
copy type 1 element from dataset to directory record
dataset | DICOM dataset containing the original data | |
key | tag of the element to be copied | |
record | directory record to which the element is to be copied | |
sourceFilename | name of the source DICOM file |
Definition at line 1312 of file dcddirif.h.
References copyElement().
void DicomDirInterface::copyElementType1C | ( | DcmItem * | dataset, | |
const DcmTagKey & | key, | |||
DcmDirectoryRecord * | record, | |||
const OFString & | sourceFilename | |||
) | [inline, protected] |
copy type 1C element from dataset to directory record
dataset | DICOM dataset containing the original data | |
key | tag of the element to be copied | |
record | directory record to which the element is to be copied | |
sourceFilename | name of the source DICOM file |
Definition at line 1326 of file dcddirif.h.
References copyElement().
void DicomDirInterface::copyElementType2 | ( | DcmItem * | dataset, | |
const DcmTagKey & | key, | |||
DcmDirectoryRecord * | record, | |||
const OFString & | sourceFilename | |||
) | [inline, protected] |
copy type 2 element from dataset to directory record
dataset | DICOM dataset containing the original data | |
key | tag of the element to be copied | |
record | directory record to which the element is to be copied | |
sourceFilename | name of the source DICOM file |
Definition at line 1340 of file dcddirif.h.
References copyElement().
void DicomDirInterface::copyElementType3 | ( | DcmItem * | dataset, | |
const DcmTagKey & | key, | |||
DcmDirectoryRecord * | record, | |||
const OFString & | sourceFilename | |||
) | [inline, protected] |
copy type 3 element from dataset to directory record
dataset | DICOM dataset containing the original data | |
key | tag of the element to be copied | |
record | directory record to which the element is to be copied | |
sourceFilename | name of the source DICOM file |
Definition at line 1354 of file dcddirif.h.
References copyElement().
void DicomDirInterface::copyStringWithDefault | ( | DcmItem * | dataset, | |
const DcmTagKey & | key, | |||
DcmDirectoryRecord * | record, | |||
const OFString & | sourceFilename, | |||
const char * | defaultValue = "" , |
|||
const OFBool | printWarning = OFFalse | |||
) | [protected] |
copy optional string value from dataset to directory record
dataset | DICOM dataset containing the original data | |
key | tag of the element value to be copied | |
record | directory record to which the element value is to be copied | |
sourceFilename | name of the source DICOM file | |
defaultValue | default string value used in case the element is missing | |
printWarning | print warning message if element does not exist (with a value) and no default value is given |
OFBool DicomDirInterface::compareStringAttributes | ( | DcmItem * | dataset, | |
const DcmTagKey & | datKey, | |||
DcmDirectoryRecord * | record, | |||
const DcmTagKey & | recKey, | |||
const OFString & | sourceFilename, | |||
const OFBool | errorMsg = OFFalse | |||
) | [protected] |
compare string attribute from dataset and record and report any deviation
dataset | DICOM dataset where the string value is stored | |
datKey | tag of the string value to be compared (dataset) | |
record | directory record where the string value is stored | |
recKey | tag of the string value to be compared (record) | |
sourceFilename | name of the source DICOM file | |
errorMsg | report error if true, warning message otherwise (default) |
OFBool DicomDirInterface::compareSequenceAttributes | ( | DcmItem * | dataset, | |
DcmTagKey & | key, | |||
DcmDirectoryRecord * | record, | |||
const OFString & | sourceFilename | |||
) | [protected] |
compare sequence attribute from dataset and record and report any deviation
dataset | DICOM dataset where the sequence value is stored | |
key | tag of the sequence to be compared | |
record | directory record where the sequence value is stored | |
sourceFilename | name of the source DICOM file |
void DicomDirInterface::setDefaultValue | ( | DcmDirectoryRecord * | record, | |
const DcmTagKey & | key, | |||
const unsigned long | number, | |||
const char * | prefix = NULL | |||
) | [protected] |
set default value (number or prefix and number) to a given tag
record | directory record where the elements are stored | |
key | tag of the element to be modifed | |
number | numeric value to be set as a the element value | |
prefix | optional prefix to be added to the numeric value |