import os
import lmdb
import SimpleITK as sitk
from pydicom import dicomio

# load labels
root = '/fileser51/DataRadiology/LABEL/PROJECT/Nodule/detect/DB/gold_505_183/raw_spacing'

env_ct_info = lmdb.open(root, map_size=int(1e9))
txn_ct_info = env_ct_info.begin()

ct_dict = {}
for key, value in txn_ct_info.cursor():
    ct_dict[key.decode()] = eval(value)
 
txn_ct_info.commit()
env_ct_info.close()

# load data
root = '/fileser51/DataRadiology/IMAGE/PROJECT/Nodule/Det/Gold688/RAW_NII'
nii_files = os.listdir(root)

nii_dir = os.path.join(root, nii_files[0])

image = sitk.ReadImage(nii_dir)

print()
