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

Add motion correction for Widefield Imaging #16

Merged
merged 7 commits into from
Nov 27, 2023

Conversation

weiglszonja
Copy link
Collaborator

@weiglszonja weiglszonja commented Nov 18, 2023

Motion Correction for Widefield raw imaging

  • For each .ome.tif file there is a corresponding .mcorr_1.mat file which contains the x, and y shifts for each frame.
  • We are saving the x, and y shifts (which ought to be in pixels, though the example data that we received only contains 0s and 1s) as TimeSeries
  • I am using the frame indices from the raw imaging data to add the TimeSeries of the y and x shifts for the blue and violet frames separately
  • The motion corrected video is not saved by the Pinto lab, they are only saving the x, and y shifts and computing the motion correction on the fly

DrChicken_20230419_20hz.nwb

@weiglszonja weiglszonja marked this pull request as draft November 18, 2023 21:19
@weiglszonja weiglszonja self-assigned this Nov 18, 2023
weiglszonja and others added 3 commits November 22, 2023 14:30
# Conflicts:
#	src/pinto_lab_to_nwb/widefield/widefield_requirements.txt
#	src/pinto_lab_to_nwb/widefield/widefieldnwbconverter.py
@weiglszonja weiglszonja marked this pull request as ready for review November 22, 2023 14:34
@CodyCBakerPhD
Copy link
Member

Does the dtype of the MotionCorrection data automatically scale? I notice because in the example file it's uint8 but the image size is 1024 x 1024 so, IDK, it might be conceptually possible for a shift factor to be larger than the 256 bound of uint8?

@weiglszonja
Copy link
Collaborator Author

Does the dtype of the MotionCorrection data automatically scale? I notice because in the example file it's uint8 but the image size is 1024 x 1024 so, IDK, it might be conceptually possible for a shift factor to be larger than the 256 bound of uint8?

It's hard to now without seeing "actual" pixel values, but I guess it could be possible. So set it to uint16?

@CodyCBakerPhD CodyCBakerPhD merged commit faa9fa7 into main Nov 27, 2023
1 check passed
@CodyCBakerPhD CodyCBakerPhD deleted the add_motion_correction branch November 27, 2023 01:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants