Skip to content
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

If the passed in Reader is _also_ an io.Seeker, consider trying to use Seek() on Skip #263

Open
suyashkumar opened this issue Feb 25, 2023 · 0 comments

Comments

@suyashkumar
Copy link
Owner

If the reader we are reading from is also an io.Seeker, try to use Seek() on Skip (when skipping data, so we don't need to do reads). Using this in conjunction with a buffered Reader may be complex or require a custom implementation though for a small improvement.

This would be useful when parsing files from disk, but when reading from cloud storage I'm not sure most clients offer a Seeker interface (though it could be possible).

Since this is most likley to be used with PixelData anyway, and top-level PixelData should be the last tag in the DICOM, we could also consider just stopping alltogether when we hit a top-level PixelData tag (no need to read further). We would have to be careful about some things, like PixelData tags embedded within Sequences (e.g. Icons).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant