How to converted ground truth in txt file to labeled volume for medical images?

i have medical images in Dicom format, and i would like to generate the labels for these images if i have x,y,z dim in txt file