AllenInstitute / ophys_etl_pipelines

Pipelines and modules for processing optical physiology data
Other
9 stars 5 forks source link

Psb 238/remove redundant motion border validation #622

Closed mikejhuang closed 10 months ago

mikejhuang commented 10 months ago

Changes summary

  1. Remove duplicate logic for checking if an roi is in the motion border
  2. Renamed is_in_motion_border to is_not_in_motion_border since that's what it returns
  3. The method TraceExtraction.save_metadata_to_db previously erroneously assumed the exclusion_label output file stored the exclusion labels as a list of strings for each roi under the format [{roi_id: 1, 'exclusion_label_name': ["name"]}, {roi_id: 2, 'exclusion_label_name': [}] However, it stores it as [{roi_id: 1, 'exclusion_label_name': "name_a"}, {roi_id: 1, 'exclusion_label_name': "name_b"}] The method and associated test assets are updated to reflect that.
mikejhuang commented 10 months ago

Confirmed yesterday's discussion with unit tests where the ROI both touches and crosses each of the 4 borders (left, right, top, bottom). With the erroneous -1 added, the roi touching the right and bottom is detected as being part of the motion border. With the -1 removed, it behaves consistently with all 4 sides.

image