Last active
March 31, 2023 16:16
-
-
Save rahulremanan/21341f4bf43f2183862fc1786a4a8108 to your computer and use it in GitHub Desktop.
A DICOM reader generator function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def dicom_generator(dicom_chunks): | |
i = 0 | |
while True: | |
_inp = dicom_chunks[i] | |
_img = read_dicom(_inp) | |
yield _img | |
i += 1 # Exploiting the stateful nature of generators |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment