Struct dicom_parser::stateful::decode::StatefulDecoder
source · pub struct StatefulDecoder<D, S, BD = BasicDecoder, TC = SpecificCharacterSet> { /* private fields */ }
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§
source§impl<S> StatefulDecoder<DynDecoder<S>, S>
impl<S> StatefulDecoder<DynDecoder<S>, S>
sourcepub 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.
sourcepub fn new_with_ts(from: S, ts: &TransferSyntax, position: u64) -> Result<Self>where
S: Read,
pub fn new_with_ts(from: S, ts: &TransferSyntax, position: u64) -> Result<Self>where
S: Read,
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.
source§impl<S> StatefulDecoder<ExplicitVRLittleEndianDecoder, S, LittleEndianBasicDecoder, DefaultCharacterSetCodec>where
S: Read,
impl<S> StatefulDecoder<ExplicitVRLittleEndianDecoder, S, LittleEndianBasicDecoder, DefaultCharacterSetCodec>where
S: Read,
sourcepub fn file_header_parser(from: S) -> Self
pub fn file_header_parser(from: S) -> Self
Create a new DICOM stateful decoder for reading the file meta header, which is always in Explicit VR Little Endian.
source§impl<D, S, BD, TC> StatefulDecoder<D, S, BD, TC>where
BD: BasicDecode,
TC: TextCodec,
impl<D, S, BD, TC> StatefulDecoder<D, S, BD, TC>where
BD: BasicDecode,
TC: TextCodec,
sourcepub fn new(
from: S,
decoder: D,
basic: BD,
text: TC
) -> StatefulDecoder<D, S, BD, TC>
pub fn new(
from: S,
decoder: D,
basic: BD,
text: TC
) -> StatefulDecoder<D, S, BD, TC>
Create a new DICOM stateful decoder from its parts.
sourcepub fn new_with_position(
from: S,
decoder: D,
basic: BD,
text: TC,
position: u64
) -> Self
pub fn new_with_position(
from: S,
decoder: D,
basic: BD,
text: TC,
position: u64
) -> Self
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.
source§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,
sourcepub fn new_positioned(
from: S,
decoder: D,
basic: BD,
text: TC
) -> Result<Self, Error>
pub fn new_positioned(
from: S,
decoder: D,
basic: BD,
text: TC
) -> Result<Self, Error>
Create a new DICOM stateful decoder from its parts,
while determining the data source’s current position via seek
.
Trait Implementations§
source§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
source§fn decode_header(&mut self) -> Result<DataElementHeader>
fn decode_header(&mut self) -> Result<DataElementHeader>
Decode::decode_header
over the bound source.source§fn decode_item_header(&mut self) -> Result<SequenceItemHeader>
fn decode_item_header(&mut self) -> Result<SequenceItemHeader>
Decode::decode_item_header
over the bound source.source§fn read_value(&mut self, header: &DataElementHeader) -> Result<PrimitiveValue>
fn read_value(&mut self, header: &DataElementHeader) -> Result<PrimitiveValue>
chrono
crate. To avoid this conversion, see
read_value_preserved
. Read moresource§fn read_value_preserved(
&mut self,
header: &DataElementHeader
) -> Result<PrimitiveValue>
fn read_value_preserved(
&mut self,
header: &DataElementHeader
) -> Result<PrimitiveValue>
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