Exemplo n.º 1
0
  def save_region_pipeline(self, primary_channel_name=None, secondary_channel_name=None):
    # 1. make unique key
    unique_key = '{}{}-{}'.format(primary_channel_name, secondary_channel_name, random_string())

    # 2. format and save file
    pipeline_text = region_pipeline(unique_key, primary_channel_name, secondary_channel_name)
    with open(os.path.join(self.pipeline_path, 'regions.cppipe')) as open_pipeline_file:
      open_pipeline_file.write(pipeline_text)

    return unique_key
Exemplo n.º 2
0
  def save_marker_pipeline(self, series_name=None, primary_channel_name=None, secondary_channel_name=None):
    # 1. make unique key
    unique = random_string()
    unique_key = '{}{}-{}'.format(primary_channel_name, secondary_channel_name, unique)

    # 2. format and save file
    pipeline_text = marker_pipeline('{}_s{}_{}_'.format(self.name, series_name, unique), unique_key, primary_channel_name, secondary_channel_name)
    with open(os.path.join(self.pipeline_path, 'markers.cppipe'), 'w+') as open_pipeline_file:
      open_pipeline_file.write(pipeline_text)

    return unique, unique_key