Struct dicom_parser::stateful::decode::StatefulDecoder [−][src]
pub struct StatefulDecoder<D, S, BD = BasicDecoder, TC = SpecificCharacterSet> { /* fields omitted */ }Expand description
A stateful abstraction for the full DICOM content reading process.
This type encapsulates the necessary codecs in order
to be as autonomous as possible in the DICOM content reading
process.
S is the generic parameter type for the original source,
D is the parameter type that the decoder interprets as,
whereas DB is the parameter type for the basic decoder.
TC defines the text codec used underneath.
Implementations
pub fn new_with(
from: S,
ts: &TransferSyntax,
charset: SpecificCharacterSet,
position: u64
) -> Result<Self> where
S: Read,
pub fn new_with(
from: S,
ts: &TransferSyntax,
charset: SpecificCharacterSet,
position: u64
) -> Result<Self> where
S: Read,
Create a new DICOM parser for the given transfer syntax, character set, and assumed position of the reader source.
Create a new DICOM parser for the given transfer syntax and assumed position of the reader source.
The default character set is assumed until a Specific Character Set attribute is found.
impl<S> StatefulDecoder<ExplicitVRLittleEndianDecoder, S, LittleEndianBasicDecoder, DefaultCharacterSetCodec> where
S: Read,
impl<S> StatefulDecoder<ExplicitVRLittleEndianDecoder, S, LittleEndianBasicDecoder, DefaultCharacterSetCodec> where
S: Read,
Create a new DICOM stateful decoder for reading the file meta header, which is always in Explicit VR Little Endian.
Create a new DICOM stateful decoder from its parts.
Create a new DICOM stateful decoder from its parts, while assuming a base reading position.
position should be calculatd with care.
Decoding or parsing errors may occur
if this position does not match the real position of the reader.
impl<D, S, BD, TC> StatefulDecoder<D, S, BD, TC> where
S: Seek,
BD: BasicDecode,
TC: TextCodec,
impl<D, S, BD, TC> StatefulDecoder<D, S, BD, TC> where
S: Seek,
BD: BasicDecode,
TC: TextCodec,
Create a new DICOM stateful decoder from its parts,
while determining the data source’s current position via seek.
Trait Implementations
impl<D, S, BD> StatefulDecode for StatefulDecoder<D, S, BD> where
D: DecodeFrom<S>,
BD: BasicDecode,
S: Read,
impl<D, S, BD> StatefulDecode for StatefulDecoder<D, S, BD> where
D: DecodeFrom<S>,
BD: BasicDecode,
S: Read,
type Reader = S
Same as Decode::decode_header over the bound source.
Same as Decode::decode_item_header over the bound source.
Eagerly read the following data in the source as a primitive data
value. When reading values in text form, a conversion to a more
maleable type is attempted. Namely, numbers in text form (IS, DS) are
converted to the corresponding binary number types, and date/time
instances are decoded into binary date/time objects of types defined in
the chrono crate. To avoid this conversion, see
read_value_preserved. Read more
Eagerly read the following data in the source as a primitive data
value. Unlike read_value, this method will preserve the DICOM value’s
original format: numbers saved as text, as well as dates and times, are
read as strings. Read more
Eagerly read the following data in the source as a primitive data value as bytes, regardless of its value representation. Read more
Retrieve the known position of the inner reader source. If the stateful decoder was constructed at the beginning of the reader, this equals to the number of bytes read so far. Read more
Read the following number of bytes into a vector.
Read the following number of bytes as a sequence of unsigned 32 bit integers into a vector. Read more
Read the following number of bytes into a generic writer.
Skip the following bytes into a vector, counting them as if they were read. Read more