Skip to content

Instantly share code, notes, and snippets.

View RaulMedeiros's full-sized avatar

Raul Medeiros RaulMedeiros

  • Fortaleza
View GitHub Profile
@RaulMedeiros
RaulMedeiros / gist:f9cdcbfda24022e03c347b49ce04f03d
Last active September 19, 2018 16:58
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