Open suyashkumar opened 1 year ago
For example for a pipeline you could do something like
var elem *dicom.Element
var err error
for err != dicom.EndOfDICOM {
elem, err = parser.Next()
newElem := doSomeProcessing(elem)
writer.WriteElement(elem)
}
and possibly don't have to hold the all of the DICOMs elements in memory at one time
Some dataset items must be held in memory as context to read future tags/values properly. But, we can have an option where only the essential tags are held in memory, and if you're using incremental parsing (
Parser.Next()
) you can process things 1 element at a time if appropriate for your use case.