AllenInstitute / brain_observatory_qc

Other
2 stars 0 forks source link

Full FOV two-photon image QC #154

Open nataliaorlova opened 1 year ago

nataliaorlova commented 1 year ago

Full FOV 2P images are used for ophys-omfish registration and are going to start being generated by LIMS mesoscopes splitter module starting the week of Feb 13. We should think about how to QC them.

Example image can be found here

The file will be located at $SESSION_OUTPUT_DIR/${session_id}_stitched_full_field_img.h5. In the h5 file one can find a stitched full FOV 2P image and stitched full FOV 2P image with averaged surfaces inserted into it, along with the raw tiff metadata.

Once the images are available we should review a few examples and discuss features/metrics to QC. First thoughts are:

nataliaorlova commented 1 year ago

Here is the first file example generated by LIMS:

"\allen\programs\mindscope\production\vipssn\prod0\specimen_1210632453\ophys_session_1247774713\1247774713_stitched_full_field_img.h5"

nataliaorlova commented 1 year ago

Will catch up with @cbrrrry too spec out the skeleton of what QCing this image should be.

nataliaorlova commented 1 year ago

Carson (@cbrrrry ) and I talked yesterday and here is a skeleton of the QC for this image/file:

  1. hdf5 file (examples name 1268323260_stitched_full_field_img.h5) is present and has the following fields:
    • 'full_field_metadata' (SI metadata dictionary for the full field stack)
    • 'stitched_full_field', (stitched full field image)
    • 'stitched_full_field_with_rois', (stitched full field image with mapped into it ROIs)
    • 'surface_roi_metadata' (SI metadata for surface avg images)
    • 'insert_coordinates' (dictionary with coordinates to insert each ROI into Full Field image )
  2. Both stitched mapped and just stitched image is presenter to QCer to check:
    • whether there are no saturated features in the FOV and vasculature is visible - if there is saturation, flag for needing re-normalization or cropping.
    • stitching is correct in 'stitched_full_field' image: there is no significant (>10 pixels) horizontal overlap or vertical misalignment. If there is - fail and flag needing Natalia's re-calibration.
    • entire cranial window is captured in 'stitched_full_field' image.
    • all ROIs are present in the stitched_full_field_with_rois image and their location is correct (with 50 pixels accuracy)
    • FOV cleanliness: no bright speckles on the surface of the window.
    • note if bubbles are obviously visible (dark round or oval hazy spots)
DowntonCrabby commented 1 year ago

@nataliaorlova can you provide code that does 1?

For 2- if these items are evaluated manually (ie the operator looks by eye) can you please provide example images of the flag and failure modalities that you described above? I think we already have a controlled language tag and image for the bubbles but everything else is new

nataliaorlova commented 1 year ago

The code for finding the file, opening it and checking the fields? You guys should be able to do that in 5-10 lines of code...

As to #2 - let's start by visualizing the image to the operators - this is a new data stream, and we will be collecting examples as we have a way to look at them.

cbrrrry commented 1 year ago

I have some rough code for this, part of which you have previously shared @nataliaorlova, that I am happy to provide. Would this live in data_access @DowntonCrabby ?

DowntonCrabby commented 1 year ago

Okay had a brief meeting and here were the take-aways & tasks:

Proof of concept coding: Carson to provide code that does these tasks:

qc metric generation pipeline:

qc module creation & display in report

DowntonCrabby commented 1 year ago

Just for visibility/clarity- we will try to incorporate this into the next milestone/release.

We are currently in the phase doing bug fixes on Milestone 2- so we're talking about this being in like milestone 3

cbrrrry commented 1 year ago

I submitted a PR called " Fullfield qc #292 " with the code for this issue. Review at your leisure!

jkim0731 commented 12 months ago

There are some cases where stitching was not good: E.g.: \allen\programs\mindscope\production\learning\prod0\specimen_1285648947\ophys_session_1305964574 image

jkim0731 commented 12 months ago

Sometimes the fullfield is not stitched E.g.: \allen\programs\mindscope\production\learning\prod0\specimen_1292035016\ophys_session_1300393608

matchings commented 10 months ago

@DowntonCrabby @seanmcculloch I think this is still needed and should be prioritized as part of mouse QC / CO migration work