code: def add_experiment_info_to_datasets(df, est_dirs):
      """adds the experimental information from the training settings"""
      experiment_numbers, flipping, dataset_splits, deforming = (
          [],
          [],
          [],
          [],
      )
  
      for est_dir_key in est_dirs:
          # getting the dataset_split file from the settings_train txt file:
          train_settings = " ".join(
              [
                  l.strip()
                  for l in open(
                      est_dirs[est_dir_key] + "../settings_train.txt",
                      "r",
                  )
              ]
          )
  
          experiment_numbers.append(est_dir_key)
  
          r = re.search(
              "dataset_split_file:\s.*(\d).csv", train_settings
          )
          dataset_splits.append(r.group(1))
  
          r = re.search("flipping_axes:\s\((.*?)\)", train_settings)
          flip = "False" if "-1" in r.group(1) else "True"
          flipping.append(flip)
  
          r = re.search("elastic_deformation:\s(\w+)", train_settings)
          deforming.append(r.group(1))
  
      data_dict = {
          "variable": experiment_numbers,
          "flip": flipping,
          "deform": deforming,
          "train_split": dataset_splits,
          "augmentations": [
              "_".join(["flip", x[0], "def", y[0]])
              for x, y in zip(flipping, deforming)
          ],
      }
  
      conditions_df = pd.DataFrame(data_dict)
      combined_df = pd.merge(df, conditions_df)
  
      return combined_df
  
file_path: NiftyNet/demos/unet/unet_demo_utils.py
imports: import os
  import nibabel
  import pandas
  import numpy
  import matplotlib.pyplot
  from skimage.io import imread
  import re
label_desc: Use image node_id 4 for calling a global function with example usage: add_experiment_info_to_datasets(df, est_dirs) and returns: combined_df