run_pipelines.py 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. from view.python_core.processing_pipelines import PipelineManager
  2. # this tells view all settings including the folder structure of your project
  3. # On Windows, if you copy paths from the file explorer, make sure the string below is always of the form r"......"
  4. ymlfile = r"/home/aj/SharedWithWindows/MR_Till/usage_till_linux.yml"
  5. # specify the pipeline definition file to use
  6. pipelines_definition_file = r"/home/aj/SharedWithWindows/MR_Till/progs/pipelines_settings/processing_pipelines.yml"
  7. # specify the animals whose data is to be processed; and their corresponding pipelines
  8. animals = {
  9. # "<animal name>": ['pipeline1', 'pipeline2', 'pipeline3'],
  10. # "MR_190510b_or47a": ['pipeline1', 'pipeline2'],
  11. "MR_190510b_or47a": ['pipeline1', 'pipeline2', 'pipeline4', 'pipeline5', 'pipeline5a']
  12. # "MR_190510b_or47a": ['pipeline1', 'pipeline4', 'pipeline5', 'pipeline5a']
  13. # "MR_190510b_or47a": ['pipeline1_custom_cnmf',
  14. # 'pipeline2_custom_cnmf',
  15. # 'pipeline4_custom_cnmf',
  16. # 'pipeline5_custom_cnmf',
  17. # 'pipeline5a_custom_cnmf'],
  18. # "MR_190510b_or47a": ['pipeline2_custom_cnmf',
  19. # 'pipeline2_custom_cnmf_1',
  20. # 'pipeline2_custom_cnmf_2',
  21. # 'pipeline2_custom_cnmf_3'
  22. # ]
  23. # "MR_190510b_or47a": [
  24. # 'pipeline2_rnmf_defaults', 'pipeline2_rnmf_maxCount_50'
  25. # ]
  26. }
  27. # ----------------------------------------------------------------------------------------------------------------------
  28. # visualization flags
  29. # These flags control some aspects of the graphs and plots of evaluation reports
  30. # -----------------------------------------------------------------------------------------------------------------------
  31. # Specifies a threshold that is used when creating and drawing contours of detected components
  32. # from their spatial footprints. Footprints are normalized by dividing by their maximum before being thresholded.
  33. # NOTE: Since this flag is also used when overlaying ROI information in TIF on overviews and movies,
  34. # please set for consistency the flag "RM_ROIThreshold" in your project YML file.
  35. roi_threshold = 0.75 # a float value between 0 and 1, like 0.75
  36. # A maximum-correlation summary image is created from the data and used as the background for showing
  37. # detected components. Maximum-correlation summary image is created by binning frames into non-overlapping bins, and the
  38. # size of these bins are controlled by this flag
  39. frame_bin_size = 200 # an integer value, like 200
  40. # ----------------------------------------------------------------------------------------------------------------------
  41. # required on windows when code spawns subprocesses
  42. # https://stackoverflow.com/questions/18204782/runtimeerror-on-windows-trying-python-multiprocessing
  43. if __name__ == '__main__':
  44. for animal, pipelines in animals.items():
  45. visualization_flags = {
  46. "roi_threshold": roi_threshold,
  47. "frame_bin_size": frame_bin_size
  48. }
  49. pipline_manager = PipelineManager(
  50. project_yml_file=ymlfile, animal=animal, pipelines_config_file=pipelines_definition_file,
  51. pipeline_names=pipelines, visualization_flags=visualization_flags)
  52. pipline_manager.run_all_pipelines(analyse_value_to_use=(1,))