Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Saturation Metric (number of saturated pixels) only checks first 500 frames #385

Open
seanmcculloch opened this issue Jan 25, 2024 · 4 comments
Labels
issue type: metric update updates of existing metrics, plots or thresholds

Comments

@seanmcculloch
Copy link
Collaborator

** Metric / Plot Impacted **

  • nb_saturated_pixels

Update Motivation
This metric currently only uses the first few minutes to create a max projection, then count's the number of saturated pixels in that max projection. This should be changed to use more of the session - especially since this time period may not account for periods in the session with stronger activity

The threshold should also be reevaluated for this metric.

Currently, the threshold is set to flag at 800px, fail at 1000px. We believe this was set to roughly estimate the number of pixels in a single cell. (Failure if an entire cell is saturated at any point).

The function for this metric is here: https://github.com/AllenInstitute/mindscope_qc_metrics/blob/ad301d9524ca89b8ee210621e0be81de76b62f6e/mindscope_qc_metrics/datasets/motion_corr_physio.py#L483

Note the default parameter "end_frame" set to 500.

This has implications on recalculating a large backlog of saturation metrics that was previously discussed.

@seanmcculloch seanmcculloch added the issue type: metric update updates of existing metrics, plots or thresholds label Jan 25, 2024
@seanmcculloch
Copy link
Collaborator Author

Description of motion_corr_physio Metrics used in reports:

Physio intensity values histogram (physio_intensity_hist)

  • Plots histogram of every pixel in first 500 frames

Number saturated pixels (physio_nb_saturated_pixels)

  • Flattens first 500 frames into a max projection image, counts number of pixels above saturation threshold (hardcoded per rig)

Motion corrected physio mean intensity (physio_video_mean)

  • Mean of all pixels in first 500 frames

Maximum Intensity Projection (maximum_intensity_projection_image)

  • Produced by lims output.

Intensity drift (%) (physio_percent_change_intensity)

  • Gets average of all pixels frames [300, 500], compares to average of all pixels in frames [-501, -300] where negative frames are relative to end

Frame Intensity Std. (physio_frame_intensity_std)

  • Calculates mean of every frame individually, computes STD from those

Physio intensity timeseries (physio_intensity_plot)

  • Uses every 500th frame of entire video (subsample). Plots average pixel value of frame.

Epilepsy Probability (%) (epilepsy_probability)

  • Uses oasis.functions.deconvolve() with first 10,000 frames

Epilepsy Probability Plot (epilepsy_probability_plot)

  • Uses oasis.functions.deconvolve() with first 10,000 frames

Number excessive motion frames (nb_excessive_motion_frames)

  • Counts number of frames in whole movie where total_shift from median is >50px

XY motion plot (xy_motion_plot)

  • Plots XPixShift, YPixShift values for whole movie

XY motion histogram (motion_histogram)

  • Whole movie, plots total shift

Motion correction, Max Total Shift (max_total_shift)

  • Whole movie

Motion correction, mean total shift (mean_total_shift)

  • Whole movie

@seanmcculloch
Copy link
Collaborator Author

Explore nb_saturated_pixels by seeing how it changes for each 500frames of the movie

@seanmcculloch
Copy link
Collaborator Author

ping QC stakeholders teams channel

@seanmcculloch
Copy link
Collaborator Author

Run backlog of saturation metrics with current metric

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue type: metric update updates of existing metrics, plots or thresholds
Projects
None yet
Development

No branches or pull requests

1 participant