AllenInstitute / ophys_etl_pipelines

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

Apply equalization to suite2p motion projection images #161

Closed wbwakeman closed 3 years ago

wbwakeman commented 3 years ago

From #152, compute histogram to determine equalization to apply to projection images generated by suite2p motion correction

Tasks:

Validation criteria:

njmei commented 3 years ago

Notes about where max and avg image types are saved and loaded from LIMS:

Sources:

ophys_motion_correction_strategy:

suite2p_motion_correction_strategy:

ophys_cell_segmentation_strategy:

Consumers:

behavior_ophys_write_nwb_strategy:

ophys_nway_cell_matching_strategy:

njmei commented 3 years ago

@djkapner For average images it looks to me like the new avg projections look better than the old ones...

image

image

image

Though, as you pointed out, if an 'OphysAverageIntensityProjectionImage' is attached to the ophys_cell_segmentation_run that appears to be preferred when putting together the inputs for the nway strategy.

njmei commented 3 years ago

Max projections looks completely different from one another, the new max projections look a lot noisier...

image

image

image

djkapner commented 3 years ago

Can you compare max projections on some mesoscope experiments? In your last examples, I see what looks like dewarping artifacts. With mesoscope examples, we can at least eliminate the possibility that dewarping has broken since those first ones were created.

njmei commented 3 years ago

@djkapner You might be on to something, I don't see those banding artifacts for the mesoscope max projections:

image image

wbwakeman commented 3 years ago

FWIW, I am dewarping experiments 918566488,1008737608, 1063089965 with Taylor's updated dewarping code from PR #131 for issue #122 .

njmei commented 3 years ago

So yeah... looks like those bands feature quite prominently in the dewarped image:

image

Looks like this was not detected because the old production segmentation applied a gaussian filter when creating its "max intensity image".

wbwakeman commented 3 years ago

image.png Just to complete the thought...here are the max projection images of the three Scientifica experiments processed through the refactored dewarping code and then suite2p motion correction

njmei commented 3 years ago

Final conclusions:

LIMS ticket for updating behavior_ophys_write_nwb_strategy: http://jira.corp.alleninstitute.org/browse/PBS-2618