-
Notifications
You must be signed in to change notification settings - Fork 5
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
Example coarse alignment #63
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@McHaillet you have no idea how happy it makes me to see you playing with libtilt :-)
Let's put this in its own example coarse_alignment.py
and maybe add stretching there at a later point? If we end up pushing this further we can then put everything in its own repo and have some reference data auto-downloaded there.
I'm a bit surprised how well this performs even without the stretching perpendicular to the tilt-axis, very nice :-)
Agree that the wraparound is a problem - the patch idea was just something I was playing with and I'm not sure it's better, I thought it might lead to more robust estimates 😆
Nice idea, I'd err on the side of not overcomplicating the simple shift code and instead having a separate thing that can provide the masks if they're needed... in the motion correction code I have a soft edged circle in the center of the patch, we could also use a similar strategy here as a first step? |
Yep totally agree again - now that we have the coarse alignment we know the area common to each image for common line calculation so that's super useful :-) |
I feel you, good luck getting it all written up! :-) |
ea5a7a0
to
a78bb38
Compare
Well, thank you for putting in the effort to start an open source community cryo-em library! The code base seems really nice
I moved it to a new file! Just want to mention that in the tsa_real_data_multiregion.py, the shifts for the matrix are commented and a projection_model_optimiser.step() is missing in the optimisation loop. I can make a PR to update it if you want? |
Agreed, for now its probably fine. |
I think the most important things for this aretomo-like workflow are the following (perhaps could make issue for these)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Alister!
This is the example I added for an IMOD style coarse alignment of tilt-series. It basically sets the 0 degree tilt as a reference, and then finds neighboring tilt shifts in both the positive and negative tilting direction. The coarse shifts are then used as the initial point for optimization for refining the tilt-series alignment. However, in this example the coarse alignment now gives a much better tomogram than after optimization.
Code-wise, I now added the coarse alignment to tsa_real_data_multiregion.py, let me know if that is okay for you. Otherwise I can also move it to a separate example file. Secondly, I used a tilt-series that I had stored locally. I don't know if you have some online reference data to use for this. I can revert the IMAGE_FILE and parameters back to what it was before.
As I told you I found the idea of an automated tilt-series alignment in libtilt very interesting (but currently not much time to mess around with it due to phd thesis). I like your setup with a torch optimization on patches, although quite different from AreTomo. Some observations that I had while experimenting with the code.
IMAGE: Large y-shift loops the bottom part of the image to the top.
