-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
First crack at adding dataset read adapter in DS read for deflate #438
base: master
Are you sure you want to change the base?
Conversation
* Note, not all paths lead to writing, for example using `InMemDicomObject.read_dataset_with_dict` would bypass deflate. * No support for writing right now
- make it fully dynamic and pass a lifetime from input to output - change the rest of the code to fit DataRWAdapter - revert 'static lifetime constraints - remove unused file
- remove use of dicom_pixeldata - inspect dicom object contents
I had another try at this. Last time we talked about deflate TS support, the main problem was that the data RW adapter would not allow us to bind the lifetime of the adapted reader/writer to the lifetime of the input reader/writer. With the current signature, this is simply impossible. So we had to change the trait pub trait DataRWAdapter {
type Reader<'r, R: 'r>: Read
where Self: 'r;
type Writer<'w, W: 'w>: Write
where Self: 'w;
/// Adapt a byte reader.
fn adapt_reader<R>(&self, reader: R) -> Self::Reader<R>;
/// Adapt a byte writer.
fn adapt_reader<W>(&self, writer: W) -> Self::Writer<W>;
} As delightful as this trait is, it is not dyn-compatible (the new nomenclature for what was previously known as object-safe), so we could not have a registry for any adapter of this kind. Ultimately, we have to go for a fully dynamic approach with an added lifetime parameter at each method. pub trait DataRWAdapter {
/// Adapt a byte reader.
fn adapt_reader<'r>(&self, reader: Box<dyn Read + 'r>) -> Box<dyn Read + 'r>;
/// Adapt a byte writer.
fn adapt_writer<'w>(&self, writer: Box<dyn Write + 'w>) -> Box<dyn Write + 'w>;
} After propagating the changes to the rest of the code, we thus bring support for deflated DICOM data sets in This is not yet ready though.
|
- JPIP Referenced Deflate - JPIP HTJ2K Referenced Deflate
- check for differences in encapsulated data from source TS to target TS instead of whether they are codec-free
- only run it if JPIP Referenced Deflate is not fully supported yet
No description provided.