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

Infer DICOM file size, when possible #1448

Merged
merged 1 commit into from
Jan 31, 2024

Conversation

psavery
Copy link
Collaborator

@psavery psavery commented Jan 29, 2024

Google Healthcare API supports single-part requests for DICOM files. Single-part requests are not officially supported by the DICOMweb standard, but they are easier to work with. Google Healthcare API also provides the Content-Length. We can utilize this information to infer the DICOM file size without having to stream the whole file.

This PR adds logic to automatically infer the DICOM file size and set it, when possible, without streaming the whole file.

Unfortunately, dcm4chee does not support single-part requests, and they do not return a Content-Length either. So we must still stream the whole file to get the file size for dcm4chee servers. But if we determine a new way to infer the file size, we can add it as well.

To do:

  • Cache in the assetstore whether it supports singlepart downloads or not.

Google Healthcare API supports single-part requests for DICOM files.
Single-part requests are not officially supported by the DICOMweb standard,
but they are easier to work with. Google Healthcare API also provides
the Content-Length. We can utilize this information to infer the DICOM file
size without having to stream the whole file.

This PR adds logic to automatically infer the DICOM file size and set
it, when possible, without streaming the whole file.

Unfortunately, dcm4chee does not support single-part requests, and they do
not return a Content-Length either. So we must still stream the whole file
to get the file size for dcm4chee servers. But if we determine a new way
to infer the file size, we can add it as well.

Signed-off-by: Patrick Avery <[email protected]>
@psavery psavery force-pushed the dicomweb-infer-file-size branch from 721d6a2 to c981c54 Compare January 29, 2024 20:21
@psavery psavery marked this pull request as ready for review January 29, 2024 21:40
@psavery psavery merged commit 90a3a26 into girder:master Jan 31, 2024
14 checks passed
@psavery
Copy link
Collaborator Author

psavery commented Jan 31, 2024

In a follow-up PR, I will store whether the server supports singlepart requests in the assetstore.

@psavery psavery deleted the dicomweb-infer-file-size branch January 31, 2024 15:25
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

Successfully merging this pull request may close these issues.

2 participants