Last active
September 19, 2018 16:58
-
-
Save RaulMedeiros/f9cdcbfda24022e03c347b49ce04f03d to your computer and use it in GitHub Desktop.
Load DCM file with pydicom
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 load_dcm(img_path): | |
dcm = pydicom.read_file(img_path) | |
RescaleIntercept = int(dcm.data_element('RescaleIntercept').value) | |
return np.array(dcm.pixel_array,dtype=np.int16)+RescaleIntercept |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment