Change transfer syntax API for more pixel data codec flexibility#361
Merged
Change transfer syntax API for more pixel data codec flexibility#361
Conversation
5987333 to
152f653
Compare
406e050 to
a18315f
Compare
- Split PixelRWAdapter into PixelDataReader and PixelDataWriter - Change Codec - type parameters become `<D, R, W>` - Change variants to None, Dataset, and EncapsulatedPixelData, wan describe different levels and implementations - also add a few more helper methods to TransferSyntax - Change TransferSyntax type parameters to `D`, `R`, `W` - Update RLE and JPEG adapters - change PixelDataObject::fragment to return Cow<[u8]> - may save an allocation in case of in-memory DICOM objects - [object] update impl accordingly - [ts-registry] update registry according to changes - Change method names in TransferSyntax - [ul][ts-registry][pixeldata] update according to changes
- adjust impls everywhere
- If EncapsulatedPixelData(..), we can decode data sets
- Remove reference to outdated trait - Simplify display of DecodeError::Custom and EncodeError::Custom - Update error variant documentation to be more extensive - remove unneeded allow(unused_variables) attribute
- tweak documentation of DynPixelDataReader, DynPixelDataWriter, and NeverPixelAdapter - add impl PixelDataReader and PixelDataWriter for NeverAdapter
- refer to both submit_transfer_syntax! and submit_ele_transfer_syntax!
- expose "native" as its own feature - explicitly name "image" as a feature
- return `Option<u32>` instead of `Option<u16>` - [object] propagate changes
- calls `decode_frame` for each frame
- add transfer_syntax_uid() - add offset_table() - [object] add implementations for new methods
- change `encode` to also include offsets - change `dst` paramter of `encode` to a vec of vecs - document that pixel data writing must be supported by native pixel data, but might also be supported from other transfer syntaxes
- calls `encode_frame` for each frame and calculates the offsets for offset_table
a18315f to
7587145
Compare
- NeverPixelAdapter is unused with "jpeg" feature
- .fragment(0) can be used to fetch flat (non-encapsulated) pixel data
- tweak documentation - add `bits_stored(&self)` - [object] adjust PixelDataObject implementation accordingly
Enet4
added a commit
that referenced
this pull request
Mar 24, 2024
…r_syntax` - update according to the new type parameters defined in #361
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This makes some changes to the types
TransferSyntaxandCodec. The noteworthy changes are:NotImplementederror). This was done by splittingPixelRWAdapterand the parameter typePinto two independent traitsPixelDataReaderandPixelDataWriterPixelDataReaderhas a new method for reading a single frame.PixelDataWriterhas been redesigned to return a sequence of attribute operations to perform on an object that will host the encapsulated pixel data produced.Summary
PixelRWAdapterintoPixelDataReaderandPixelDataWriterCodec<D, R, W>None,Dataset, andEncapsulatedPixelData, which can describe different levels and implementationsTransferSyntaxTransferSyntaxtype parameters toD,R,WPixelDataObject::fragmentto returnCow<[u8]>TransferSyntax