code: def main():
      args = get_user_args()
      for experiment_name in args.experiment_names:
          file_dir = os.path.join(
              args.file_dir, experiment_name, "niftynet_data"
          )
          for f_name in [
              f
              for f in os.listdir(file_dir)
              if f.startswith("seg") and f.endswith(".tif")
          ]:
              img = imread(os.path.join(file_dir, f_name))
              weight_map, binary_seg = construct_weights_and_mask(img)
              imsave(
                  os.path.join(file_dir, f_name).replace(
                      "seg", "weight"
                  ),
                  weight_map,
              )
              imsave(
                  os.path.join(file_dir, f_name).replace(
                      "seg", "bin_seg"
                  ),
                  binary_seg.astype(np.uint8),
              )
  
file_path: NiftyNet/demos/unet/make_cell_weights.py
imports: import os
  import numpy
  import matplotlib.pyplot
  from scipy.ndimage.morphology import distance_transform_edt
  from skimage.io import imsave, imread
  from skimage.segmentation import find_boundaries
  from demos.unet.file_sorter import get_user_args
label_desc: Use image node_id 2 for calling a global function with example usage: main() without return types