DcmSequenceOfItems Class Reference

class representing a DICOM Sequence of Items (SQ). More...

Inheritance diagram for DcmSequenceOfItems:

DcmElement DcmObject DcmFileFormat DcmPixelSequence List of all members.

Public Member Functions

 DcmSequenceOfItems (const DcmTag &tag, const Uint32 len=0, OFBool readAsUN=OFFalse)
 constructor
 DcmSequenceOfItems (const DcmSequenceOfItems &oldSeq)
 copy constructor
virtual ~DcmSequenceOfItems ()
 destructor
DcmSequenceOfItemsoperator= (const DcmSequenceOfItems &obj)
 copy assignment operator
OFCondition error () const
 returns current status flag
virtual DcmObjectclone () const
 clone method
virtual OFCondition copyFrom (const DcmObject &rhs)
 Virtual object copying.
virtual DcmEVR ident () const
 return identifier for this class.
virtual OFBool isLeaf () const
 check if this element is a leaf node in a dataset tree.
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 object to a stream
virtual OFCondition checkValue (const OFString &card="1-n", const OFBool oldFormat=OFFalse)
 check whether stored value conforms to the VR and to the specified VM
virtual unsigned long getVM ()
 get value multiplicity
virtual OFCondition computeGroupLengthAndPadding (const E_GrpLenEncoding glenc, const E_PaddingEncoding padenc=EPD_noChange, const E_TransferSyntax xfer=EXS_Unknown, const E_EncodingType enctype=EET_ExplicitLength, const Uint32 padlen=0, const Uint32 subPadlen=0, Uint32 instanceLength=0)
 This function takes care of group length and padding elements in the current element list according to what is specified in glenc and padenc.
virtual Uint32 calcElementLength (const E_TransferSyntax xfer, const E_EncodingType enctype)
 calculate the length of this DICOM element when encoded with the given transfer syntax and the given encoding type for sequences.
virtual Uint32 getLength (const E_TransferSyntax xfer=EXS_LittleEndianImplicit, const E_EncodingType enctype=EET_UndefinedLength)
 calculate the value length (without attribute tag, VR and length field) of this DICOM element when encoded with the given transfer syntax and the given encoding type for sequences.
virtual void transferInit ()
 initialize the transfer state of this object.
virtual void transferEnd ()
 finalize the transfer state of this object.
virtual OFBool canWriteXfer (const E_TransferSyntax oldXfer, const E_TransferSyntax newXfer)
 check if this DICOM object can be encoded in the given transfer syntax.
virtual OFCondition read (DcmInputStream &inStream, const E_TransferSyntax xfer, const E_GrpLenEncoding glenc=EGL_noChange, const Uint32 maxReadLength=DCM_MaxReadLength)
 This function reads the information of all attributes which are captured in the input stream and captures this information in elementList.
virtual OFCondition write (DcmOutputStream &outStream, const E_TransferSyntax oxfer, const E_EncodingType enctype, DcmWriteCache *wcache)
 write object to a stream
virtual OFCondition writeXML (STD_NAMESPACE ostream &out, const size_t flags=0)
 write object in XML format
virtual OFCondition writeSignatureFormat (DcmOutputStream &outStream, const E_TransferSyntax oxfer, const E_EncodingType enctype, DcmWriteCache *wcache)
 special write method for creation of digital signatures
virtual OFBool isSignable () const
 returns true if the current object may be included in a digital signature
virtual OFBool containsUnknownVR () const
 returns true if the object contains an element with Unknown VR at any nesting level
virtual OFBool containsExtendedCharacters (const OFBool checkAllStrings=OFFalse)
 check if this object contains non-ASCII characters at any nesting level
virtual OFBool isAffectedBySpecificCharacterSet () const
 check if this object is affected by SpecificCharacterSet at any nesting level.
virtual unsigned long card ()
 get cardinality of this sequence
virtual OFCondition prepend (DcmItem *item)
 insert the given item at the start of the item list maintained by this sequence.
virtual OFCondition insert (DcmItem *item, unsigned long where=DCM_EndOfListIndex, OFBool before=OFFalse)
 insert the given item at the given position within the item list maintained by this sequence.
virtual OFCondition append (DcmItem *item)
 insert the given item at the end of the item list maintained by this sequence.
virtual OFCondition insertAtCurrentPos (DcmItem *item, OFBool before=OFFalse)
 insert new item a current position.
virtual DcmItemgetItem (const unsigned long num)
 access an item from the sequence.
virtual OFCondition nextObject (DcmStack &stack, const OFBool intoSub)
 this method enables a stack based, depth-first traversal of a complete hierarchical DICOM dataset (that is, classes derived from DcmItem or DcmSequenceOfItems).
virtual DcmObjectnextInContainer (const DcmObject *obj)
 this method is only used in container classes, that is, DcmItem and DcmSequenceOfItems.
virtual DcmItemremove (const unsigned long num)
 remove item from list.
virtual DcmItemremove (DcmItem *item)
 remove item from list.
virtual OFBool isEmpty (const OFBool normalize=OFTrue)
 check if this sequence is empty
virtual OFCondition clear ()
 clear (remove) attribute value
virtual OFCondition verify (const OFBool autocorrect=OFFalse)
 check the currently stored element value
virtual OFCondition search (const DcmTagKey &xtag, DcmStack &resultStack, E_SearchMode mode=ESM_fromHere, OFBool searchIntoSub=OFTrue)
 a complex, stack-based, hierarchical search method.
virtual OFCondition loadAllDataIntoMemory (void)
 this method loads all attribute values maintained by this object and all sub-objects (in case of a container such as DcmDataset) into memory.
virtual OFCondition getPartialValue (void *targetBuffer, const Uint32 offset, Uint32 numBytes, DcmFileCache *cache=NULL, E_ByteOrder byteOrder=gLocalByteOrder)
 Copy numBytes bytes of data from the attribute value in byteOrder byte order to targetBuffer, starting at byte offset offset of the attribute value.

Protected Member Functions

virtual OFCondition readTagAndLength (DcmInputStream &inStream, const E_TransferSyntax xfer, DcmTag &tag, Uint32 &length)
 This function reads tag and length information from inStream and returns this information to the caller.
virtual OFCondition makeSubObject (DcmObject *&subObject, const DcmTag &newTag, const Uint32 newLength)
 helper function for read().
OFCondition readSubItem (DcmInputStream &inStream, const DcmTag &newTag, const Uint32 newLength, const E_TransferSyntax xfer, const E_GrpLenEncoding glenc, const Uint32 maxReadLength=DCM_MaxReadLength)
 helper function for read().
virtual OFCondition searchSubFromHere (const DcmTagKey &tag, DcmStack &resultStack, const OFBool searchIntoSub)
 helper function for search().

Protected Attributes

DcmListitemList
 the list of items maintained by this sequence object

Static Private Member Functions

static OFCondition writeTagAndVR (DcmOutputStream &outStream, const DcmTag &tag, DcmEVR vr, const E_TransferSyntax oxfer)
 static helper method used in writeSignatureFormat().

Private Attributes

OFBool lastItemComplete
 flag used during suspended I/O.
offile_off_t fStartPosition
 used during reading.
OFBool readAsUN_
 true if this sequence has been instantiated while reading an UN element with undefined length

Detailed Description

class representing a DICOM Sequence of Items (SQ).

This class is derived from class DcmElement (and not from DcmObject) despite the fact that sequences have no value field as such, they maintain a list of items. However, all APIs in class DcmItem and class DcmDataset accept DcmElements. This is ugly and causes some DcmElement API methods to be useless with DcmSequence.

Definition at line 47 of file dcsequen.h.


Constructor & Destructor Documentation

DcmSequenceOfItems::DcmSequenceOfItems ( const DcmTag tag,
const Uint32  len = 0,
OFBool  readAsUN = OFFalse 
)

constructor

Parameters:
tag attribute tag
len length of the attribute value
readAsUN flag indicating whether the sequence should be read (interpreted) as a UN element with Implicit VR Little Endian encoding

Referenced by clone().

DcmSequenceOfItems::DcmSequenceOfItems ( const DcmSequenceOfItems oldSeq  ) 

copy constructor

Parameters:
oldSeq element to be copied


Member Function Documentation

DcmSequenceOfItems& DcmSequenceOfItems::operator= ( const DcmSequenceOfItems obj  ) 

copy assignment operator

Parameters:
obj element to be copied

virtual DcmObject* DcmSequenceOfItems::clone (  )  const [inline, virtual]

clone method

Returns:
deep copy of this object

Implements DcmObject.

Reimplemented in DcmFileFormat, and DcmPixelSequence.

Definition at line 80 of file dcsequen.h.

References DcmSequenceOfItems().

virtual OFCondition DcmSequenceOfItems::copyFrom ( const DcmObject rhs  )  [virtual]

Virtual object copying.

This method can be used for DcmObject and derived classes to get a deep copy of an object. Internally the assignment operator is called if the given DcmObject parameter is of the same type as "this" object instance. If not, an error is returned. This function permits copying an object by value in a virtual way which therefore is different to just calling the assignment operator of DcmElement which could result in slicing the object.

Parameters:
rhs - [in] The instance to copy from. Has to be of the same class type as "this" object
Returns:
EC_Normal if copying was successful, error otherwise

Reimplemented from DcmElement.

Reimplemented in DcmFileFormat, and DcmPixelSequence.

virtual DcmEVR DcmSequenceOfItems::ident ( void   )  const [inline, virtual]

return identifier for this class.

Every class derived from this class returns a unique value of type enum DcmEVR for this call. This is used as a "poor man's RTTI" to correctly identify instances derived from this class even on compilers not supporting RTTI.

Returns:
type identifier of this class

Implements DcmObject.

Reimplemented in DcmFileFormat, and DcmPixelSequence.

Definition at line 105 of file dcsequen.h.

virtual OFBool DcmSequenceOfItems::isLeaf (  )  const [inline, virtual]

check if this element is a leaf node in a dataset tree.

All subclasses of DcmElement except for DcmSequenceOfItems are leaf nodes, while DcmSequenceOfItems, DcmItem, DcmDataset etc. are not.

Returns:
true if leaf node, false otherwise.

Reimplemented from DcmElement.

Definition at line 113 of file dcsequen.h.

virtual void DcmSequenceOfItems::print ( STD_NAMESPACE ostream &  out,
const size_t  flags = 0,
const int  level = 0,
const char *  pixelFileName = NULL,
size_t *  pixelCounter = NULL 
) [virtual]

print object to a stream

Parameters:
out output stream
flags optional flag used to customize the output (see DCMTypes::PF_xxx)
level current level of nested items. Used for indentation.
pixelFileName not used (used in certain sub-classes of this class)
pixelCounter not used (used in certain sub-classes of this class)

Implements DcmObject.

Reimplemented in DcmFileFormat, and DcmPixelSequence.

virtual OFCondition DcmSequenceOfItems::checkValue ( const OFString card = "1-n",
const OFBool  oldFormat = OFFalse 
) [virtual]

check whether stored value conforms to the VR and to the specified VM

Parameters:
card cardinality (number of items) to be checked for. (valid values: "1", "1-2", "1-3", "1-8", "1-99", "1-n", "2", "2-n", "2-2n", "3", "3-n", "3-3n", "4", "6", "9", "16", "32"), parameter used to specify the value multiplicity for non-sequence attributes
oldFormat parameter not used for this VR (only for DA, TM, PN)
Returns:
status of the check, EC_Normal if value is correct, an error code otherwise

Reimplemented from DcmElement.

virtual unsigned long DcmSequenceOfItems::getVM (  )  [inline, virtual]

get value multiplicity

Returns:
always returns 1 (according to the DICOM standard)

Implements DcmObject.

Definition at line 142 of file dcsequen.h.

virtual OFCondition DcmSequenceOfItems::computeGroupLengthAndPadding ( const E_GrpLenEncoding  glenc,
const E_PaddingEncoding  padenc = EPD_noChange,
const E_TransferSyntax  xfer = EXS_Unknown,
const E_EncodingType  enctype = EET_ExplicitLength,
const Uint32  padlen = 0,
const Uint32  subPadlen = 0,
Uint32  instanceLength = 0 
) [virtual]

This function takes care of group length and padding elements in the current element list according to what is specified in glenc and padenc.

If required, this function does the following two things: a) it calculates the group length of all groups which are contained in this item and sets the calculated values in the corresponding group length elements and b) it inserts a corresponding padding element (or, in case of sequences: padding elements) with a corresponding correct size into the element list.

Parameters:
glenc Encoding type for group length; specifies what shall be done with group length tags.
padenc Encoding type for padding; specifies what shall be done with padding tags.
xfer The transfer syntax that shall be used.
enctype Encoding type for sequences; specifies how sequences will be handled.
padlen The length up to which the dataset shall be padded, if padding is desired.
subPadlen For sequences (ie sub elements), the length up to which item shall be padded, if padding is desired.
instanceLength Number of extra bytes added to the item/dataset length used when computing the padding; this parameter is for instance used to pass the length of the file meta header from the DcmFileFormat to the DcmDataset object.
Returns:
status, EC_Normal if successful, an error code otherwise

virtual Uint32 DcmSequenceOfItems::calcElementLength ( const E_TransferSyntax  xfer,
const E_EncodingType  enctype 
) [virtual]

calculate the length of this DICOM element when encoded with the given transfer syntax and the given encoding type for sequences.

For elements, the length includes the length of the tag, length field, VR field and the value itself, for items and sequences it returns the length of the complete item or sequence including delimitation tags if applicable. If length encodig is set to be explicit and the total sequence size is larger than the available 32-bit length field, then undefined length is returned. If "dcmWriteOversizedSeqsAndItemsUndefined" is disabled, also the internal DcmObject errorFlag is set to EC_SeqOrItemContentOverflow in case the sequence content (excluding tag header etc.) is already too large.

Parameters:
xfer transfer syntax for length calculation
enctype sequence encoding type for length calculation
Returns:
length of DICOM element

Reimplemented from DcmElement.

Reimplemented in DcmFileFormat, and DcmPixelSequence.

virtual Uint32 DcmSequenceOfItems::getLength ( const E_TransferSyntax  xfer = EXS_LittleEndianImplicit,
const E_EncodingType  enctype = EET_UndefinedLength 
) [virtual]

calculate the value length (without attribute tag, VR and length field) of this DICOM element when encoded with the given transfer syntax and the given encoding type for sequences.

If length encodig is set to be explicit and the total sequence size is larger than the available 32-bit length field, then undefined length is returned. If "dcmWriteOversizedSeqsAndItemsImplicit" is disabled, also the internal DcmObject errorFlag is set to EC_SeqOrItemContentOverflow.

Parameters:
xfer transfer syntax for length calculation
enctype sequence encoding type for length calculation
Returns:
value length of DICOM element

Reimplemented from DcmElement.

virtual void DcmSequenceOfItems::transferInit (  )  [virtual]

initialize the transfer state of this object.

This method must be called before this object is written to a stream or read (parsed) from a stream.

Reimplemented from DcmElement.

virtual void DcmSequenceOfItems::transferEnd (  )  [virtual]

finalize the transfer state of this object.

This method must be called when reading/writing this object from/to a stream has been completed.

Reimplemented from DcmObject.

virtual OFBool DcmSequenceOfItems::canWriteXfer ( const E_TransferSyntax  oldXfer,
const E_TransferSyntax  newXfer 
) [virtual]

check if this DICOM object can be encoded in the given transfer syntax.

Parameters:
newXfer transfer syntax in which the DICOM object is to be encoded
oldXfer transfer syntax in which the DICOM object was read or created.
Returns:
true if object can be encoded in desired transfer syntax, false otherwise.

Reimplemented from DcmElement.

Reimplemented in DcmFileFormat, and DcmPixelSequence.

virtual OFCondition DcmSequenceOfItems::read ( DcmInputStream inStream,
const E_TransferSyntax  xfer,
const E_GrpLenEncoding  glenc = EGL_noChange,
const Uint32  maxReadLength = DCM_MaxReadLength 
) [virtual]

This function reads the information of all attributes which are captured in the input stream and captures this information in elementList.

Each attribute is represented as an element in this list. If not all information for an attribute could be read from the stream, the function returns EC_StreamNotifyClient.

Parameters:
inStream The stream which contains the information.
xfer The transfer syntax which was used to encode the information in inStream.
glenc Encoding type for group length; specifies what will be done with group length tags.
maxReadLength Maximum read length for reading an attribute value.
Returns:
status, EC_Normal if successful, an error code otherwise

Reimplemented from DcmElement.

Reimplemented in DcmFileFormat, and DcmPixelSequence.

virtual OFCondition DcmSequenceOfItems::write ( DcmOutputStream outStream,
const E_TransferSyntax  oxfer,
const E_EncodingType  enctype,
DcmWriteCache wcache 
) [virtual]

write object to a stream

Parameters:
outStream DICOM output stream
oxfer output transfer syntax
enctype encoding types (undefined or explicit length)
wcache pointer to write cache object, may be NULL
Returns:
status, EC_Normal if successful, an error code otherwise

Reimplemented from DcmElement.

Reimplemented in DcmFileFormat, and DcmPixelSequence.

virtual OFCondition DcmSequenceOfItems::writeXML ( STD_NAMESPACE ostream &  out,
const size_t  flags = 0 
) [virtual]

write object in XML format

Parameters:
out output stream to which the XML document is written
flags optional flag used to customize the output (see DCMTypes::XF_xxx)
Returns:
status, EC_Normal if successful, an error code otherwise

Reimplemented from DcmElement.

Reimplemented in DcmFileFormat.

virtual OFCondition DcmSequenceOfItems::writeSignatureFormat ( DcmOutputStream outStream,
const E_TransferSyntax  oxfer,
const E_EncodingType  enctype,
DcmWriteCache wcache 
) [virtual]

special write method for creation of digital signatures

Parameters:
outStream DICOM output stream
oxfer output transfer syntax
enctype encoding types (undefined or explicit length)
wcache pointer to write cache object, may be NULL
Returns:
status, EC_Normal if successful, an error code otherwise

Reimplemented from DcmElement.

Reimplemented in DcmPixelSequence.

virtual OFBool DcmSequenceOfItems::isSignable (  )  const [virtual]

returns true if the current object may be included in a digital signature

Returns:
true if signable, false otherwise

Reimplemented from DcmObject.

virtual OFBool DcmSequenceOfItems::containsUnknownVR (  )  const [virtual]

returns true if the object contains an element with Unknown VR at any nesting level

Returns:
true if the object contains an element with Unknown VR, false otherwise

Reimplemented from DcmObject.

virtual OFBool DcmSequenceOfItems::containsExtendedCharacters ( const OFBool  checkAllStrings = OFFalse  )  [virtual]

check if this object contains non-ASCII characters at any nesting level

Parameters:
checkAllStrings if true, also check elements with string values not affected by SpecificCharacterSet (0008,0005), default: only check PN, LO, LT, SH, ST, UT
Returns:
true if object contains non-ASCII characters, false otherwise

Reimplemented from DcmObject.

virtual OFBool DcmSequenceOfItems::isAffectedBySpecificCharacterSet (  )  const [virtual]

check if this object is affected by SpecificCharacterSet at any nesting level.

In detail, it is checked whether this object contains any data elements that according to their VR are affected by the SpecificCharacterSet (0008,0005) element. This is true for the following VRs: PN, LO, LT, SH, ST and UT

Returns:
true if object is affected by SpecificCharacterSet, false otherwise

Reimplemented from DcmObject.

virtual unsigned long DcmSequenceOfItems::card (  )  [virtual]

get cardinality of this sequence

Returns:
number of items in this sequence

Referenced by DSRDocumentTreeNode::isSigned().

virtual OFCondition DcmSequenceOfItems::prepend ( DcmItem item  )  [virtual]

insert the given item at the start of the item list maintained by this sequence.

Ownership of the item, which must be allocated on the heap, is transferred to the sequence.

Parameters:
item pointer to DcmItem instance allocated on the heap, must not be NULL.
Returns:
EC_Normal if successful, an error code otherwise

virtual OFCondition DcmSequenceOfItems::insert ( DcmItem item,
unsigned long  where = DCM_EndOfListIndex,
OFBool  before = OFFalse 
) [virtual]

insert the given item at the given position within the item list maintained by this sequence.

Ownership of the item, which must be allocated on the heap, is transferred to the sequence.

Parameters:
item pointer to DcmItem instance allocated on the heap, must not be NULL.
where index of the item after or before which the new item is to be inserted. Value must be < card() or equal to DCM_EndOfListIndex.
before indicates whether the new item should be inserted before or after the item identified by "where"
Returns:
EC_Normal if successful, an error code otherwise

Reimplemented in DcmPixelSequence.

virtual OFCondition DcmSequenceOfItems::append ( DcmItem item  )  [virtual]

insert the given item at the end of the item list maintained by this sequence.

Ownership of the item, which must be allocated on the heap, is transferred to the sequence.

Parameters:
item pointer to DcmItem instance allocated on the heap, must not be NULL.
Returns:
EC_Normal if successful, an error code otherwise

virtual OFCondition DcmSequenceOfItems::insertAtCurrentPos ( DcmItem item,
OFBool  before = OFFalse 
) [virtual]

insert new item a current position.

The current position is stored internally in the 'itemList' member variable.

Parameters:
item new item to be inserted
before flag indicating whether to insert the item before (OFFalse) or after (OFTrue) the current position
Returns:
status, EC_Normal upon success, an error code otherwise

virtual DcmItem* DcmSequenceOfItems::getItem ( const unsigned long  num  )  [virtual]

access an item from the sequence.

This method returns a pointer to one of the items in the list, and not a copy.

Parameters:
num index number of item, must be < card()
Returns:
pointer to item if found, NULL if num >= card()

Reimplemented in DcmPixelSequence.

virtual OFCondition DcmSequenceOfItems::nextObject ( DcmStack stack,
const OFBool  intoSub 
) [virtual]

this method enables a stack based, depth-first traversal of a complete hierarchical DICOM dataset (that is, classes derived from DcmItem or DcmSequenceOfItems).

With each call of this method, the next object in the tree is located and marked on the stack.

Parameters:
stack "cursor" for current position in the dataset. The stack will contain a pointer to each dataset, sequence, item and element from the main dataset down to the current element, and is updated upon each call to this method. An empty stack is equivalent to a stack containing a pointer to this object only.
intoSub if true, the nextObject method will perform a hierarchical search through the dataset (depth-first), if false, only the current container object will be traversed (e.g., all elements of an item or all items of a sequence).
Returns:
EC_Normal if value length is correct, an error code otherwise

Reimplemented from DcmObject.

virtual DcmObject* DcmSequenceOfItems::nextInContainer ( const DcmObject obj  )  [virtual]

this method is only used in container classes, that is, DcmItem and DcmSequenceOfItems.

It returns a pointer to the next object in the list AFTER the given object. If the caller passes NULL, a pointer to the first object in the list is returned. If the given object is not found, the given object is the last one in the list or the list is empty, NULL is returned.

Parameters:
obj pointer to one object in the container; we are looking for the next entry after this one. NULL if looking for the first entry.
Returns:
pointer to next object in container or NULL if not found

Reimplemented from DcmObject.

virtual DcmItem* DcmSequenceOfItems::remove ( const unsigned long  num  )  [virtual]

remove item from list.

If found, the item is not deleted but returned to the caller who is responsible for further management of the DcmItem object.

Parameters:
num index number of item, must be < card()
Returns:
pointer to DcmItem if found, NULL otherwise

Reimplemented in DcmFileFormat, and DcmPixelSequence.

virtual DcmItem* DcmSequenceOfItems::remove ( DcmItem item  )  [virtual]

remove item from list.

If found, the item is not deleted but returned to the caller who is responsible for further management of the DcmItem object.

Parameters:
item pointer to item to be removed from list
Returns:
pointer to item if found, NULL otherwise

Reimplemented in DcmFileFormat, and DcmPixelSequence.

virtual OFBool DcmSequenceOfItems::isEmpty ( const OFBool  normalize = OFTrue  )  [virtual]

check if this sequence is empty

Parameters:
normalize not used for this class
Returns:
true if sequence is empty, i.e. has no items, false otherwise

Reimplemented from DcmObject.

virtual OFCondition DcmSequenceOfItems::clear (  )  [virtual]

clear (remove) attribute value

Returns:
EC_Normal if successful, an error code otherwise

Reimplemented from DcmElement.

Reimplemented in DcmFileFormat.

virtual OFCondition DcmSequenceOfItems::verify ( const OFBool  autocorrect = OFFalse  )  [virtual]

check the currently stored element value

Parameters:
autocorrect correct value length if OFTrue
Returns:
status, EC_Normal if value length is correct, an error code otherwise

Implements DcmObject.

virtual OFCondition DcmSequenceOfItems::search ( const DcmTagKey xtag,
DcmStack resultStack,
E_SearchMode  mode = ESM_fromHere,
OFBool  searchIntoSub = OFTrue 
) [virtual]

a complex, stack-based, hierarchical search method.

It allows for a search for a DICOM object with a given attribute within a given container, hierarchically, from a starting position identified through a cursor stack.

Parameters:
xtag the DICOM attribute tag we are searching for
resultStack Depending on the search mode (see below), this parameter either serves as an input and output parameter, or as an output parameter only (the latter being the default). When used as an input parameter, the cursor stack defines the start position for the search within a hierarchical DICOM dataset. Upon successful return, the stack contains the position of the element found, in the form of a pointer to each dataset, sequence, item and element from the main dataset down to the found element.
mode search mode, controls how the search stack is handled. In the default mode, ESM_fromHere, the stack is ignored on input, and the search starts in the object for which this method is called. In the other modes, the stack is used both as an input and an output parameter and defines the starting point for the search.
searchIntoSub if true, the search will be performed hierarchically descending into the sequences and items of the dataset. If false, only the current container (sequence or item) will be traversed.
Returns:
EC_Normal if found, EC_TagNotFound if not found, an error code is something went wrong.

Reimplemented from DcmObject.

virtual OFCondition DcmSequenceOfItems::loadAllDataIntoMemory ( void   )  [virtual]

this method loads all attribute values maintained by this object and all sub-objects (in case of a container such as DcmDataset) into memory.

After a call to this method, the file from which a dataset was read may safely be deleted or replaced. For large files, this method may obviously allocate large amounts of memory.

Returns:
EC_Normal if successful, an error code otherwise

Reimplemented from DcmElement.

virtual OFCondition DcmSequenceOfItems::getPartialValue ( void *  targetBuffer,
const Uint32  offset,
Uint32  numBytes,
DcmFileCache cache = NULL,
E_ByteOrder  byteOrder = gLocalByteOrder 
) [virtual]

Copy numBytes bytes of data from the attribute value in byteOrder byte order to targetBuffer, starting at byte offset offset of the attribute value.

This method does not cause the complete attribute value to be read into main memory. Subsequent calls for the same partial value may cause repeated access to file if the attribute value is kept in file.

Parameters:
targetBuffer pointer to target buffer, must not be NULL. Buffer size must be at least numBytes bytes.
offset byte offset within the attribute value from where to start copying
numBytes number of bytes to copy.
cache file cache object that may be passed to multiple subsequent calls to this method for the same file; the file cache will then keep a file handle open, thus improving performance. Optional, may be NULL
byteOrder byte order desired byte order of attribute value in memory buffer. Default is the local byte order of the machine.
Returns:
EC_Normal upon success, an error code otherwise

Reimplemented from DcmElement.

virtual OFCondition DcmSequenceOfItems::readTagAndLength ( DcmInputStream inStream,
const E_TransferSyntax  xfer,
DcmTag tag,
Uint32 &  length 
) [protected, virtual]

This function reads tag and length information from inStream and returns this information to the caller.

When reading information, the transfer syntax which was passed is accounted for. If the transfer syntax shows an explicit value representation, the data type of this object is also read from the stream. In general, this function follows the rules which are specified in the DICOM standard (see DICOM standard (year 2000) part 5, section 7) (or the corresponding section in a later version of the standard) concerning the encoding of a dataset.

Parameters:
inStream The stream which contains the information.
xfer The transfer syntax which was used to encode the information in inStream.
tag Contains in the end the tag that was read.
length Contains in the end the length value that was read.
Returns:
status, EC_Normal if successful, an error code otherwise

virtual OFCondition DcmSequenceOfItems::makeSubObject ( DcmObject *&  subObject,
const DcmTag newTag,
const Uint32  newLength 
) [protected, virtual]

helper function for read().

Create sub-object (item, item delimiter or sequence delimiter) of the appropriate type depending on the tag.

Parameters:
subObject upon success, a pointer to the newly created object is returned in this parameter
newTag tag of the sub-object to be created
newLength length of the sub-object to be created
Returns:
status, EC_Normal if successful, an error code otherwise

Reimplemented in DcmPixelSequence.

OFCondition DcmSequenceOfItems::readSubItem ( DcmInputStream inStream,
const DcmTag newTag,
const Uint32  newLength,
const E_TransferSyntax  xfer,
const E_GrpLenEncoding  glenc,
const Uint32  maxReadLength = DCM_MaxReadLength 
) [protected]

helper function for read().

Create sub-object (item or pixel item) and call read() for this sub-object.

Parameters:
inStream The stream which contains the information.
newTag attribute tag for sub-object
newLength length of the sub-object to be created
xfer The transfer syntax which was used to encode the information in inStream.
glenc Encoding type for group length; specifies what will be done with group length tags.
maxReadLength Maximum read length for reading an attribute value.
Returns:
status, EC_Normal if successful, an error code otherwise

virtual OFCondition DcmSequenceOfItems::searchSubFromHere ( const DcmTagKey tag,
DcmStack resultStack,
const OFBool  searchIntoSub 
) [protected, virtual]

helper function for search().

May only be called if item list is non-empty. Performs hierarchical search for given tag and pushes pointer of sub-element on result stack if found

Parameters:
tag tag key to be searched
resultStack upon successful return, pointer to element pushed onto this stack
searchIntoSub flag indicating whether recursive search is desired
Returns:
EC_Normal if tag found and stack modified, EC_TagNotFound if tag not found and stack unmodified

static OFCondition DcmSequenceOfItems::writeTagAndVR ( DcmOutputStream outStream,
const DcmTag tag,
DcmEVR  vr,
const E_TransferSyntax  oxfer 
) [static, private]

static helper method used in writeSignatureFormat().

This function resembles DcmObject::writeTagAndLength() but only writes the tag, VR and reserved field.

Parameters:
outStream stream to write to
tag attribute tag
vr attribute VR as reported by getVR
oxfer output transfer syntax
Returns:
EC_Normal if successful, an error code otherwise


Member Data Documentation

OFBool DcmSequenceOfItems::lastItemComplete [private]

flag used during suspended I/O.

Indicates whether the last item was completely or only partially read/written during the last call to read/write.

Definition at line 564 of file dcsequen.h.

offile_off_t DcmSequenceOfItems::fStartPosition [private]

used during reading.

Contains the position in the stream where the sequence started (needed for calculating the remaining number of bytes available for a fixed-length sequence).

Definition at line 570 of file dcsequen.h.


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


Generated on 6 Jan 2011 for OFFIS DCMTK Version 3.6.0 by Doxygen 1.5.1