You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
it will throw an exception : NotSupportedException: Specified method is not supported
Does fo-dicom supports opening a DICOM directly from a network stream ? I saw "UnseekableStreamByteSource" in the source code, which seems to be used to read DICOM data from network streams ?
The text was updated successfully, but these errors were encountered:
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?
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。
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.
it will throw an exception : NotSupportedException: Specified method is not supported
Does fo-dicom supports opening a DICOM directly from a network stream ? I saw "UnseekableStreamByteSource" in the source code, which seems to be used to read DICOM data from network streams ?
The text was updated successfully, but these errors were encountered: