OFFIS DCMTK  Version 3.6.0
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
DcmDicomDir Class Reference

this class implements support for DICOMDIR files, which are special DICOM files containing a list of directory records, with a logical tree structure being implemented through references between records as byte offsets in file. More...

Collaboration diagram for DcmDicomDir:
[legend]

Public Member Functions

 DcmDicomDir ()
 default constructor
 
 DcmDicomDir (const char *fileName, const char *fileSetID=NULL)
 constructor
 
virtual ~DcmDicomDir ()
 destructor. If DICOMDIR was modified, writes new file.
 
virtual void print (STD_NAMESPACE ostream &out, const size_t flags=0, const int level=0, const char *pixelFileName=NULL, size_t *pixelCounter=NULL)
 print all elements of the item to a stream
 
virtual OFCondition error ()
 returns current status flag
 
virtual DcmFileFormatgetDirFileFormat ()
 returns reference to DICOM file from which DICOMDIR was read.
 
virtual const char * getDirFileName ()
 returns file name from which DICOMDIR was read.
 
virtual DcmDirectoryRecordgetRootRecord ()
 returns root directory record
 
virtual DcmSequenceOfItemsgetMRDRSequence ()
 returns container in which all MRDR (multi-reference directory records) are stored
 
virtual DcmDirectoryRecordmatchFilename (const char *filename)
 look up directory record for the given referenced file ID (not OS file path)
 
virtual DcmDirectoryRecordmatchOrCreateMRDR (const char *filename)
 look up MRDR for the given referenced file ID (not OS file path).
 
virtual OFCondition write (const E_TransferSyntax oxfer=DICOMDIR_DEFAULT_TRANSFERSYNTAX, const E_EncodingType enctype=EET_UndefinedLength, const E_GrpLenEncoding glenc=EGL_withoutGL)
 writes DICOMDIR to file
 
virtual OFCondition verify (OFBool autocorrect=OFFalse)
 check the currently stored element value
 

Protected Member Functions

OFCondition createNewElements (const char *fileSetID)
 
DcmDatasetgetDataset (void)
 
DcmSequenceOfItemsgetDirRecSeq (DcmDataset &dset)
 
DcmUnsignedLongOffsetlookForOffsetElem (DcmObject *obj, const DcmTagKey &offsetTag)
 
DcmDirectoryRecordrecurseMatchFile (DcmDirectoryRecord *startRec, const char *filename)
 
DcmDirectoryRecordsearchMatchFile (DcmSequenceOfItems &recSeq, const char *filename)
 
OFCondition resolveGivenOffsets (DcmObject *startPoint, ItemOffset *itOffsets, const unsigned long numOffsets, const DcmTagKey &offsetTag)
 
OFCondition resolveAllOffsets (DcmDataset &dset)
 
OFCondition linkMRDRtoRecord (DcmDirectoryRecord *dRec)
 
OFCondition moveRecordToTree (DcmDirectoryRecord *startRec, DcmSequenceOfItems &fromDirSQ, DcmDirectoryRecord *toRecord)
 
OFCondition moveMRDRbetweenSQs (DcmSequenceOfItems &fromSQ, DcmSequenceOfItems &toDirSQ)
 
Uint32 lengthUntilSQ (DcmDataset &dset, E_TransferSyntax oxfer, E_EncodingType enctype)
 
Uint32 lengthOfRecord (DcmItem *item, E_TransferSyntax oxfer, E_EncodingType enctype)
 
OFCondition convertGivenPointer (DcmObject *startPoint, ItemOffset *itOffsets, const unsigned long numOffsets, const DcmTagKey &offsetTag)
 
OFCondition convertAllPointer (DcmDataset &dset, Uint32 beginOfFileSet, E_TransferSyntax oxfer, E_EncodingType enctype)
 
OFCondition copyRecordPtrToSQ (DcmDirectoryRecord *record, DcmSequenceOfItems &toDirSQ, DcmDirectoryRecord **firstRec, DcmDirectoryRecord **lastRec)
 
OFCondition insertMediaSOPUID (DcmMetaInfo &metaInfo)
 
OFCondition countMRDRRefs (DcmDirectoryRecord *startRec, ItemOffset *refCounter, const unsigned long numCounters)
 
OFCondition checkMRDRRefCounter (DcmDirectoryRecord *startRec, ItemOffset *refCounter, const unsigned long numCounters)
 
OFCondition convertLinearToTree ()
 
OFCondition convertTreeToLinear (Uint32 beginOfFileSet, E_TransferSyntax oxfer, E_EncodingType enctype, E_GrpLenEncoding glenc, DcmSequenceOfItems &unresRecs)
 

Private Member Functions

DcmDicomDiroperator= (const DcmDicomDir &)
 private undefined copy assignment operator
 
 DcmDicomDir (const DcmDicomDir &newDir)
 private undefined copy constructor
 

Private Attributes

OFCondition errorFlag
 condition flag
 
char * dicomDirFileName
 file name the DICOMDIR was read from, or DEFAULT_DICOMDIR_NAME
 
OFBool modified
 flag indicating whether or not this DICOMDIR has been modified after being read from file.
 
OFBool mustCreateNewDir
 flag indicating whether the DICOM file in DirFile needs to be re-created upon writing
 
DcmFileFormatDirFile
 DICOM file into which a DICOMDIR is read first before the logical tree structure is created.
 
DcmDirectoryRecordRootRec
 root directory record of this DICOMDIR
 
DcmSequenceOfItemsMRDRSeq
 container in which all MRDR (multi-reference directory records) for this DICOMDIR are kept
 

Detailed Description

this class implements support for DICOMDIR files, which are special DICOM files containing a list of directory records, with a logical tree structure being implemented through references between records as byte offsets in file.

Definition at line 58 of file dcdicdir.h.

Constructor & Destructor Documentation

DcmDicomDir::DcmDicomDir ( const char *  fileName,
const char *  fileSetID = NULL 
)

constructor

Parameters
fileNamefilename to read a DICOMDIR from. If NULL, an attempt is made to read file DEFAULT_DICOMDIR_NAME ("DICOMDIR").
fileSetIDfile set ID of this file set, used only for new DICOMDIRs

Member Function Documentation

virtual DcmFileFormat& DcmDicomDir::getDirFileFormat ( )
virtual

returns reference to DICOM file from which DICOMDIR was read.

Note, this file may be obsolete if the DICOMDIR was modified

Returns
reference to DICOM file
virtual const char* DcmDicomDir::getDirFileName ( )
virtual

returns file name from which DICOMDIR was read.

Returns
filename of DICOMDIR
virtual DcmDirectoryRecord* DcmDicomDir::matchFilename ( const char *  filename)
virtual

look up directory record for the given referenced file ID (not OS file path)

Returns
directory record if found, NULL otherwise
virtual DcmDirectoryRecord* DcmDicomDir::matchOrCreateMRDR ( const char *  filename)
virtual

look up MRDR for the given referenced file ID (not OS file path).

If there is none yet, create one.

Returns
MRDR for given referenced file ID
virtual void DcmDicomDir::print ( STD_NAMESPACE ostream &  out,
const size_t  flags = 0,
const int  level = 0,
const char *  pixelFileName = NULL,
size_t *  pixelCounter = NULL 
)
virtual

print all elements of the item to a stream

Parameters
outoutput stream
flagsoptional flag used to customize the output (see DCMTypes::PF_xxx)
levelcurrent level of nested items. Used for indentation.
pixelFileNamenot used
pixelCounternot used
virtual OFCondition DcmDicomDir::verify ( OFBool  autocorrect = OFFalse)
virtual

check the currently stored element value

Parameters
autocorrectcorrect value length if OFTrue
Returns
status, EC_Normal if value length is correct, an error code otherwise
virtual OFCondition DcmDicomDir::write ( const E_TransferSyntax  oxfer = DICOMDIR_DEFAULT_TRANSFERSYNTAX,
const E_EncodingType  enctype = EET_UndefinedLength,
const E_GrpLenEncoding  glenc = EGL_withoutGL 
)
virtual

writes DICOMDIR to file

Parameters
oxfermust be DICOMDIR_DEFAULT_TRANSFERSYNTAX
enctypeencoding type for sequences
glencencoding type for group lengths
Returns
status, EC_Normal if value length is correct, an error code otherwise

Member Data Documentation

OFBool DcmDicomDir::modified
private

flag indicating whether or not this DICOMDIR has been modified after being read from file.

If true, the destructor of this class will write the modified DICOMDIR back to file

Definition at line 213 of file dcdicdir.h.


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


Generated on Thu Dec 20 2012 for OFFIS DCMTK Version 3.6.0 by Doxygen 1.8.2