suyashkumar / dicom

⚡High Performance DICOM Medical Image Parser in Go.
MIT License
933 stars 136 forks source link

Refactor read* methods into a lightweight reader struct. #254

Closed suyashkumar closed 1 year ago

suyashkumar commented 1 year ago

This change wraps the read methods in read.go into a lightweight reader struct. This allows for easier sharing of some common variables, for example the parse options set without having to inject them through deep read call chains.

This also does the following:

We may want to revisit the naming of some of these entities at some point. There now exists a dicom.reader (unexported) and a lower level dicomio.Reader (referred to as rawReader in this change). Ideally we can also make future refactors to eliminate the need for Parser to be aware of the rawReader (should be easy).