pub struct TransferSyntax<D = DynDataRWAdapter, P = DynPixelRWAdapter> { /* private fields */ }
Expand description

A DICOM transfer syntax specifier.

Custom encoding and decoding capabilities are defined via the parameter types D and P, The type parameter D specifies an adapter for reading and writing data sets, whereas P specifies the encoder and decoder of encapsulated pixel data.

This type is usually consumed in its “type erased” form, with its default parameter types. On the other hand, implementers of TransferSyntax will typically specify concrete types for D and P, which are type-erased before registration. If the transfer syntax requires no data set codec, D can be assigned to the utility type NeverAdapter.

Implementations

Create a new transfer syntax descriptor.

Note that only transfer syntax implementers are expected to construct TS descriptors from scratch. For a practical usage of transfer syntaxes, one should look up an existing transfer syntax registry by UID.

Example

To register a private transfer syntax in your program, use submit_transfer_syntax outside of a function body:

submit_transfer_syntax! {
    TransferSyntax::<NeverAdapter, NeverPixelAdapter>::new(
        "1.3.46.670589.33.1.4.1",
        "CT-Private-ELE",
        Endianness::Little,
        true,
        Codec::EncapsulatedPixelData,
    )
}

Obtain this transfer syntax’ unique identifier.

Obtain the name of this transfer syntax.

Obtain this transfer syntax’ expected endianness.

Obtain this transfer syntax’ codec specification.

Check whether this transfer syntax specifier provides a complete implementation.

Check whether no codecs are required for this transfer syntax, meaning that a complete implementation is available and no pixel data conversion is required.

Check whether reading and writing of data sets is unsupported. If this is true, encoding and decoding will not be available.

Check whether reading and writing the pixel data is unsupported. If this is true, encoding and decoding of the data set will still be possible, but the pixel data will only be available in its encapsulated form.

Retrieve the appropriate data element decoder for this transfer syntax. Can yield none if decoding is not supported.

The resulting decoder does not consider pixel data encapsulation or data set compression rules. This means that the consumer of this method needs to adapt the reader before using the decoder.

Retrieve the appropriate data element decoder for this transfer syntax and given reader type (this method is not object safe). Can yield none if decoding is not supported.

The resulting decoder does not consider pixel data encapsulation or data set compression rules. This means that the consumer of this method needs to adapt the reader before using the decoder.

Retrieve the appropriate data element encoder for this transfer syntax. Can yield none if encoding is not supported. The resulting encoder does not consider pixel data encapsulation or data set compression rules.

Retrieve the appropriate data element encoder for this transfer syntax and the given writer type (this method is not object safe). Can yield none if encoding is not supported. The resulting encoder does not consider pixel data encapsulation or data set compression rules.

Obtain a dynamic basic decoder, based on this transfer syntax’ expected endianness.

Type-erase the pixel data or data set codec.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.