class_docstr: Class that performs the reading of the csv_input and select the lines
  according to the subject id if available
class_docstr_tok: ["Class","that","performs","the","reading","of","the","csv_input","and","select","the","lines","according","to","the","subject","id","if","available"]
docstr: Transform the labeling to one hot encoding
  :param labels: labels to encode
  :param _dims:
  :return:
docstr_tok: ["Transform","the","labeling","to","one","hot","encoding",":","param","labels",":","labels","to","encode",":","param","_dims",":",":","return",":"]
code: def to_ohe(labels, _dims):
      """
      Transform the labeling to one hot encoding
      :param labels: labels to encode
      :param _dims:
      :return:
      """
      label_names = list(set(labels))
      ohe = [
          np.eye(_dims)[label_names.index(label)].astype(np.float32)
          for label in labels
      ]
      return ohe
  
imports: import random
  import numpy
  import pandas
  import tensorflow
  from tensorflow.python.data.util import nest
  from niftynet.layer.base_layer import Layer
  from niftynet.io.image_reader import param_to_dict
label_desc: Use image node_id 4 for calling the CSVReader obj's underlying member method code with example usage: obj.to_ohe(labels, _dims) and returns: ohe