DCMTK  Version 3.6.4
OFFIS DICOM Toolkit
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
DicomDirInterface Class Reference

An interface class for simplified creation of a DICOMDIR. More...

Public Types

enum  E_ApplicationProfile {
  AP_GeneralPurpose, AP_Default = AP_GeneralPurpose, AP_GeneralPurposeDVDJPEG, AP_GeneralPurposeDVDJPEG2000,
  AP_GeneralPurposeBDJPEG, AP_GeneralPurposeBDJPEG2000, AP_GeneralPurposeBDMPEG2MPatML, AP_GeneralPurposeBDMPEG2MPatHL,
  AP_GeneralPurposeBDMPEG4HPatLV41, AP_GeneralPurposeBDMPEG4HPatLV41BD, AP_GeneralPurposeBDMPEG4HPatLV42_2D, AP_GeneralPurposeBDMPEG4HPatLV42_3D,
  AP_GeneralPurposeBDMPEG4StereoHPatLV42, AP_USBandFlashJPEG, AP_USBandFlashJPEG2000, AP_GeneralPurposeMIME,
  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). More...
 
virtual ~DicomDirInterface ()
 destructor (virtual). More...
 
void cleanup ()
 reset the object to its initial state. More...
 
OFBool isDicomDirValid () const
 check whether current DICOMDIR is valid. More...
 
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. More...
 
OFCondition appendToDicomDir (const E_ApplicationProfile profile, const OFFilename &filename)
 create a DICOMDIR object based on an existing DICOMDIR file (append). More...
 
OFCondition updateDicomDir (const E_ApplicationProfile profile, const OFFilename &filename)
 create a DICOMDIR object based on an existing DICOMDIR file (update). More...
 
OFCondition writeDicomDir (const E_EncodingType encodingType=EET_UndefinedLength, const E_GrpLenEncoding groupLength=EGL_withoutGL)
 write the current DICOMDIR object to file. More...
 
OFBool isFilenameValid (const OFFilename &filename, const OFBool allowEmpty=OFFalse)
 check whether specified filename is valid. More...
 
OFBool isCharsetValid (const char *charset)
 check whether given charset identifier is valid. More...
 
OFCondition checkDicomFile (const OFFilename &filename, const OFFilename &directory=OFFilename(), const OFBool checkFilename=OFTrue)
 check whether specified DICOM file is suitable to be included into the DICOMDIR. More...
 
OFCondition addDicomFile (const OFFilename &filename, const OFFilename &directory=OFFilename())
 add specified DICOM file to the current DICOMDIR. More...
 
OFCondition setFilesetDescriptor (const char *filename, const char *charset=DEFAULT_DESCRIPTOR_CHARSET)
 set the file-set descriptor file ID and character set. More...
 
OFCondition setIconSize (const unsigned int size)
 set preferred size of the icon images. More...
 
OFCondition setIconPrefix (const OFFilename &prefix)
 set filename prefix for alternative icon images. More...
 
OFCondition setDefaultIcon (const OFFilename &filename)
 set filename of default icon image. More...
 
OFBool abortMode () const
 get current status of the "abort on first error" mode. More...
 
OFBool mapFilenamesMode () const
 get current status of the "map filenames" mode. More...
 
OFBool inventMode () const
 get current status of the "invent missing values" mode. More...
 
OFBool inventPatientIDMode () const
 get current status of the "invent missing patient ID" mode. More...
 
OFBool retiredSOPClassSupport () const
 get current status of the "retired SOP class support" mode. More...
 
OFBool iconImageMode () const
 get current status of the "create icon images" mode. More...
 
OFBool backupMode () const
 get current status of the "create backup" mode. More...
 
OFBool encodingCheck () const
 get current status of the "pixel encoding check" mode. More...
 
OFBool resolutionCheck () const
 get current status of the "spatial resolution check" mode. More...
 
OFBool transferSyntaxCheck () const
 get current status of the "transfer syntax check" mode. More...
 
OFBool fileFormatCheck () const
 get current status of the "DICOM file format check" mode. More...
 
OFBool consistencyCheck () const
 get current status of the "consistency check" mode. More...
 
OFBool enableAbortMode (const OFBool newMode=OFTrue)
 enable/disable the "abort on first error" mode. More...
 
OFBool enableMapFilenamesMode (const OFBool newMode=OFTrue)
 enable/disable the "map filenames" mode. More...
 
OFBool enableInventMode (const OFBool newMode=OFTrue)
 enable/disable the "invent missing values" mode. More...
 
OFBool enableInventPatientIDMode (const OFBool newMode=OFTrue)
 enable/disable the "invent new patient ID" mode. More...
 
OFBool enableRetiredSOPClassSupport (const OFBool newMode=OFTrue)
 enable/disable the "retired SOP class support" mode. More...
 
OFBool enableIconImageMode (const OFBool newMode=OFTrue)
 enable/disable the "create icon images" mode. More...
 
OFBool disableBackupMode (const OFBool newMode=OFFalse)
 disable/enable the "create backup file" mode. More...
 
OFBool disableEncodingCheck (const OFBool newMode=OFFalse)
 disable/enable the "pixel encoding check". More...
 
OFBool disableResolutionCheck (const OFBool newMode=OFFalse)
 disable/enable the "spatial resolution check". More...
 
OFBool disableTransferSyntaxCheck (const OFBool newMode=OFFalse)
 disable/enable the "transfer syntax check". More...
 
OFBool disableFileFormatCheck (const OFBool newMode=OFFalse)
 disable/enable the "DICOM file format check". More...
 
OFBool disableConsistencyCheck (const OFBool newMode=OFFalse)
 disable/enable the "consistency check". More...
 
OFBool addImageSupport (DicomDirImagePlugin *plugin)
 add pluggable image support. More...
 

Static Public Member Functions

static const char * getProfileName (const E_ApplicationProfile profile)
 get name/identifier associated with the given application profile More...
 
static OFString recordTypeToName (const E_DirRecType recordType)
 get string associated with the given directory record entry type. More...
 

Protected Member Functions

OFCondition selectApplicationProfile (const E_ApplicationProfile profile)
 select given application profile More...
 
OFCondition loadAndCheckDicomFile (const OFFilename &filename, const OFFilename &directory, DcmFileFormat &fileformat, const OFBool checkFilename=OFTrue)
 load and check DICOM file regarding the current application profile More...
 
OFCondition checkSOPClassAndXfer (DcmMetaInfo *metainfo, DcmItem *dataset, const OFFilename &filename)
 check SOP class and transfer syntax for compliance with current profile More...
 
OFCondition checkBasicCardiacAttributes (DcmItem *dataset, const OFFilename &filename)
 check attributes for compliance with Basic Cardiac application profile More...
 
OFCondition checkXrayAngiographicAttributes (DcmItem *dataset, const OFString &sopClass, const OFFilename &filename)
 check attributes for compliance with X-ray Angiography application profile More...
 
OFCondition checkDentalRadiographAttributes (DcmItem *dataset, const OFFilename &filename)
 check attributes for compliance with dental radiograph application profile More...
 
OFCondition checkCTandMRAttributes (DcmItem *dataset, const OFString &sopClass, const OFFilename &filename)
 check attributes for compliance with CT and MR application profile More...
 
OFCondition checkUltrasoundAttributes (DcmItem *dataset, const OFString &transferSyntax, const OFFilename &filename)
 check attributes for compliance with Ultrasound application profiles More...
 
OFCondition checkMandatoryAttributes (DcmMetaInfo *metainfo, DcmItem *dataset, const OFFilename &filename)
 check attributes for compliance with current application profile More...
 
OFBool recordMatchesDataset (DcmDirectoryRecord *record, DcmItem *dataset)
 check whether given directory record matches dataset. More...
 
DcmDirectoryRecordfindExistingRecord (DcmDirectoryRecord *parent, const E_DirRecType recordType, DcmItem *dataset)
 search for a given directory record More...
 
DcmDirectoryRecordbuildPatientRecord (DcmDirectoryRecord *record, DcmFileFormat *fileformat, const OFFilename &sourceFilename)
 create or update patient record and copy required values from dataset More...
 
DcmDirectoryRecordbuildStudyRecord (DcmDirectoryRecord *record, DcmFileFormat *fileformat, const OFFilename &sourceFilename)
 create or update study record and copy required values from dataset More...
 
DcmDirectoryRecordbuildSeriesRecord (DcmDirectoryRecord *record, DcmFileFormat *fileformat, const OFFilename &sourceFilename)
 create or update new series record and copy required values from dataset More...
 
DcmDirectoryRecordbuildOverlayRecord (DcmDirectoryRecord *record, DcmFileFormat *fileformat, const OFString &referencedFileID, const OFFilename &sourceFilename)
 create or update overlay record and copy required values from dataset More...
 
DcmDirectoryRecordbuildModalityLutRecord (DcmDirectoryRecord *record, DcmFileFormat *fileformat, const OFString &referencedFileID, const OFFilename &sourceFilename)
 create or update modality LUT record and copy required values from dataset More...
 
DcmDirectoryRecordbuildVoiLutRecord (DcmDirectoryRecord *record, DcmFileFormat *fileformat, const OFString &referencedFileID, const OFFilename &sourceFilename)
 create or update VOI LUT record and copy required values from dataset More...
 
DcmDirectoryRecordbuildCurveRecord (DcmDirectoryRecord *record, DcmFileFormat *fileformat, const OFString &referencedFileID, const OFFilename &sourceFilename)
 create or update curve record and copy required values from dataset More...
 
DcmDirectoryRecordbuildStructReportRecord (DcmDirectoryRecord *record, DcmFileFormat *fileformat, const OFString &referencedFileID, const OFFilename &sourceFilename)
 create or update structure reporting record and copy required values from dataset More...
 
DcmDirectoryRecordbuildPresentationRecord (DcmDirectoryRecord *record, DcmFileFormat *fileformat, const OFString &referencedFileID, const OFFilename &sourceFilename)
 create or update presentation state record and copy required values from dataset More...
 
DcmDirectoryRecordbuildWaveformRecord (DcmDirectoryRecord *record, DcmFileFormat *fileformat, const OFString &referencedFileID, const OFFilename &sourceFilename)
 create or update waveform record and copy required values from dataset More...
 
DcmDirectoryRecordbuildRTDoseRecord (DcmDirectoryRecord *record, DcmFileFormat *fileformat, const OFString &referencedFileID, const OFFilename &sourceFilename)
 create or update RT dose record and copy required values from dataset More...
 
DcmDirectoryRecordbuildRTStructureSetRecord (DcmDirectoryRecord *record, DcmFileFormat *fileformat, const OFString &referencedFileID, const OFFilename &sourceFilename)
 create or update RT structure set record and copy required values from dataset More...
 
DcmDirectoryRecordbuildRTPlanRecord (DcmDirectoryRecord *record, DcmFileFormat *fileformat, const OFString &referencedFileID, const OFFilename &sourceFilename)
 create or update RT plan record and copy required values from dataset More...
 
DcmDirectoryRecordbuildRTTreatmentRecord (DcmDirectoryRecord *record, DcmFileFormat *fileformat, const OFString &referencedFileID, const OFFilename &sourceFilename)
 create or update RT treatment record and copy required values from dataset More...
 
DcmDirectoryRecordbuildStoredPrintRecord (DcmDirectoryRecord *record, DcmFileFormat *fileformat, const OFString &referencedFileID, const OFFilename &sourceFilename)
 create or update stored print record and copy required values from dataset More...
 
DcmDirectoryRecordbuildKeyObjectDocRecord (DcmDirectoryRecord *record, DcmFileFormat *fileformat, const OFString &referencedFileID, const OFFilename &sourceFilename)
 create or update key object doc record and copy required values from dataset More...
 
DcmDirectoryRecordbuildRegistrationRecord (DcmDirectoryRecord *record, DcmFileFormat *fileformat, const OFString &referencedFileID, const OFFilename &sourceFilename)
 create or update registration record and copy required values from dataset More...
 
DcmDirectoryRecordbuildFiducialRecord (DcmDirectoryRecord *record, DcmFileFormat *fileformat, const OFString &referencedFileID, const OFFilename &sourceFilename)
 create or update fiducial record and copy required values from dataset More...
 
DcmDirectoryRecordbuildRawDataRecord (DcmDirectoryRecord *record, DcmFileFormat *fileformat, const OFString &referencedFileID, const OFFilename &sourceFilename)
 create or update raw data record and copy required values from dataset More...
 
DcmDirectoryRecordbuildSpectroscopyRecord (DcmDirectoryRecord *record, DcmFileFormat *fileformat, const OFString &referencedFileID, const OFFilename &sourceFilename)
 create or update spectroscopy record and copy required values from dataset More...
 
DcmDirectoryRecordbuildEncapDocRecord (DcmDirectoryRecord *record, DcmFileFormat *fileformat, const OFString &referencedFileID, const OFFilename &sourceFilename)
 create or update encap doc record and copy required values from dataset More...
 
DcmDirectoryRecordbuildValueMapRecord (DcmDirectoryRecord *record, DcmFileFormat *fileformat, const OFString &referencedFileID, const OFFilename &sourceFilename)
 create or update value map record and copy required values from dataset More...
 
DcmDirectoryRecordbuildHangingProtocolRecord (DcmDirectoryRecord *record, DcmFileFormat *fileformat, const OFString &referencedFileID, const OFFilename &sourceFilename)
 create or update hanging protocol record and copy required values from dataset More...
 
DcmDirectoryRecordbuildStereometricRecord (DcmDirectoryRecord *record, DcmFileFormat *fileformat, const OFString &referencedFileID, const OFFilename &sourceFilename)
 create or update stereometric record and copy required values from dataset More...
 
DcmDirectoryRecordbuildPaletteRecord (DcmDirectoryRecord *record, DcmFileFormat *fileformat, const OFString &referencedFileID, const OFFilename &sourceFilename)
 create or update palette record and copy required values from dataset More...
 
DcmDirectoryRecordbuildSurfaceRecord (DcmDirectoryRecord *record, DcmFileFormat *fileformat, const OFString &referencedFileID, const OFFilename &sourceFilename)
 create or update surface record and copy required values from dataset More...
 
DcmDirectoryRecordbuildMeasurementRecord (DcmDirectoryRecord *record, DcmFileFormat *fileformat, const OFString &referencedFileID, const OFFilename &sourceFilename)
 create or update measurement record and copy required values from dataset More...
 
DcmDirectoryRecordbuildImplantRecord (DcmDirectoryRecord *record, DcmFileFormat *fileformat, const OFString &referencedFileID, const OFFilename &sourceFilename)
 create or update implant record and copy required values from dataset More...
 
DcmDirectoryRecordbuildImplantGroupRecord (DcmDirectoryRecord *record, DcmFileFormat *fileformat, const OFString &referencedFileID, const OFFilename &sourceFilename)
 create or update implant group record and copy required values from dataset More...
 
DcmDirectoryRecordbuildImplantAssyRecord (DcmDirectoryRecord *record, DcmFileFormat *fileformat, const OFString &referencedFileID, const OFFilename &sourceFilename)
 create or update implant assy record and copy required values from dataset More...
 
DcmDirectoryRecordbuildPlanRecord (DcmDirectoryRecord *record, DcmFileFormat *fileformat, const OFString &referencedFileID, const OFFilename &sourceFilename)
 create or update plan record and copy required values from dataset More...
 
DcmDirectoryRecordbuildSurfaceScanRecord (DcmDirectoryRecord *record, DcmFileFormat *fileformat, const OFString &referencedFileID, const OFFilename &sourceFilename)
 create or update surface scan record and copy required values from dataset More...
 
DcmDirectoryRecordbuildTractRecord (DcmDirectoryRecord *record, DcmFileFormat *fileformat, const OFString &referencedFileID, const OFFilename &sourceFilename)
 create or update tract record and copy required values from dataset More...
 
DcmDirectoryRecordbuildAssessmentRecord (DcmDirectoryRecord *record, DcmFileFormat *fileformat, const OFString &referencedFileID, const OFFilename &sourceFilename)
 create or update assessment record and copy required values from dataset More...
 
DcmDirectoryRecordbuildImageRecord (DcmDirectoryRecord *record, DcmFileFormat *fileformat, const OFString &referencedFileID, const OFFilename &sourceFilename)
 create or update image record and copy required values from dataset More...
 
OFBool getIconFromFile (const OFFilename &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. More...
 
OFBool getIconFromDataset (DcmItem *dataset, Uint8 *pixel, const unsigned long count, const unsigned int width, const unsigned int height)
 create icon image from DICOM dataset. More...
 
OFCondition addIconImage (DcmDirectoryRecord *record, DcmItem *dataset, const unsigned int size, const OFFilename &sourceFilename)
 add icon image sequence to directory record. More...
 
DcmDirectoryRecordaddRecord (DcmDirectoryRecord *parent, const E_DirRecType recordType, DcmFileFormat *fileformat, const OFString &referencedFileID, const OFFilename &sourceFilename)
 add child record to a given parent record. More...
 
OFBool checkReferencedSOPInstance (DcmDirectoryRecord *record, DcmItem *dataset, const OFString &referencedFileID, const OFFilename &sourceFilename)
 check referenced SOP instance for consistency with a new directory record More...
 
void inventMissingAttributes (DcmDirectoryRecord *parent, const OFBool recurse=OFTrue)
 invent missing type 1 attributes for all child records (from patient level) More...
 
void inventMissingStudyLevelAttributes (DcmDirectoryRecord *parent)
 invent missing type 1 attributes for all child records (from study level) More...
 
void inventMissingSeriesLevelAttributes (DcmDirectoryRecord *parent)
 invent missing type 1 attributes for all child records (from series level) More...
 
void inventMissingInstanceLevelAttributes (DcmDirectoryRecord *parent)
 invent missing type 1 attributes for all child records (from instance level) More...
 
void createDicomDirBackup (const OFFilename &filename)
 create backup of a given file More...
 
void deleteDicomDirBackup ()
 delete backup file if one has been created
 
void printUnexpectedValueMessage (const DcmTagKey &key, const OFFilename &filename=OFFilename(), const OFBool errorMsg=OFTrue)
 print a message that the value of a given tag is unexpected. More...
 
void printRequiredAttributeMessage (const DcmTagKey &key, const OFFilename &filename=OFFilename(), const OFBool emptyMsg=OFFalse)
 print an error message that a required attribute is missing/empty. More...
 
void printAttributeErrorMessage (const DcmTagKey &key, const OFCondition &error, const char *operation)
 print an error message that something went wrong with an attribute. More...
 
void printRecordErrorMessage (const OFCondition &error, const E_DirRecType recordType, const char *operation)
 print an error message that something went wrong with a given record. More...
 
OFBool copyFile (const OFFilename &fromFilename, const OFFilename &toFilename)
 copy contents of specified file More...
 
OFBool warnAboutInconsistentAttributes (DcmDirectoryRecord *record, DcmItem *dataset, const OFFilename &sourceFilename, const OFBool abortCheck=OFFalse)
 check if all the attributes in record match the values in dataset and warn if not More...
 
OFBool checkFilesetID (const OFString &filesetID)
 check whether given file-set ID is valid More...
 
OFBool checkExists (DcmItem *dataset, const DcmTagKey &key, const OFFilename &filename=OFFilename())
 check whether given tag exists in the DICOM dataset More...
 
OFBool checkExistsWithValue (DcmItem *dataset, const DcmTagKey &key, const OFFilename &filename=OFFilename())
 check whether given tag exists with a value in the DICOM dataset More...
 
OFBool checkExistsWithStringValue (DcmItem *dataset, const DcmTagKey &key, const OFString &value, const OFFilename &filename=OFFilename())
 check whether given tag exists in the DICOM dataset and has the expected string value More...
 
OFBool checkExistsWithIntegerValue (DcmItem *dataset, const DcmTagKey &key, const long value, const OFFilename &filename=OFFilename(), const OFBool reject=OFTrue)
 check whether given tag exists in the DICOM dataset and has the expected integer value More...
 
OFBool checkExistsWithMinMaxValue (DcmItem *dataset, const DcmTagKey &key, const long min, const long max, const OFFilename &filename=OFFilename(), const OFBool reject=OFTrue)
 check whether given tag exists in the DICOM dataset and has an integer value in the expected range More...
 
OFStringgetStringFromDataset (DcmItem *dataset, const DcmTagKey &key, OFString &result, OFBool searchIntoSub=OFFalse)
 get string value from dataset and report an error (if any) More...
 
OFStringgetStringComponentFromDataset (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) More...
 
OFStringgetStringFromFile (const OFFilename &filename, const DcmTagKey &key, OFString &result, OFBool searchIntoSub=OFFalse)
 get string value from file and report an error (if any) More...
 
void copyElement (DcmItem *dataset, const DcmTagKey &key, DcmDirectoryRecord *record, const OFFilename &sourceFilename, const OFBool optional=OFFalse, const OFBool copyEmpty=OFTrue)
 copy element from given dataset to directory record More...
 
void copyElementType1CFromDatasetOrSequenceItem (DcmItem *dataset, const DcmTagKey &elementKey, const DcmTagKey &sequenceKey, DcmDirectoryRecord *record, const OFFilename &sourceFilename)
 copy type 1C element from given dataset or first item of the given sequence to directory record. More...
 
void copyElementType1 (DcmItem *dataset, const DcmTagKey &key, DcmDirectoryRecord *record, const OFFilename &sourceFilename)
 copy type 1 element from given dataset to directory record More...
 
void copyElementType1C (DcmItem *dataset, const DcmTagKey &key, DcmDirectoryRecord *record, const OFFilename &sourceFilename)
 copy type 1C element from given dataset to directory record More...
 
void copyElementType2 (DcmItem *dataset, const DcmTagKey &key, DcmDirectoryRecord *record, const OFFilename &sourceFilename)
 copy type 2 element from given dataset to directory record More...
 
void copyElementType3 (DcmItem *dataset, const DcmTagKey &key, DcmDirectoryRecord *record, const OFFilename &sourceFilename)
 copy type 3 element from given dataset to directory record More...
 
void copyStringWithDefault (DcmItem *dataset, const DcmTagKey &key, DcmDirectoryRecord *record, const OFFilename &sourceFilename, const char *defaultValue="", const OFBool printWarning=OFFalse)
 copy optional string value from given dataset to directory record More...
 
OFBool compareStringAttributes (DcmItem *dataset, const DcmTagKey &datKey, DcmDirectoryRecord *record, const DcmTagKey &recKey, const OFFilename &sourceFilename, const OFBool errorMsg=OFFalse)
 compare string attribute from dataset and record and report any deviation More...
 
OFBool compareSequenceAttributes (DcmItem *dataset, DcmTagKey &key, DcmDirectoryRecord *record, const OFFilename &sourceFilename)
 compare sequence attribute from dataset and record and report any deviation More...
 
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 More...
 

Private Member Functions

 DicomDirInterface (const DicomDirInterface &obj)
 private undefined copy constructor
 
DicomDirInterfaceoperator= (const DicomDirInterface &obj)
 private undefined assignment operator
 

Private Attributes

DcmDicomDirDicomDir
 pointer to the current DICOMDIR object
 
DicomDirImagePluginImagePlugin
 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 FileFormatCheck
 check DICOM file format
 
OFBool ConsistencyCheck
 check consistency of newly added record
 
OFBool IconImageMode
 create icon images
 
OFBool FilesetUpdateMode
 update existing file-set
 
OFFilename 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
 
OFFilename IconPrefix
 filename prefix for the external icon images
 
OFFilename 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
 

Detailed Description

An interface class for simplified creation of a DICOMDIR.

Note
Please make sure that for all OFFilename parameters, passed to the various methods of this class, at least the 8-bit version of the string value is present since in some cases only this version is (can be) used.

Member Enumeration Documentation

◆ E_ApplicationProfile

list of supported media storage application profiles

Enumerator
AP_GeneralPurpose 

General Purpose Interchange on CD-R or DVD-RAM Media (STD-GEN-CD/DVD-RAM)

AP_Default 

default application profile: General Purpose Interchange on CD-R or DVD-RAM Media

AP_GeneralPurposeDVDJPEG 

General Purpose DVD Interchange with JPEG (STD-GEN-DVD-JPEG)

AP_GeneralPurposeDVDJPEG2000 

General Purpose DVD Interchange with JPEG 2000 (STD-GEN-DVD-J2K)

AP_GeneralPurposeBDJPEG 

General Purpose BD Interchange with JPEG (STD-GEN-BD-JPEG)

AP_GeneralPurposeBDJPEG2000 

General Purpose BD Interchange with JPEG 2000 (STD-GEN-BD-J2K)

AP_GeneralPurposeBDMPEG2MPatML 

General Purpose BD Interchange with MPEG2 MP@ML (STD-GEN-BD-MPEG2-MPML)

AP_GeneralPurposeBDMPEG2MPatHL 

General Purpose BD Interchange with MPEG2 MP@HL (STD-GEN-BD-MPEG2-MPHL)

AP_GeneralPurposeBDMPEG4HPatLV41 

General Purpose BD Interchange with MPEG-4 AVC/H.264 HiP@Level4.1 (STD-GEN-BD-MPEG4-HPLV41)

AP_GeneralPurposeBDMPEG4HPatLV41BD 

General Purpose BD Interchange with MPEG-4 AVC/H.264 BD-Compatible HiP@Level4.1 (STD-GEN-BD-MPEG4-HPLV41BD)

AP_GeneralPurposeBDMPEG4HPatLV42_2D 

General Purpose BD Interchange with MPEG-4 AVC/H.264 HiP@Level4.2 for 2D video (STD-GEN-BD-MPEG4-HPLV42-2D)

AP_GeneralPurposeBDMPEG4HPatLV42_3D 

General Purpose BD Interchange with MPEG-4 AVC/H.264 HiP@Level4.2 for 3D video (STD-GEN-BD-MPEG4-HPLV42-3D)

AP_GeneralPurposeBDMPEG4StereoHPatLV42 

General Purpose BD Interchange with MPEG-4 AVC/H.264 Stereo HiP@Level4.2 (STD-GEN-BD-MPEG4-SHPLV42)

AP_USBandFlashJPEG 

General Purpose USB and Flash Memory Interchange with JPEG (STD-GEN-USB/MMC/CF/SD-JPEG)

AP_USBandFlashJPEG2000 

General Purpose USB and Flash Memory Interchange with JPEG 2000 (STD-GEN-USB/MMC/CF/SD-J2K)

AP_GeneralPurposeMIME 

General Purpose MIME Interchange Profile (STD-GEN-MIME)

AP_MPEG2MPatMLDVD 

DVD Interchange with MPEG2 MP@ML (STD-DVD-MPEG2-MPML)

AP_BasicCardiac 

Basic Cardiac X-Ray Angiographic Studies on CD-R Media (STD-XABC-CD)

AP_XrayAngiographic 

1024 X-Ray Angiographic Studies on CD-R Media (STD-XA1K-CD)

AP_XrayAngiographicDVD 

1024 X-Ray Angiographic Studies on DVD Media (STD-XA1K-DVD)

AP_DentalRadiograph 

Dental Radiograph Interchange (STD-DEN-CD)

AP_CTandMR 

CT/MR Studies (STD-CTMR-xxxx)

AP_UltrasoundIDSF 

Ultrasound Single Frame for Image Display (STD-US-ID-SF-xxxx)

AP_UltrasoundSCSF 

Ultrasound Single Frame with Spatial Calibration (STD-US-SC-SF-xxxx)

AP_UltrasoundCCSF 

Ultrasound Single Frame with Combined Calibration (STD-US-CC-SF-xxxx)

AP_UltrasoundIDMF 

Ultrasound Single & Multi-Frame for Image Display (STD-US-ID-MF-xxxx)

AP_UltrasoundSCMF 

Ultrasound Single & Multi-Frame with Spatial Calibration (STD-UD-SC-MF-xxxx)

AP_UltrasoundCCMF 

Ultrasound Single & Multi-Frame with Combined Calibration (STD-UD-CC-MF-xxxx)

AP_TwelveLeadECG 

12-lead ECG Interchange on Diskette (STD-WVFM-ECG-FD)

AP_HemodynamicWaveform 

Hemodynamic Waveform Interchange on Diskette (STD-WVFM-HD-FD)

Constructor & Destructor Documentation

◆ DicomDirInterface()

DicomDirInterface::DicomDirInterface ( )

constructor (default).

No DICOMDIR object is created by default (see methods createNewDicomDir(), appendToDicomDir() and updateDicomDir()).

◆ ~DicomDirInterface()

virtual DicomDirInterface::~DicomDirInterface ( )
virtual

destructor (virtual).

Free all memory allocated by this class.

Member Function Documentation

◆ abortMode()

OFBool DicomDirInterface::abortMode ( ) const
inline

get current status of the "abort on first error" mode.

See enableAbortMode() for more details.

Returns
OFTrue if mode is enabled, OFFalse otherwise

◆ addDicomFile()

OFCondition DicomDirInterface::addDicomFile ( const OFFilename filename,
const OFFilename directory = OFFilename() 
)

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).

Parameters
filenamename of the DICOM file to be added
directorydirectory 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).
Returns
EC_Normal upon success, an error code otherwise

◆ addIconImage()

OFCondition DicomDirInterface::addIconImage ( DcmDirectoryRecord record,
DcmItem dataset,
const unsigned int  size,
const OFFilename 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.

Parameters
recorddirectory record where the icon image is stored
datasetDICOM dataset from which the icon image is possibly created
sizeresolution of the icon image to be created (width and height)
sourceFilenamename of the source DICOM file
Returns
EC_Normal upon success, an error code otherwise

◆ addImageSupport()

OFBool DicomDirInterface::addImageSupport ( DicomDirImagePlugin plugin)

add pluggable image support.

NB: This plugin is required to create icon images from DICOM files!

Parameters
pluginpointer to an instance of the plugin implementation. See class DicomDirImageImplementation (dcmjpeg/include/ddpiimpl.h).
Returns
OFTrue if successful, OFFalse otherwise

◆ addRecord()

DcmDirectoryRecord* DicomDirInterface::addRecord ( DcmDirectoryRecord parent,
const E_DirRecType  recordType,
DcmFileFormat fileformat,
const OFString referencedFileID,
const OFFilename sourceFilename 
)
protected

add child record to a given parent record.

A new record is only added if it does not already exist.

Parameters
parentparent record (add new record as a child of this one)
recordTypetype of directory record to be created
fileformatDICOM dataset containing data of the new record
referencedFileIDvalue of the Referenced File ID attribute
sourceFilenamename of the source DICOM file
Returns
pointer to new/existing record, NULL if an error occurred

◆ appendToDicomDir()

OFCondition DicomDirInterface::appendToDicomDir ( const E_ApplicationProfile  profile,
const OFFilename 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 disableBackupMode()) 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.
    Parameters
    profilemedia storage application profile to be used for the DICOMDIR. NB: The same profile should be used as for the creation of the DICOMDIR file.
    filenamename of the DICOMDIR file to be appended. The filename may include a fully qualified pathname.
    Returns
    EC_Normal upon success, an error code otherwise

◆ backupMode()

OFBool DicomDirInterface::backupMode ( ) const
inline

get current status of the "create backup" mode.

See disableBackupMode() for more details.

Returns
OFTrue if mode is enabled, OFFalse otherwise

◆ buildAssessmentRecord()

DcmDirectoryRecord* DicomDirInterface::buildAssessmentRecord ( DcmDirectoryRecord record,
DcmFileFormat fileformat,
const OFString referencedFileID,
const OFFilename sourceFilename 
)
protected

create or update assessment record and copy required values from dataset

Parameters
recordrecord to be updated, use NULL to create a new one
fileformatDICOM dataset of the current file
referencedFileIDvalue of the Referenced File ID attribute
sourceFilenamename of the source DICOM file
Returns
pointer to new or updated record, NULL if an error occurred

◆ buildCurveRecord()

DcmDirectoryRecord* DicomDirInterface::buildCurveRecord ( DcmDirectoryRecord record,
DcmFileFormat fileformat,
const OFString referencedFileID,
const OFFilename sourceFilename 
)
protected

create or update curve record and copy required values from dataset

Parameters
recordrecord to be updated, use NULL to create a new one
fileformatDICOM dataset of the current file
referencedFileIDvalue of the Referenced File ID attribute
sourceFilenamename of the source DICOM file
Returns
pointer to new or updated record, NULL if an error occurred

◆ buildEncapDocRecord()

DcmDirectoryRecord* DicomDirInterface::buildEncapDocRecord ( DcmDirectoryRecord record,
DcmFileFormat fileformat,
const OFString referencedFileID,
const OFFilename sourceFilename 
)
protected

create or update encap doc record and copy required values from dataset

Parameters
recordrecord to be updated, use NULL to create a new one
fileformatDICOM dataset of the current file
referencedFileIDvalue of the Referenced File ID attribute
sourceFilenamename of the source DICOM file
Returns
pointer to new or updated record, NULL if an error occurred

◆ buildFiducialRecord()

DcmDirectoryRecord* DicomDirInterface::buildFiducialRecord ( DcmDirectoryRecord record,
DcmFileFormat fileformat,
const OFString referencedFileID,
const OFFilename sourceFilename 
)
protected

create or update fiducial record and copy required values from dataset

Parameters
recordrecord to be updated, use NULL to create a new one
fileformatDICOM dataset of the current file
referencedFileIDvalue of the Referenced File ID attribute
sourceFilenamename of the source DICOM file
Returns
pointer to new or updated record, NULL if an error occurred

◆ buildHangingProtocolRecord()

DcmDirectoryRecord* DicomDirInterface::buildHangingProtocolRecord ( DcmDirectoryRecord record,
DcmFileFormat fileformat,
const OFString referencedFileID,
const OFFilename sourceFilename 
)
protected

create or update hanging protocol record and copy required values from dataset

Parameters
recordrecord to be updated, use NULL to create a new one
fileformatDICOM dataset of the current file
referencedFileIDvalue of the Referenced File ID attribute
sourceFilenamename of the source DICOM file
Returns
pointer to new or updated record, NULL if an error occurred

◆ buildImageRecord()

DcmDirectoryRecord* DicomDirInterface::buildImageRecord ( DcmDirectoryRecord record,
DcmFileFormat fileformat,
const OFString referencedFileID,
const OFFilename sourceFilename 
)
protected

create or update image record and copy required values from dataset

Parameters
recordrecord to be updated, use NULL to create a new one
fileformatDICOM dataset of the current file
referencedFileIDvalue of the Referenced File ID attribute
sourceFilenamename of the source DICOM file
Returns
pointer to new or updated record, NULL if an error occurred

◆ buildImplantAssyRecord()

DcmDirectoryRecord* DicomDirInterface::buildImplantAssyRecord ( DcmDirectoryRecord record,
DcmFileFormat fileformat,
const OFString referencedFileID,
const OFFilename sourceFilename 
)
protected

create or update implant assy record and copy required values from dataset

Parameters
recordrecord to be updated, use NULL to create a new one
fileformatDICOM dataset of the current file
referencedFileIDvalue of the Referenced File ID attribute
sourceFilenamename of the source DICOM file
Returns
pointer to new or updated record, NULL if an error occurred

◆ buildImplantGroupRecord()

DcmDirectoryRecord* DicomDirInterface::buildImplantGroupRecord ( DcmDirectoryRecord record,
DcmFileFormat fileformat,
const OFString referencedFileID,
const OFFilename sourceFilename 
)
protected

create or update implant group record and copy required values from dataset

Parameters
recordrecord to be updated, use NULL to create a new one
fileformatDICOM dataset of the current file
referencedFileIDvalue of the Referenced File ID attribute
sourceFilenamename of the source DICOM file
Returns
pointer to new or updated record, NULL if an error occurred

◆ buildImplantRecord()

DcmDirectoryRecord* DicomDirInterface::buildImplantRecord ( DcmDirectoryRecord record,
DcmFileFormat fileformat,
const OFString referencedFileID,
const OFFilename sourceFilename 
)
protected

create or update implant record and copy required values from dataset

Parameters
recordrecord to be updated, use NULL to create a new one
fileformatDICOM dataset of the current file
referencedFileIDvalue of the Referenced File ID attribute
sourceFilenamename of the source DICOM file
Returns
pointer to new or updated record, NULL if an error occurred

◆ buildKeyObjectDocRecord()

DcmDirectoryRecord* DicomDirInterface::buildKeyObjectDocRecord ( DcmDirectoryRecord record,
DcmFileFormat fileformat,
const OFString referencedFileID,
const OFFilename sourceFilename 
)
protected

create or update key object doc record and copy required values from dataset

Parameters
recordrecord to be updated, use NULL to create a new one
fileformatDICOM dataset of the current file
referencedFileIDvalue of the Referenced File ID attribute
sourceFilenamename of the source DICOM file
Returns
pointer to new or updated record, NULL if an error occurred

◆ buildMeasurementRecord()

DcmDirectoryRecord* DicomDirInterface::buildMeasurementRecord ( DcmDirectoryRecord record,
DcmFileFormat fileformat,
const OFString referencedFileID,
const OFFilename sourceFilename 
)
protected

create or update measurement record and copy required values from dataset

Parameters
recordrecord to be updated, use NULL to create a new one
fileformatDICOM dataset of the current file
referencedFileIDvalue of the Referenced File ID attribute
sourceFilenamename of the source DICOM file
Returns
pointer to new or updated record, NULL if an error occurred

◆ buildModalityLutRecord()

DcmDirectoryRecord* DicomDirInterface::buildModalityLutRecord ( DcmDirectoryRecord record,
DcmFileFormat fileformat,
const OFString referencedFileID,
const OFFilename sourceFilename 
)
protected

create or update modality LUT record and copy required values from dataset

Parameters
recordrecord to be updated, use NULL to create a new one
fileformatDICOM dataset of the current file
referencedFileIDvalue of the Referenced File ID attribute
sourceFilenamename of the source DICOM file
Returns
pointer to new or updated record, NULL if an error occurred

◆ buildOverlayRecord()

DcmDirectoryRecord* DicomDirInterface::buildOverlayRecord ( DcmDirectoryRecord record,
DcmFileFormat fileformat,
const OFString referencedFileID,
const OFFilename sourceFilename 
)
protected

create or update overlay record and copy required values from dataset

Parameters
recordrecord to be updated, use NULL to create a new one
fileformatDICOM dataset of the current file
referencedFileIDvalue of the Referenced File ID attribute
sourceFilenamename of the source DICOM file
Returns
pointer to new or updated record, NULL if an error occurred

◆ buildPaletteRecord()

DcmDirectoryRecord* DicomDirInterface::buildPaletteRecord ( DcmDirectoryRecord record,
DcmFileFormat fileformat,
const OFString referencedFileID,
const OFFilename sourceFilename 
)
protected

create or update palette record and copy required values from dataset

Parameters
recordrecord to be updated, use NULL to create a new one
fileformatDICOM dataset of the current file
referencedFileIDvalue of the Referenced File ID attribute
sourceFilenamename of the source DICOM file
Returns
pointer to new or updated record, NULL if an error occurred

◆ buildPatientRecord()

DcmDirectoryRecord* DicomDirInterface::buildPatientRecord ( DcmDirectoryRecord record,
DcmFileFormat fileformat,
const OFFilename sourceFilename 
)
protected

create or update patient record and copy required values from dataset

Parameters
recordrecord to be updated, use NULL to create a new one
fileformatDICOM dataset of the current file
sourceFilenamename of the source DICOM file
Returns
pointer to new or updated record, NULL if an error occurred

◆ buildPlanRecord()

DcmDirectoryRecord* DicomDirInterface::buildPlanRecord ( DcmDirectoryRecord record,
DcmFileFormat fileformat,
const OFString referencedFileID,
const OFFilename sourceFilename 
)
protected

create or update plan record and copy required values from dataset

Parameters
recordrecord to be updated, use NULL to create a new one
fileformatDICOM dataset of the current file
referencedFileIDvalue of the Referenced File ID attribute
sourceFilenamename of the source DICOM file
Returns
pointer to new or updated record, NULL if an error occurred

◆ buildPresentationRecord()

DcmDirectoryRecord* DicomDirInterface::buildPresentationRecord ( DcmDirectoryRecord record,
DcmFileFormat fileformat,
const OFString referencedFileID,
const OFFilename sourceFilename 
)
protected

create or update presentation state record and copy required values from dataset

Parameters
recordrecord to be updated, use NULL to create a new one
fileformatDICOM dataset of the current file
referencedFileIDvalue of the Referenced File ID attribute
sourceFilenamename of the source DICOM file
Returns
pointer to new or updated record, NULL if an error occurred

◆ buildRawDataRecord()

DcmDirectoryRecord* DicomDirInterface::buildRawDataRecord ( DcmDirectoryRecord record,
DcmFileFormat fileformat,
const OFString referencedFileID,
const OFFilename sourceFilename 
)
protected

create or update raw data record and copy required values from dataset

Parameters
recordrecord to be updated, use NULL to create a new one
fileformatDICOM dataset of the current file
referencedFileIDvalue of the Referenced File ID attribute
sourceFilenamename of the source DICOM file
Returns
pointer to new or updated record, NULL if an error occurred

◆ buildRegistrationRecord()

DcmDirectoryRecord* DicomDirInterface::buildRegistrationRecord ( DcmDirectoryRecord record,
DcmFileFormat fileformat,
const OFString referencedFileID,
const OFFilename sourceFilename 
)
protected

create or update registration record and copy required values from dataset

Parameters
recordrecord to be updated, use NULL to create a new one
fileformatDICOM dataset of the current file
referencedFileIDvalue of the Referenced File ID attribute
sourceFilenamename of the source DICOM file
Returns
pointer to new or updated record, NULL if an error occurred

◆ buildRTDoseRecord()

DcmDirectoryRecord* DicomDirInterface::buildRTDoseRecord ( DcmDirectoryRecord record,
DcmFileFormat fileformat,
const OFString referencedFileID,
const OFFilename sourceFilename 
)
protected

create or update RT dose record and copy required values from dataset

Parameters
recordrecord to be updated, use NULL to create a new one
fileformatDICOM dataset of the current file
referencedFileIDvalue of the Referenced File ID attribute
sourceFilenamename of the source DICOM file
Returns
pointer to new or updated record, NULL if an error occurred

◆ buildRTPlanRecord()

DcmDirectoryRecord* DicomDirInterface::buildRTPlanRecord ( DcmDirectoryRecord record,
DcmFileFormat fileformat,
const OFString referencedFileID,
const OFFilename sourceFilename 
)
protected

create or update RT plan record and copy required values from dataset

Parameters
recordrecord to be updated, use NULL to create a new one
fileformatDICOM dataset of the current file
referencedFileIDvalue of the Referenced File ID attribute
sourceFilenamename of the source DICOM file
Returns
pointer to new or updated record, NULL if an error occurred

◆ buildRTStructureSetRecord()

DcmDirectoryRecord* DicomDirInterface::buildRTStructureSetRecord ( DcmDirectoryRecord record,
DcmFileFormat fileformat,
const OFString referencedFileID,
const OFFilename sourceFilename 
)
protected

create or update RT structure set record and copy required values from dataset

Parameters
recordrecord to be updated, use NULL to create a new one
fileformatDICOM dataset of the current file
referencedFileIDvalue of the Referenced File ID attribute
sourceFilenamename of the source DICOM file
Returns
pointer to new or updated record, NULL if an error occurred

◆ buildRTTreatmentRecord()

DcmDirectoryRecord* DicomDirInterface::buildRTTreatmentRecord ( DcmDirectoryRecord record,
DcmFileFormat fileformat,
const OFString referencedFileID,
const OFFilename sourceFilename 
)
protected

create or update RT treatment record and copy required values from dataset

Parameters
recordrecord to be updated, use NULL to create a new one
fileformatDICOM dataset of the current file
referencedFileIDvalue of the Referenced File ID attribute
sourceFilenamename of the source DICOM file
Returns
pointer to new or updated record, NULL if an error occurred

◆ buildSeriesRecord()

DcmDirectoryRecord* DicomDirInterface::buildSeriesRecord ( DcmDirectoryRecord record,
DcmFileFormat fileformat,
const OFFilename sourceFilename 
)
protected

create or update new series record and copy required values from dataset

Parameters
recordrecord to be updated, use NULL to create a new one
fileformatDICOM dataset of the current file
sourceFilenamename of the source DICOM file
Returns
pointer to new or updated record, NULL if an error occurred

◆ buildSpectroscopyRecord()

DcmDirectoryRecord* DicomDirInterface::buildSpectroscopyRecord ( DcmDirectoryRecord record,
DcmFileFormat fileformat,
const OFString referencedFileID,
const OFFilename sourceFilename 
)
protected

create or update spectroscopy record and copy required values from dataset

Parameters
recordrecord to be updated, use NULL to create a new one
fileformatDICOM dataset of the current file
referencedFileIDvalue of the Referenced File ID attribute
sourceFilenamename of the source DICOM file
Returns
pointer to new or updated record, NULL if an error occurred

◆ buildStereometricRecord()

DcmDirectoryRecord* DicomDirInterface::buildStereometricRecord ( DcmDirectoryRecord record,
DcmFileFormat fileformat,
const OFString referencedFileID,
const OFFilename sourceFilename 
)
protected

create or update stereometric record and copy required values from dataset

Parameters
recordrecord to be updated, use NULL to create a new one
fileformatDICOM dataset of the current file
referencedFileIDvalue of the Referenced File ID attribute
sourceFilenamename of the source DICOM file
Returns
pointer to new or updated record, NULL if an error occurred

◆ buildStoredPrintRecord()

DcmDirectoryRecord* DicomDirInterface::buildStoredPrintRecord ( DcmDirectoryRecord record,
DcmFileFormat fileformat,
const OFString referencedFileID,
const OFFilename sourceFilename 
)
protected

create or update stored print record and copy required values from dataset

Parameters
recordrecord to be updated, use NULL to create a new one
fileformatDICOM dataset of the current file
referencedFileIDvalue of the Referenced File ID attribute
sourceFilenamename of the source DICOM file
Returns
pointer to new or updated record, NULL if an error occurred

◆ buildStructReportRecord()

DcmDirectoryRecord* DicomDirInterface::buildStructReportRecord ( DcmDirectoryRecord record,
DcmFileFormat fileformat,
const OFString referencedFileID,
const OFFilename sourceFilename 
)
protected

create or update structure reporting record and copy required values from dataset

Parameters
recordrecord to be updated, use NULL to create a new one
fileformatDICOM dataset of the current file
referencedFileIDvalue of the Referenced File ID attribute
sourceFilenamename of the source DICOM file
Returns
pointer to new or updated record, NULL if an error occurred

◆ buildStudyRecord()

DcmDirectoryRecord* DicomDirInterface::buildStudyRecord ( DcmDirectoryRecord record,
DcmFileFormat fileformat,
const OFFilename sourceFilename 
)
protected

create or update study record and copy required values from dataset

Parameters
recordrecord to be updated, use NULL to create a new one
fileformatDICOM dataset of the current file
sourceFilenamename of the source DICOM file
Returns
pointer to new or updated record, NULL if an error occurred

◆ buildSurfaceRecord()

DcmDirectoryRecord* DicomDirInterface::buildSurfaceRecord ( DcmDirectoryRecord record,
DcmFileFormat fileformat,
const OFString referencedFileID,
const OFFilename sourceFilename 
)
protected

create or update surface record and copy required values from dataset

Parameters
recordrecord to be updated, use NULL to create a new one
fileformatDICOM dataset of the current file
referencedFileIDvalue of the Referenced File ID attribute
sourceFilenamename of the source DICOM file
Returns
pointer to new or updated record, NULL if an error occurred

◆ buildSurfaceScanRecord()

DcmDirectoryRecord* DicomDirInterface::buildSurfaceScanRecord ( DcmDirectoryRecord record,
DcmFileFormat fileformat,
const OFString referencedFileID,
const OFFilename sourceFilename 
)
protected

create or update surface scan record and copy required values from dataset

Parameters
recordrecord to be updated, use NULL to create a new one
fileformatDICOM dataset of the current file
referencedFileIDvalue of the Referenced File ID attribute
sourceFilenamename of the source DICOM file
Returns
pointer to new or updated record, NULL if an error occurred

◆ buildTractRecord()

DcmDirectoryRecord* DicomDirInterface::buildTractRecord ( DcmDirectoryRecord record,
DcmFileFormat fileformat,
const OFString referencedFileID,
const OFFilename sourceFilename 
)
protected

create or update tract record and copy required values from dataset

Parameters
recordrecord to be updated, use NULL to create a new one
fileformatDICOM dataset of the current file
referencedFileIDvalue of the Referenced File ID attribute
sourceFilenamename of the source DICOM file
Returns
pointer to new or updated record, NULL if an error occurred

◆ buildValueMapRecord()

DcmDirectoryRecord* DicomDirInterface::buildValueMapRecord ( DcmDirectoryRecord record,
DcmFileFormat fileformat,
const OFString referencedFileID,
const OFFilename sourceFilename 
)
protected

create or update value map record and copy required values from dataset

Parameters
recordrecord to be updated, use NULL to create a new one
fileformatDICOM dataset of the current file
referencedFileIDvalue of the Referenced File ID attribute
sourceFilenamename of the source DICOM file
Returns
pointer to new or updated record, NULL if an error occurred

◆ buildVoiLutRecord()

DcmDirectoryRecord* DicomDirInterface::buildVoiLutRecord ( DcmDirectoryRecord record,
DcmFileFormat fileformat,
const OFString referencedFileID,
const OFFilename sourceFilename 
)
protected

create or update VOI LUT record and copy required values from dataset

Parameters
recordrecord to be updated, use NULL to create a new one
fileformatDICOM dataset of the current file
referencedFileIDvalue of the Referenced File ID attribute
sourceFilenamename of the source DICOM file
Returns
pointer to new or updated record, NULL if an error occurred

◆ buildWaveformRecord()

DcmDirectoryRecord* DicomDirInterface::buildWaveformRecord ( DcmDirectoryRecord record,
DcmFileFormat fileformat,
const OFString referencedFileID,
const OFFilename sourceFilename 
)
protected

create or update waveform record and copy required values from dataset

Parameters
recordrecord to be updated, use NULL to create a new one
fileformatDICOM dataset of the current file
referencedFileIDvalue of the Referenced File ID attribute
sourceFilenamename of the source DICOM file
Returns
pointer to new or updated record, NULL if an error occurred

◆ checkBasicCardiacAttributes()

OFCondition DicomDirInterface::checkBasicCardiacAttributes ( DcmItem dataset,
const OFFilename filename 
)
protected

check attributes for compliance with Basic Cardiac application profile

Parameters
datasetobject where the DICOM dataset is stored
filenamename of the DICOM file to be checked
Returns
EC_Normal upon success, an error code otherwise

◆ checkCTandMRAttributes()

OFCondition DicomDirInterface::checkCTandMRAttributes ( DcmItem dataset,
const OFString sopClass,
const OFFilename filename 
)
protected

check attributes for compliance with CT and MR application profile

Parameters
datasetobject where the DICOM dataset is stored
sopClassSOP class of the DICOM data to be checked
filenamename of the DICOM file to be checked
Returns
EC_Normal upon success, an error code otherwise

◆ checkDentalRadiographAttributes()

OFCondition DicomDirInterface::checkDentalRadiographAttributes ( DcmItem dataset,
const OFFilename filename 
)
protected

check attributes for compliance with dental radiograph application profile

Parameters
datasetobject where the DICOM dataset is stored
filenamename of the DICOM file to be checked
Returns
EC_Normal upon success, an error code otherwise

◆ checkDicomFile()

OFCondition DicomDirInterface::checkDicomFile ( const OFFilename filename,
const OFFilename directory = OFFilename(),
const OFBool  checkFilename = OFTrue 
)

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.

Parameters
filenamename of the DICOM file to be checked
directorydirectory 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).
checkFilenameflag indicating whether to check the filename with isFilenameValid() or not. In case where the DICOM file is copied or renamed after this method is called, it might be useful to disable this check.
Returns
EC_Normal upon success, an error code otherwise

◆ checkExists()

OFBool DicomDirInterface::checkExists ( DcmItem dataset,
const DcmTagKey key,
const OFFilename filename = OFFilename() 
)
protected

check whether given tag exists in the DICOM dataset

Parameters
datasetDICOM dataset to be checked
keytag to be searched for
filenameof the file (optional, report any error if non-empty)
Returns
OFTrue if tag exists, OFFalse otherwise

◆ checkExistsWithIntegerValue()

OFBool DicomDirInterface::checkExistsWithIntegerValue ( DcmItem dataset,
const DcmTagKey key,
const long  value,
const OFFilename filename = OFFilename(),
const OFBool  reject = OFTrue 
)
protected

check whether given tag exists in the DICOM dataset and has the expected integer value

Parameters
datasetDICOM dataset to be checked
keytag to be searched for
valueexpected integer value
filenameof the file (optional, report any error if non-empty)
rejectreport an "Error" if OFTrue, a "Warning" if OFFalse
Returns
OFTrue if tag exists with given string value, OFFalse otherwise

◆ checkExistsWithMinMaxValue()

OFBool DicomDirInterface::checkExistsWithMinMaxValue ( DcmItem dataset,
const DcmTagKey key,
const long  min,
const long  max,
const OFFilename filename = OFFilename(),
const OFBool  reject = OFTrue 
)
protected

check whether given tag exists in the DICOM dataset and has an integer value in the expected range

Parameters
datasetDICOM dataset to be checked
keytag to be searched for
minminimum integer value of the expected range
maxmaximum integer value of the expected range
filenameof the file (optional, report any error if non-empty)
rejectreport an "Error" if OFTrue, a "Warning" if OFFalse
Returns
OFTrue if tag exists with given string value, OFFalse otherwise

◆ checkExistsWithStringValue()

OFBool DicomDirInterface::checkExistsWithStringValue ( DcmItem dataset,
const DcmTagKey key,
const OFString value,
const OFFilename filename = OFFilename() 
)
protected

check whether given tag exists in the DICOM dataset and has the expected string value

Parameters
datasetDICOM dataset to be checked
keytag to be searched for
valueexpected string value
filenameof the file (optional, report any error if non-empty)
Returns
OFTrue if tag exists with given string value, OFFalse otherwise

◆ checkExistsWithValue()

OFBool DicomDirInterface::checkExistsWithValue ( DcmItem dataset,
const DcmTagKey key,
const OFFilename filename = OFFilename() 
)
protected

check whether given tag exists with a value in the DICOM dataset

Parameters
datasetDICOM dataset to be checked
keytag to be searched for
filenameof the file (optional, report any error if non-empty)
Returns
OFTrue if tag exists with value, OFFalse otherwise

◆ checkFilesetID()

OFBool DicomDirInterface::checkFilesetID ( const OFString filesetID)
protected

check whether given file-set ID is valid

Parameters
filesetIDfile-set ID to be checked
Returns
OFTrue if ID is valid, OFFalse otherwise

◆ checkMandatoryAttributes()

OFCondition DicomDirInterface::checkMandatoryAttributes ( DcmMetaInfo metainfo,
DcmItem dataset,
const OFFilename filename 
)
protected

check attributes for compliance with current application profile

Parameters
metainfoobject where the DICOM file meta information is stored
datasetobject where the DICOM dataset is stored
filenamename of the DICOM file to be checked
Returns
EC_Normal upon success, an error code otherwise

◆ checkReferencedSOPInstance()

OFBool DicomDirInterface::checkReferencedSOPInstance ( DcmDirectoryRecord record,
DcmItem dataset,
const OFString referencedFileID,
const OFFilename sourceFilename 
)
protected

check referenced SOP instance for consistency with a new directory record

Parameters
recorddirectory record to be checked
datasetDICOM dataset containing data of the new record
referencedFileIDvalue of the Referenced File ID attribute
sourceFilenamename of the source DICOM file
Returns
OFTrue if the data is consistent, OFFalse otherwise

◆ checkSOPClassAndXfer()

OFCondition DicomDirInterface::checkSOPClassAndXfer ( DcmMetaInfo metainfo,
DcmItem dataset,
const OFFilename filename 
)
protected

check SOP class and transfer syntax for compliance with current profile

Parameters
metainfoobject where the DICOM file meta information is stored
datasetobject where the DICOM dataset is stored
filenamename of the DICOM file to be checked
Returns
EC_Normal upon success, an error code otherwise

◆ checkUltrasoundAttributes()

OFCondition DicomDirInterface::checkUltrasoundAttributes ( DcmItem dataset,
const OFString transferSyntax,
const OFFilename filename 
)
protected

check attributes for compliance with Ultrasound application profiles

Parameters
datasetobject where the DICOM dataset is stored
transferSyntaxtransfer syntax of the DICOM data to be checked
filenamename of the DICOM file to be checked
Returns
EC_Normal upon success, an error code otherwise

◆ checkXrayAngiographicAttributes()

OFCondition DicomDirInterface::checkXrayAngiographicAttributes ( DcmItem dataset,
const OFString sopClass,
const OFFilename filename 
)
protected

check attributes for compliance with X-ray Angiography application profile

Parameters
datasetobject where the DICOM dataset is stored
sopClassSOP class of the DICOM data to be checked
filenamename of the DICOM file to be checked
Returns
EC_Normal upon success, an error code otherwise

◆ cleanup()

void DicomDirInterface::cleanup ( )

reset the object to its initial state.

That means e.g. free memory.

◆ compareSequenceAttributes()

OFBool DicomDirInterface::compareSequenceAttributes ( DcmItem dataset,
DcmTagKey key,
DcmDirectoryRecord record,
const OFFilename sourceFilename 
)
protected

compare sequence attribute from dataset and record and report any deviation

Parameters
datasetDICOM dataset where the sequence value is stored
keytag of the sequence to be compared
recorddirectory record where the sequence value is stored
sourceFilenamename of the source DICOM file
Returns
OFTrue if sequences are identical, OFFalse otherwise

◆ compareStringAttributes()

OFBool DicomDirInterface::compareStringAttributes ( DcmItem dataset,
const DcmTagKey datKey,
DcmDirectoryRecord record,
const DcmTagKey recKey,
const OFFilename sourceFilename,
const OFBool  errorMsg = OFFalse 
)
protected

compare string attribute from dataset and record and report any deviation

Parameters
datasetDICOM dataset where the string value is stored
datKeytag of the string value to be compared (dataset)
recorddirectory record where the string value is stored
recKeytag of the string value to be compared (record)
sourceFilenamename of the source DICOM file
errorMsgreport error if true, warning message otherwise (default)
Returns
OFTrue if string values are identical, OFFalse otherwise

◆ consistencyCheck()

OFBool DicomDirInterface::consistencyCheck ( ) const
inline

get current status of the "consistency check" mode.

See disableConsistencyCheck() for more details.

Returns
OFTrue if check is enabled, OFFalse otherwise

◆ copyElement()

void DicomDirInterface::copyElement ( DcmItem dataset,
const DcmTagKey key,
DcmDirectoryRecord record,
const OFFilename sourceFilename,
const OFBool  optional = OFFalse,
const OFBool  copyEmpty = OFTrue 
)
protected

copy element from given dataset to directory record

Parameters
datasetDICOM dataset containing the original data
keytag of the element to be copied
recorddirectory record to which the element is to be copied
sourceFilenamename of the source DICOM file
optionalflag indicating whether the element is optional or required
copyEmptyflag indicating whether to copy an empty element (no value)

◆ copyElementType1()

void DicomDirInterface::copyElementType1 ( DcmItem dataset,
const DcmTagKey key,
DcmDirectoryRecord record,
const OFFilename sourceFilename 
)
inlineprotected

copy type 1 element from given dataset to directory record

Parameters
datasetDICOM dataset containing the original data
keytag of the element to be copied
recorddirectory record to which the element is to be copied
sourceFilenamename of the source DICOM file

◆ copyElementType1C()

void DicomDirInterface::copyElementType1C ( DcmItem dataset,
const DcmTagKey key,
DcmDirectoryRecord record,
const OFFilename sourceFilename 
)
inlineprotected

copy type 1C element from given dataset to directory record

Parameters
datasetDICOM dataset containing the original data
keytag of the element to be copied
recorddirectory record to which the element is to be copied
sourceFilenamename of the source DICOM file

◆ copyElementType1CFromDatasetOrSequenceItem()

void DicomDirInterface::copyElementType1CFromDatasetOrSequenceItem ( DcmItem dataset,
const DcmTagKey elementKey,
const DcmTagKey sequenceKey,
DcmDirectoryRecord record,
const OFFilename sourceFilename 
)
protected

copy type 1C element from given dataset or first item of the given sequence to directory record.

Typically, the SharedFunctionalGroupsSequence is used with this method.

Parameters
datasetDICOM dataset containing the original data
elementKeytag of the element to be copied
sequenceKeytag of the sequence element to be used in case the element cannot be found on the main dataset level
recorddirectory record to which the element is to be copied
sourceFilenamename of the source DICOM file

◆ copyElementType2()

void DicomDirInterface::copyElementType2 ( DcmItem dataset,
const DcmTagKey key,
DcmDirectoryRecord record,
const OFFilename sourceFilename 
)
inlineprotected

copy type 2 element from given dataset to directory record

Parameters
datasetDICOM dataset containing the original data
keytag of the element to be copied
recorddirectory record to which the element is to be copied
sourceFilenamename of the source DICOM file

◆ copyElementType3()

void DicomDirInterface::copyElementType3 ( DcmItem dataset,
const DcmTagKey key,
DcmDirectoryRecord record,
const OFFilename sourceFilename 
)
inlineprotected

copy type 3 element from given dataset to directory record

Parameters
datasetDICOM dataset containing the original data
keytag of the element to be copied
recorddirectory record to which the element is to be copied
sourceFilenamename of the source DICOM file

◆ copyFile()

OFBool DicomDirInterface::copyFile ( const OFFilename fromFilename,
const OFFilename toFilename 
)
protected

copy contents of specified file

Parameters
fromFilenamename of the file to be copied
toFilenamename of the new file (copy of 'fromFilename')
Returns
OFTrue if successful, OFFalse otherwise

◆ copyStringWithDefault()

void DicomDirInterface::copyStringWithDefault ( DcmItem dataset,
const DcmTagKey key,
DcmDirectoryRecord record,
const OFFilename sourceFilename,
const char *  defaultValue = "",
const OFBool  printWarning = OFFalse 
)
protected

copy optional string value from given dataset to directory record

Parameters
datasetDICOM dataset containing the original data
keytag of the element value to be copied
recorddirectory record to which the element value is to be copied
sourceFilenamename of the source DICOM file
defaultValuedefault string value used in case the element is missing
printWarningprint warning message if element does not exist (with a value) and no default value is given

◆ createDicomDirBackup()

void DicomDirInterface::createDicomDirBackup ( const OFFilename filename)
protected

create backup of a given file

Parameters
filenamename of the file to be backuped

◆ createNewDicomDir()

OFCondition DicomDirInterface::createNewDicomDir ( const E_ApplicationProfile  profile = AP_GeneralPurpose,
const OFFilename filename = OFFilename(DEFAULT_DICOMDIR_NAME),
const OFString 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 disableBackupMode()) 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.

Parameters
profilemedia storage application profile to be used for the DICOMDIR
filenamename of the DICOMDIR file to be created (default: 'DICOMDIR'). The filename may include a fully qualified pathname.
filesetIDvalue of the attribute FileSetID (default: 'DCMTK_MEDIA_DEMO', might be empty)
Returns
EC_Normal upon success, an error code otherwise

◆ disableBackupMode()

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"

Parameters
newModedisable mode if OFFalse, enable if OFTrue
Returns
previously stored value

◆ disableConsistencyCheck()

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

Parameters
newModedisable check if OFFalse, enable if OFTrue
Returns
previously stored value

◆ disableEncodingCheck()

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. Default: on, check pixel encoding (bits allocated/stored, high bit)

Warning
Please use this switch with care since the resulting DICOMDIR will probably violate the rules for the selected application profile.
Parameters
newModedisable check if OFFalse, enable if OFTrue
Returns
previously stored value

◆ disableFileFormatCheck()

OFBool DicomDirInterface::disableFileFormatCheck ( const OFBool  newMode = OFFalse)

disable/enable the "DICOM file format check".

If this mode is disabled, it is not checked whether the file to be added contains file meta information (according to DICOM part 10). Default: on, check DICOM file format

Warning
Please use this switch with care since the resulting DICOMDIR will violate the rules of the DICOM standard if it references files that are missing the file meta information.
Parameters
newModedisable check if OFFalse, enable if OFTrue
Returns
previously stored value

◆ disableResolutionCheck()

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. Default: on, check spatial resolution

Warning
Please use this switch with care since the resulting DICOMDIR will probably violate the rules for the selected application profile.
Parameters
newModedisable check if OFFalse, enable if OFTrue
Returns
previously stored value

◆ disableTransferSyntaxCheck()

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. Default: on, check transfer syntax

Warning
Please use this switch with care since the resulting DICOMDIR will probably violate the rules for the selected application profile.
Parameters
newModedisable check if OFFalse, enable if OFTrue
Returns
previously stored value

◆ enableAbortMode()

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

Parameters
newModeenable mode if OFTrue, disable if OFFalse
Returns
previously stored value

◆ enableIconImageMode()

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

Parameters
newModeenable mode if OFTrue, disable if OFFalse
Returns
previously stored value

◆ enableInventMode()

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

Parameters
newModeenable mode if OFTrue, disable if OFFalse
Returns
previously stored value

◆ enableInventPatientIDMode()

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

Parameters
newModeenable mode if OFTrue, disable if OFFalse
Returns
previously stored value

◆ enableMapFilenamesMode()

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

Parameters
newModeenable mode if OFTrue, disable if OFFalse
Returns
previously stored value

◆ enableRetiredSOPClassSupport()

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

Parameters
newModeenable mode if OFTrue, disable if OFFalse
Returns
previously stored value

◆ encodingCheck()

OFBool DicomDirInterface::encodingCheck ( ) const
inline

get current status of the "pixel encoding check" mode.

See disableEncodingCheck() for more details.

Returns
OFTrue if check is enabled, OFFalse otherwise

◆ fileFormatCheck()

OFBool DicomDirInterface::fileFormatCheck ( ) const
inline

get current status of the "DICOM file format check" mode.

See disableFileFormatCheck() for more details.

Returns
OFTrue if check is enabled, OFFalse otherwise

◆ findExistingRecord()

DcmDirectoryRecord* DicomDirInterface::findExistingRecord ( DcmDirectoryRecord parent,
const E_DirRecType  recordType,
DcmItem dataset 
)
protected

search for a given directory record

Parameters
parenthigher-level structure where the records are stored
recordTypetype of directory record to be searched for
datasetDICOM dataset of the current file
Returns
pointer to record if found, NULL otherwise

◆ getIconFromDataset()

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.

Parameters
datasetDICOM dataset from which the icon image is created
pixelpointer to memory buffer where the pixel data are to be stored
countnumber of bytes allocated for the 'pixel' memory buffer
widthwidth of the scaled icon image (in pixels )
heightheight of the scaled icon image (in pixels)
Returns
OFTrue if successful, OFFalse otherwise

◆ getIconFromFile()

OFBool DicomDirInterface::getIconFromFile ( const OFFilename 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.

Parameters
filenamename of the PGM file to be loaded
pixelpointer to memory buffer where the pixel data are to be stored
countnumber of bytes allocated for the 'pixel' memory buffer
widthwidth of the scaled icon image (in pixels )
heightheight of the scaled icon image (in pixels)
Returns
OFTrue if successful, OFFalse otherwise

◆ getProfileName()

static const char* DicomDirInterface::getProfileName ( const E_ApplicationProfile  profile)
static

get name/identifier associated with the given application profile

Parameters
profilemedia storage application profile
Returns
name of the application profile (e.g. "STD-GEN-CD/DVD-RAM")

◆ getStringComponentFromDataset()

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)

Parameters
datasetdataset from which the string value is to be retrieved
keytag of the attribute to be retrieved
resultstring variable in which the resulting value is stored
posindex of the component in case of multi-valued elements (0..vm-1)
searchIntoSubflag indicating whether to do a deep search or not
Returns
reference to the resulting string value (parameter 'result')

◆ getStringFromDataset()

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)

Parameters
datasetdataset from which the string value is to be retrieved
keytag of the attribute to be retrieved
resultstring variable in which the resulting value is stored
searchIntoSubflag indicating whether to do a deep search or not
Returns
reference to the resulting string value (parameter 'result')

◆ getStringFromFile()

OFString& DicomDirInterface::getStringFromFile ( const OFFilename filename,
const DcmTagKey key,
OFString result,
OFBool  searchIntoSub = OFFalse 
)
protected

get string value from file and report an error (if any)

Parameters
filenamename of the file from which the string value is to be retrieved
keytag of the attribute to be retrieved
resultstring variable in which the resulting value is stored
searchIntoSubflag indicating whether to do a deep search or not
Returns
reference to the resulting string value (parameter 'result')

◆ iconImageMode()

OFBool DicomDirInterface::iconImageMode ( ) const
inline

get current status of the "create icon images" mode.

See enableIconImageMode() for more details.

Returns
OFTrue if mode is enabled, OFFalse otherwise

◆ inventMissingAttributes()

void DicomDirInterface::inventMissingAttributes ( DcmDirectoryRecord parent,
const OFBool  recurse = OFTrue 
)
protected

invent missing type 1 attributes for all child records (from patient level)

Parameters
parentinvent missing attributes for all children of this record (root)
recurseinvent missing attributes also for lower level records if OFTrue. Only invent attributes for the top (patient) level if OFFalse.

◆ inventMissingInstanceLevelAttributes()

void DicomDirInterface::inventMissingInstanceLevelAttributes ( DcmDirectoryRecord parent)
protected

invent missing type 1 attributes for all child records (from instance level)

Parameters
parentinvent missing attributes for all children of this record

◆ inventMissingSeriesLevelAttributes()

void DicomDirInterface::inventMissingSeriesLevelAttributes ( DcmDirectoryRecord parent)
protected

invent missing type 1 attributes for all child records (from series level)

Parameters
parentinvent missing attributes for all children of this record

◆ inventMissingStudyLevelAttributes()

void DicomDirInterface::inventMissingStudyLevelAttributes ( DcmDirectoryRecord parent)
protected

invent missing type 1 attributes for all child records (from study level)

Parameters
parentinvent missing attributes for all children of this record

◆ inventMode()

OFBool DicomDirInterface::inventMode ( ) const
inline

get current status of the "invent missing values" mode.

See enableInventMode() for more details.

Returns
OFTrue if mode is enabled, OFFalse otherwise

◆ inventPatientIDMode()

OFBool DicomDirInterface::inventPatientIDMode ( ) const
inline

get current status of the "invent missing patient ID" mode.

See enableInventPatientIDMode() for more details.

Returns
OFTrue if mode is enabled, OFFalse otherwise

◆ isCharsetValid()

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.

Parameters
charsetcharacter set identifier to be checked
Returns
OFTrue if charset is valid, OFFalse otherwise

◆ isDicomDirValid()

OFBool DicomDirInterface::isDicomDirValid ( ) const

check whether current DICOMDIR is valid.

That means e.g. that it can be written to a file.

Returns
OFTrue if DICOMDIR is valid, OFFalse otherwise

◆ isFilenameValid()

OFBool DicomDirInterface::isFilenameValid ( const OFFilename 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).

Parameters
filenamefilename to be checked for standard conformance
allowEmptyempty filename (zero length) allowed if OFTrue
Returns
OFTrue if filename is valid, OFFalse otherwise

◆ loadAndCheckDicomFile()

OFCondition DicomDirInterface::loadAndCheckDicomFile ( const OFFilename filename,
const OFFilename directory,
DcmFileFormat fileformat,
const OFBool  checkFilename = OFTrue 
)
protected

load and check DICOM file regarding the current application profile

Parameters
filenamename of the DICOM file to be checked
directorydirectory where the DICOM file is stored (optional)
fileformatobject in which the loaded data is stored
checkFilenameflag indicating whether to check the filename with isFilenameValid() or not
Returns
EC_Normal upon success, an error code otherwise

◆ mapFilenamesMode()

OFBool DicomDirInterface::mapFilenamesMode ( ) const
inline

get current status of the "map filenames" mode.

See enableMapFilenamesMode() for more details.

Returns
OFTrue if mode is enabled, OFFalse otherwise

◆ printAttributeErrorMessage()

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>"

Parameters
keyaffected tag
errorstatus to be reported (only if ".bad()")
operationname of the operation that failed (optional, might be NULL)

◆ printRecordErrorMessage()

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"

Parameters
errorstatus to be reported (only if ".bad()")
recordTypetype of directory record which caused the error
operationname of the operation that failed (optional, might be NULL)

◆ printRequiredAttributeMessage()

void DicomDirInterface::printRequiredAttributeMessage ( const DcmTagKey key,
const OFFilename filename = OFFilename(),
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>]"

Parameters
keyaffected tag
filenamename of the file (optional, might be empty)
emptyMsgprint "empty" if OFTrue, "missing" otherwise

◆ printUnexpectedValueMessage()

void DicomDirInterface::printUnexpectedValueMessage ( const DcmTagKey key,
const OFFilename filename = OFFilename(),
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>]"

Parameters
keyaffected tag
filenamename of the file (optional, might be empty)
errorMsgprint error message if OFTrue, a warning message otherwise

◆ recordMatchesDataset()

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.

Parameters
recorddirectory record to be checked
datasetDICOM dataset of the current file
Returns
OFTrue if record matches, OFFalse otherwise

◆ recordTypeToName()

static OFString DicomDirInterface::recordTypeToName ( const E_DirRecType  recordType)
static

get string associated with the given directory record entry type.

Parameters
recordTyperecord type
Returns
text string representing the record type

◆ resolutionCheck()

OFBool DicomDirInterface::resolutionCheck ( ) const
inline

get current status of the "spatial resolution check" mode.

See disableResolutionCheck() for more details.

Returns
OFTrue if check is enabled, OFFalse otherwise

◆ retiredSOPClassSupport()

OFBool DicomDirInterface::retiredSOPClassSupport ( ) const
inline

get current status of the "retired SOP class support" mode.

See enableRetiredSOPClassSupport() for more details.

Returns
OFTrue if support is enabled, OFFalse otherwise

◆ selectApplicationProfile()

OFCondition DicomDirInterface::selectApplicationProfile ( const E_ApplicationProfile  profile)
protected

select given application profile

Parameters
profilestorage media application profile to be selected
Returns
EC_Normal upon success, an error code otherwise

◆ setDefaultIcon()

OFCondition DicomDirInterface::setDefaultIcon ( const OFFilename 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.

Parameters
filenamename of the default PGM file
Returns
always returns EC_Normal

◆ setDefaultValue()

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

Parameters
recorddirectory record where the elements are stored
keytag of the element to be modified
numbernumeric value to be set as a the element value
prefixoptional prefix to be added to the numeric value

◆ setFilesetDescriptor()

OFCondition DicomDirInterface::setFilesetDescriptor ( const char *  filename,
const char *  charset = DEFAULT_DESCRIPTOR_CHARSET 
)

set the file-set 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. Requires a DICOMDIR object to exist (see createNewDicomDir(), appendToDicomDir() or updateDicomDir()).

Parameters
filenamename of the file-set descriptor file to be set
charsetcharacter set of the file-set descriptor file to be set. default: ISO Latin 1 ("ISO_IR 100"), use NULL or empty string to omit value.
Returns
EC_Normal upon success, an error code otherwise

◆ setIconPrefix()

OFCondition DicomDirInterface::setIconPrefix ( const OFFilename 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.

Parameters
prefixfilename prefix (empty value to disable = default)
Returns
always returns EC_Normal

◆ setIconSize()

OFCondition DicomDirInterface::setIconSize ( const unsigned int  size)

set preferred size of the icon images.

NB: some application profiles require a particular icon size. In those cases this manual setting is implicitly ignored.

Parameters
sizesize of the icon images in pixels (1..256, initial: 64)
Returns
EC_Normal upon success, an error code otherwise

◆ transferSyntaxCheck()

OFBool DicomDirInterface::transferSyntaxCheck ( ) const
inline

get current status of the "transfer syntax check" mode.

See disableTransferSyntaxCheck() for more details.

Returns
OFTrue if check is enabled, OFFalse otherwise

◆ updateDicomDir()

OFCondition DicomDirInterface::updateDicomDir ( const E_ApplicationProfile  profile,
const OFFilename 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 disableBackupMode()) 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.
    Parameters
    profilemedia storage application profile to be used for the DICOMDIR
    filenamename of the DICOMDIR file to be updated. The filename may include a fully qualified pathname.
    Returns
    EC_Normal upon success, an error code otherwise

◆ warnAboutInconsistentAttributes()

OFBool DicomDirInterface::warnAboutInconsistentAttributes ( DcmDirectoryRecord record,
DcmItem dataset,
const OFFilename sourceFilename,
const OFBool  abortCheck = OFFalse 
)
protected

check if all the attributes in record match the values in dataset and warn if not

Parameters
recorddirectory record to be checked
datasetDICOM dataset to be compared with the directory record
sourceFilenamename of the source DICOM file
abortCheckflag indicating whether to abort on the first inconsistent record
Returns
OFTrue in case of any inconsistency, OFFalse otherwise

◆ writeDicomDir()

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).

Parameters
encodingTypeflag, specifying the encoding with undefined or explicit length
groupLengthflag, specifying how to handle the group length tags
Returns
EC_Normal upon success, an error code otherwise

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


Generated on Thu Nov 29 2018 for DCMTK Version 3.6.4 by Doxygen 1.8.14