Coder Social home page Coder Social logo

Comments (3)

gofal avatar gofal commented on June 13, 2024

Agree, unseekable streams are already implemented in development branch. Could you verify, when using the latest development-code, that opening the file from networkstream actually works?

from fo-dicom.

cocosip avatar cocosip commented on June 13, 2024

gree, unseekable streams are already implemented in development branch. Could you verify, when using the latest development-code, that opening the file from networkstream actually works?

I use HttpClient.GetStreamAsync(url) to get the stream, but the stream not support get the length。So the stream returned by the GetStreamAsync method cannot be used directly to open a DICOM file。

from fo-dicom.

gofal avatar gofal commented on June 13, 2024

Ah ja, the UnseekableStreamByteSource assumes, that seeking is not supported. But this stream not even supports the Length property, which is even worse.
The quick fix is to download into a memorystream and then to parse using fo-dicom. The long fix, is to implement another version of ByteSource that uses streams without using Length. But to tell you the truth, this class internallly will have no other chance than to just download the data piecewise, buffer it into a memorystream and then do the parsing from that memorystream. That is also how UnseekableStreamByteSource is doing it.
So it will not be faster or less memory consuming because in both ways it has to download all the data, and the parsing will only be finished when all the data is ready downloaded. It will mainly be syntactic sugar because it saves you 1 line of code and newbie users are not surprised about a NotSupportedException when opening a DicomFile from a HttpResponseStream.

from fo-dicom.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.