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
I was wondering if there were any plans to support reading from a readable stream in the future, or if it is already possible, if you could please help point me in the right direction on how to achieve this?
Currently, I'm using dcmjs.data.DicomMessage.readFile(...) to read from an array buffer of a DICOM file read into memory. Although this does work well, I would like to be able to alleviate potential out of memory issues as I could be reading a very large DICOM file into memory, but only actually need the tags before PixelData.
Ideally, I would like to be able to pass in a readable stream and have dcmjs read up until the desired tag (similar to the readFile function) and then stop reading once dcmjs has reached the desired tag.
Example usage:
importdcmjsfrom"dcmjs";import{createReadStream}from"fs";constfileName="example.dcm";constreadStream=createReadStream(fileName);// Similar arguments to the readFile functionconstdicomDict=dcmjs.data.DicomMessage.readStream(readStream,{untilTag: "7FE00010",// Skip reading PixelDataincludeUntilTagValue: false,}
Any help would be much appreciated. Thank you!
The text was updated successfully, but these errors were encountered:
That sounds very reasonable - I don't know that anyone has plans to work on that, but if you wanted to suggest a backwards compatible way to do that it seems like a reasonable functionality to have.
I haven't really looked closely, but the current BufferStream code is basically treating the array as a stream, so having a variant that accepts a generic stream seems like it might be just a small change. Perhaps the same could be done for writing.
Hi dcmjs-org,
I was wondering if there were any plans to support reading from a readable stream in the future, or if it is already possible, if you could please help point me in the right direction on how to achieve this?
Currently, I'm using
dcmjs.data.DicomMessage.readFile(...)
to read from an array buffer of a DICOM file read into memory. Although this does work well, I would like to be able to alleviate potential out of memory issues as I could be reading a very large DICOM file into memory, but only actually need the tags beforePixelData
.Ideally, I would like to be able to pass in a readable stream and have
dcmjs
read up until the desired tag (similar to thereadFile
function) and then stop reading oncedcmjs
has reached the desired tag.Example usage:
Any help would be much appreciated. Thank you!
The text was updated successfully, but these errors were encountered: