def load_slices(dcm_dir):
    """
    Load dcm like images
    Return img array and [z,y,x]-ordered origin and spacing
    """

    dcm_list = [join_paths(dcm_dir, i) for i in os.listdir(dcm_dir)]
    indices = np.array([pydicom.dcmread(i).InstanceNumber for i in dcm_list])
    dcm_list = np.array(dcm_list)[indices.argsort()]

    itkimage = sitk.ReadImage(dcm_list)
    numpyImage = sitk.GetArrayFromImage(itkimage)

    numpyOrigin = np.array(list(reversed(itkimage.GetOrigin())))
    numpySpacing = np.array(list(reversed(itkimage.GetSpacing())))

    return numpyImage, numpyOrigin, numpySpacing

    Load dcm like images
    Return img array and [z,y,x]-ordered origin and spacing
    
contrib/MedicalSeg/tools/preprocess_utils/load_image.py