Skip to content

Instantly share code, notes, and snippets.

@RaulMedeiros
Last active September 19, 2018 16:58
Show Gist options
  • Save RaulMedeiros/f9cdcbfda24022e03c347b49ce04f03d to your computer and use it in GitHub Desktop.
Save RaulMedeiros/f9cdcbfda24022e03c347b49ce04f03d to your computer and use it in GitHub Desktop.
Load DCM file with pydicom
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