33 #include "dcmtk/config/osconfig.h" 35 #include "dcmtk/dcmdata/dcobject.h" 36 #include "dcmtk/ofstd/ofstring.h" 57 const Uint32 len = 0);
99 const E_EncodingType enctype);
108 virtual Uint32
getLength(
const E_TransferSyntax = EXS_LittleEndianImplicit,
109 const E_EncodingType = EET_UndefinedLength)
120 virtual OFBool
isLeaf()
const {
return OFTrue; }
137 virtual OFBool
canWriteXfer(
const E_TransferSyntax newXfer,
138 const E_TransferSyntax oldXfer);
156 const E_TransferSyntax ixfer,
157 const E_GrpLenEncoding glenc = EGL_noChange,
158 const Uint32 maxReadLength = DCM_MaxReadLength);
183 const E_TransferSyntax oxfer,
184 const E_EncodingType enctype,
193 const size_t flags = 0);
203 const E_TransferSyntax oxfer,
204 const E_EncodingType enctype,
221 const OFBool oldFormat = OFFalse);
306 const unsigned long pos,
307 OFBool normalize = OFTrue);
319 OFBool normalize = OFTrue);
581 E_ByteOrder byteOrder = gLocalByteOrder);
614 const E_ByteOrder byteOrder);
629 Uint32 &frameSize)
const;
660 Uint32 &startFragment,
688 const size_t pos = 0,
689 const size_t num = OFString_npos);
699 void *
getValue(
const E_ByteOrder newByteOrder = gLocalByteOrder);
712 const Uint32 position,
721 const Uint32 length);
765 const char *attrText = NULL);
virtual OFCondition getUncompressedFrame(DcmItem *dataset, Uint32 frameNo, Uint32 &startFragment, void *buffer, Uint32 bufSize, OFString &decompressedColorModel, DcmFileCache *cache=NULL)
access single frame without decompressing or loading a complete multi-frame object.
virtual void transferInit()
initialize the transfer state of this object.
a class representing a list of DICOM elements in which each element has a different tag and elements ...
class maintaining a attribute tag (group and element number)
virtual OFCondition clear()
clear (remove) attribute value
virtual OFCondition getOFStringArray(OFString &value, OFBool normalize=OFTrue)
get entire element value as a character string.
virtual OFCondition getUint16(Uint16 &val, const unsigned long pos=0)
retrieve a single value of type Uint16.
virtual OFCondition writeSignatureFormat(DcmOutputStream &outStream, const E_TransferSyntax oxfer, const E_EncodingType enctype, DcmWriteCache *wcache)
special write method for creation of digital signatures
virtual OFCondition putUint8Array(const Uint8 *vals, const unsigned long num)
replace the element value by a copy of the given Uint8 array (which is possibly multi-valued).
virtual OFCondition createUint8Array(const Uint32 numBytes, Uint8 *&bytes)
create an empty Uint8 array of given number of bytes and set it.
virtual void writeXMLStartTag(STD_NAMESPACE ostream &out, const size_t flags, const char *attrText=NULL)
write element start tag in XML format
virtual OFCondition loadAllDataIntoMemory()
this method loads all attribute values maintained by this object and all sub-objects (in case of a co...
abstract base class for all DICOM elements
Uint8 * fValue
value of the element
OFCondition changeValue(const void *value, const Uint32 position, const Uint32 num)
insert into the element value a copy of the given raw value.
virtual OFCondition getFloat64(Float64 &val, const unsigned long pos=0)
retrieve a single value of type Float64.
virtual ~DcmElement()
destructor
This class implements a simple container that stores an input stream, the position of that input stre...
virtual OFCondition putSint16(const Sint16 val, const unsigned long pos=0)
insert into the element value a copy of the given Sint16 value.
virtual OFCondition putFloat64Array(const Float64 *vals, const unsigned long num)
replace the element value by a copy of the given Float64 array (which is possibly multi-valued)...
OFCondition putValue(const void *value, const Uint32 length)
replace the element value by a copy of the given raw data block
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 ...
virtual OFCondition getSint32Array(Sint32 *&val)
get a pointer to the element value of the current element as type Sint32.
virtual Uint32 getLength(const E_TransferSyntax=EXS_LittleEndianImplicit, const E_EncodingType=EET_UndefinedLength)
calculate the value length (without attribute tag, VR and length field) of this DICOM element when en...
virtual OFCondition getSint32(Sint32 &val, const unsigned long pos=0)
retrieve a single value of type Sint32.
virtual OFCondition putFloat64(const Float64 val, const unsigned long pos=0)
insert into the element value a copy of the given Float64 value.
virtual OFCondition putUint32(const Uint32 val, const unsigned long pos=0)
insert into the element value a copy of the given Uint32 value.
this class encapsulates an attribute tag (group, element) and a VR.
DcmElement(const DcmTag &tag, const Uint32 len=0)
constructor.
virtual void postLoadValue()
performs clean-up functions after loading an attribute value into main memory.
This class implements a buffering mechanism that is used when writing large elements that reside in f...
base class for output streams.
static int scanValue(const OFString &value, const OFString &vr, const size_t pos=0, const size_t num=OFString_npos)
scan string value for conformance with given value representation (VR)
Abstract base class for most classes in module dcmdata.
void swapValueField(size_t valueWidth)
swaps the content of the value field (if loaded) from big-endian to little-endian or back ...
DcmElement & operator=(const DcmElement &obj)
assignment operator
virtual OFCondition checkValue(const OFString &vm="1-n", const OFBool oldFormat=OFFalse)
check whether stored value conforms to the VR and to the specified VM
virtual OFCondition getUint32Array(Uint32 *&val)
get a pointer to the element value of the current element as type Uint32.
OFCondition createEmptyValue(const Uint32 length)
create a new, empty value field of given size.
virtual OFCondition putFloat32(const Float32 val, const unsigned long pos=0)
insert into the element value a copy of the given Float32 value.
virtual OFCondition getUint8Array(Uint8 *&val)
get a pointer to the element value of the current element as type string.
virtual OFCondition writeXML(STD_NAMESPACE ostream &out, const size_t flags=0)
write object in XML format
virtual OFCondition getUint32(Uint32 &val, const unsigned long pos=0)
retrieve a single value of type Uint32.
virtual OFCondition putTagVal(const DcmTagKey &attrTag, const unsigned long pos=0)
insert into the element value a copy of the given DcmTagKey value.
virtual OFCondition getUint8(Uint8 &val, const unsigned long pos=0)
retrieve a single value of type Uint8.
OFCondition detachValueField(OFBool copy=OFFalse)
detach the value field from the DICOM element (i.e., this object).
virtual OFCondition putOFStringArray(const OFString &stringValue)
replace the element value by a copy of the given string (which is possibly multi-valued).
void setByteOrder(E_ByteOrder val)
set the current byte order of the value field
void * getValue(const E_ByteOrder newByteOrder=gLocalByteOrder)
This function returns this element's value.
virtual void compact()
remove the attribute value from memory if the attribute value can be loaded from file when needed aga...
virtual OFCondition putUint16Array(const Uint16 *vals, const unsigned long num)
replace the element value by a copy of the given Uint16 array (which is possibly multi-valued).
virtual OFCondition getTagVal(DcmTagKey &val, const unsigned long pos=0)
retrieve a single value of type DcmTagKey.
virtual OFBool isLeaf() const
check if this element is a leaf node in a dataset tree.
virtual OFCondition getFloat64Array(Float64 *&val)
get a pointer to the element value of the current element as type Float64.
virtual OFBool canWriteXfer(const E_TransferSyntax newXfer, const E_TransferSyntax oldXfer)
check if this DICOM object can be encoded in the given transfer syntax.
E_ByteOrder fByteOrder
current byte order of attribute value in memory
virtual OFCondition putUint32Array(const Uint32 *vals, const unsigned long num)
replace the element value by a copy of the given Uint32 array (which is possibly multi-valued).
virtual OFCondition putString(const char *val)
replace the element value by a copy of the given string (which is possibly multi-valued).
virtual OFCondition getSint16Array(Sint16 *&val)
get a pointer to the element value of the current element as type Sint16.
virtual OFCondition createValueFromTempFile(DcmInputStreamFactory *factory, const Uint32 length, const E_ByteOrder byteOrder)
replace the attribute value with the content of the given temporary file.
virtual OFCondition putSint32(const Sint32 val, const unsigned long pos=0)
insert into the element value a copy of the given Sint32 value.
virtual OFCondition putUint16(const Uint16 val, const unsigned long pos=0)
insert into the element value a copy of the given Uint16 value.
virtual OFCondition getDecompressedColorModel(DcmItem *dataset, OFString &decompressedColorModel)
determine color model of the decompressed image
virtual OFCondition putFloat32Array(const Float32 *vals, const unsigned long num)
replace the element value by a copy of the given Float32 array (which is possibly multi-valued)...
E_ByteOrder getByteOrder() const
return the current byte order of the value field
OFBool valueLoaded() const
check if value of this element is loaded into main memory
virtual OFCondition putSint16Array(const Sint16 *vals, const unsigned long num)
replace the element value by a copy of the given Sint16 array (which is possibly multi-valued).
virtual OFCondition write(DcmOutputStream &outStream, const E_TransferSyntax oxfer, const E_EncodingType enctype, DcmWriteCache *wcache)
This function writes this element's value to the outstream which was passed.
virtual OFCondition putSint32Array(const Sint32 *vals, const unsigned long num)
replace the element value by a copy of the given Sint32 array (which is possibly multi-valued).
virtual OFCondition copyFrom(const DcmObject &rhs)
Virtual object copying.
virtual void writeXMLEndTag(STD_NAMESPACE ostream &out, const size_t flags)
write element end tag in XML format
virtual Uint8 * newValueField()
This function creates a byte array of Length bytes and returns this array.
virtual OFCondition getUncompressedFrameSize(DcmItem *dataset, Uint32 &frameSize) const
compute uncompressed frame size of a single frame of this image.
virtual OFCondition getFloat32(Float32 &val, const unsigned long pos=0)
retrieve a single value of type Float32.
virtual OFCondition getOFString(OFString &str, const unsigned long pos, OFBool normalize=OFTrue)
retrieve a single value of type string.
virtual OFCondition read(DcmInputStream &inStream, const E_TransferSyntax ixfer, const E_GrpLenEncoding glenc=EGL_noChange, const Uint32 maxReadLength=DCM_MaxReadLength)
This function reads the data value of an attribute which is captured in the input stream and captures...
virtual OFCondition getString(char *&val)
get a pointer to the element value of the current element as type string.
a simple string class that implements a subset of std::string.
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.
static OFCondition checkVM(const unsigned long vmNum, const OFString &vmStr)
check for correct value multiplicity (VM)
virtual OFCondition getSint16(Sint16 &val, const unsigned long pos=0)
retrieve a single value of type Sint16.
DcmInputStreamFactory * fLoadValue
required information to load value later
virtual OFCondition getUint16Array(Uint16 *&val)
get a pointer to the element value of the current element as type Uint16.
virtual OFCondition getFloat32Array(Float32 *&val)
get a pointer to the element value of the current element as type Float32.
virtual OFCondition createUint16Array(const Uint32 numWords, Uint16 *&words)
create an empty Uint16 array of given number of words and set it.
Uint32 getLengthField() const
return the current value of the Length field (which is different from the functionality of the public...
OFCondition loadValue(DcmInputStream *inStream=NULL)
This function reads the data value of an attribute and stores the information which was read in this...
General purpose class for condition codes.