def data_prep_function(data, luna_annotations, pixel_spacing, luna_origin,
p_transform=p_transform,
p_transform_augment=None):
# make sure the data is processed the same way
lung_mask = lung_segmentation.segment_HU_scan_ira(data)
annotatations_out = []
for zyxd in luna_annotations:
zyx = np.array(zyxd[:3])
voxel_coords = utils_lung.world2voxel(zyx, luna_origin, pixel_spacing)
zyxd_out = np.rint(np.append(voxel_coords, zyxd[-1]))
annotatations_out.append(zyxd_out)
annotatations_out = np.asarray(annotatations_out)
return lung_mask, lung_mask, lung_mask, annotatations_out, None
评论列表
文章目录