Skip to content

Update FrameCorrector to save XY translation#16

Draft
sumiya-kuroda wants to merge 4 commits intoapasarkar:mainfrom
sumiya-kuroda:xy_translation
Draft

Update FrameCorrector to save XY translation#16
sumiya-kuroda wants to merge 4 commits intoapasarkar:mainfrom
sumiya-kuroda:xy_translation

Conversation

@sumiya-kuroda
Copy link

Now, the FrameCorrector object also saves the amount of xy translation. It also supports the lazy_data_loader() class, and you can access the translation information by

motion_correction_dataloader = registrationarrays.RegistrationArray(registration_obj = your_frame_corrector, data_to_register = your_data)
motion_corrected_data_slice, xy_translation = motion_correction_dataloader[time_slice]

This is useful when you want to save data in NWB format with pynwb.ophys.MotionCorrection class.

@apasarkar
Copy link
Owner

Awesome @sumiya-kuroda - thanks for the contribution! It makes sense to me that frame_corrector should output the registered data + the shifts (for both piecewise rigid and rigid registration). Looks like the changes you've made do that.

However, for the RegistrationArray, it's very important that it behaves exactly like an array; i.e. my_reg_array[indices] should output an array. I've included some suggestions on what might need to be done to work around that.

@apasarkar apasarkar marked this pull request as draft April 26, 2025 16:35
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