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
def save_region_pipeline(self, series_name=None, primary_channel_name=None, secondary_channel_name=None, threshold_correction_factor=1.2, background=True, unique='', unique_key=''): # format and save file pipeline_text = region_pipeline('{}_s{}_{}_'.format(self.name, series_name, unique), unique_key, 's{}_ch{}'.format(series_name, primary_channel_name), 's{}_ch{}'.format(series_name, secondary_channel_name), threshold_correction_factor=threshold_correction_factor, background=background) with open(os.path.join(self.pipeline_path, 'regions.cppipe'), 'w+') as open_pipeline_file: open_pipeline_file.write(pipeline_text)