Skip to content

Conversation

@garrettwrong
Copy link
Collaborator

  • Refactors Align2D towards subclassing. One branch going off the base class and returning some latent images (say for EM methods) and others which will do basic image stacking via subclassing AveragedAlign2D.
  • Adds an adoption of ReddyChatterji (log polar fourier cross corr method for image registration), primarily based from scikit image examples. After estimated rotation registration attemps second round of cross corr to estimate translation.
  • Adds BFSReddyChatterji. Brute Force Shifts, performing RC based cross corr technique to rotation estimation after shifting. Returns best shift composed with rotation over all shifts in a radius.

@garrettwrong garrettwrong added enhancement New feature or request cleanup labels Jan 11, 2022
@garrettwrong garrettwrong self-assigned this Jan 11, 2022
@codecov
Copy link

codecov bot commented Jan 11, 2022

Codecov Report

Merging #538 (d51b0ec) into develop (5e2d49a) will decrease coverage by 0.33%.
The diff coverage is 74.37%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #538      +/-   ##
===========================================
- Coverage    87.20%   86.86%   -0.34%     
===========================================
  Files          108      108              
  Lines         8000     8586     +586     
===========================================
+ Hits          6976     7458     +482     
- Misses        1024     1128     +104     
Impacted Files Coverage Δ
src/aspire/denoising/denoiser_cov2d.py 80.00% <66.66%> (-0.77%) ⬇️
src/aspire/classification/averager2d.py 72.82% <72.82%> (ø)
src/aspire/basis/basis.py 87.83% <80.00%> (-0.74%) ⬇️
src/aspire/classification/rir_class2d.py 95.48% <92.85%> (+1.84%) ⬆️
src/aspire/classification/__init__.py 100.00% <100.00%> (ø)
src/aspire/classification/class2d.py 94.73% <100.00%> (-5.27%) ⬇️
src/aspire/covariance/covar.py 88.79% <100.00%> (ø)
src/aspire/covariance/covar2d.py 94.21% <100.00%> (ø)
src/aspire/denoising/__init__.py 100.00% <100.00%> (ø)
src/aspire/denoising/denoised_src.py 95.83% <100.00%> (+0.18%) ⬆️
... and 6 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5e2d49a...d51b0ec. Read the comment docs.

@garrettwrong garrettwrong force-pushed the cls_avg_align_refactor_Reddy branch from 6c65173 to 2cffd1a Compare February 7, 2022 16:11
@garrettwrong garrettwrong force-pushed the cls_avg_align_refactor_Reddy branch from d7eb7f5 to 2b2ea9d Compare February 7, 2022 20:51
@garrettwrong garrettwrong force-pushed the cls_avg_align_refactor_Reddy branch from 2b2ea9d to d7df6e3 Compare February 7, 2022 20:53
@garrettwrong
Copy link
Collaborator Author

Todays commits meld the simulated experimental pipeline and associated minor patches into this PR. It alters the sphinx gallery config to only run the tutorials, but parse the experiments. I also extend the RIR and aligner to admit CWF denoised source for just the classification. Switching do_cov2d in that pipeline example will now create that additional source while using the original source for alignment and averaging. This also fixes a cov3d bug I introduced in the grid updates and works around couple dtype bugs.

I'll try to go through it on another day to look for any typos I missed so far.

@garrettwrong
Copy link
Collaborator Author

Made some style and name changes to the example. Adds an experimental data pipeline and it even runs. Ran (on my laptop) for a small pipeline similar in size to the simulation example... but the reconstruction left a lot to be desired. I'll run it again in a more serious size while the code gets a once over.

@garrettwrong garrettwrong marked this pull request as ready for review February 8, 2022 22:41
@garrettwrong garrettwrong requested a review from janden as a code owner February 8, 2022 22:41
Copy link
Collaborator

@janden janden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First pass. Overall, I think this looks good. Big question here is about the class hierarchy.

I haven't gone into implementation details and tests yet. We'll get to that later.

@garrettwrong garrettwrong force-pushed the cls_avg_align_refactor_Reddy branch from 5792514 to 478dff4 Compare February 15, 2022 19:24
@garrettwrong garrettwrong requested a review from janden February 17, 2022 13:34
Copy link
Collaborator

@janden janden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Just some small comments, then we should be good to go.

estimator = MeanEstimator(avgs, basis)

# Perform the estimation and save the volume.
estimated_volume = estimator.estimate()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be able to compute an RMSE with the ground truth volume by rotating estimated_volume by Q_mat (Q_mat.T?) and comparing them. Or you might not. It's worth a shot. Otherwise, just leave it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can try it. I'll come back to this after the other items. I didn't have any idea that Q_mat would realize the right rotations for that... I'm not sure the project is there yet (good rmse), lots of things to check, but I was reasonably happy to get things like the attached at this stage of the project. First is the original hi res map from EMD 10028, and second is the simulated abinitio model, both as viewed in chimera.

Screen Shot 2022-02-18 at 7 04 18 AM

Screen Shot 2022-02-18 at 7 09 49 AM

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW that sim was gallery/experiments/simulated_abinitio_pipeline.py, if you'd like to run it too. Just requires downloading the map file and putting in the directory.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That doesn't look too bad, actually…

So the idea is that Q_mat tells us how the estimated rotations differ from the ground truth rotations (in other words, what rotation needs to be applied to transform one rotation sequence to the other). Thing that might be tricky is that it may include a possible reflection as well. It's definitely a “nice to have” and not a requirement. If it takes more than fifteen minutes, make an issue and we'll come back to it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I was quite pleased with it for the maturity of the project and sort of rushing this last feature given the other situations. Lot of code refinement todo, but I think this should get the project down the road quite a ways.

I'll load the saved volume and give it a try.

@garrettwrong
Copy link
Collaborator Author

Just waiting for the local docs and tests to run. I will push it for another round. While that is happening I will i) kick off similated_abinitio_pipeline.py to check it still works, ii) try this Q_mat thing.

@garrettwrong garrettwrong requested a review from janden February 18, 2022 14:52
janden
janden previously approved these changes Feb 18, 2022
@garrettwrong
Copy link
Collaborator Author

Looks like some of the other changes that went in recently have changed the noise level we can preprocess away, so I'll need to update that. (One param line change in simulated experiment, I just need to try a few to see one that is good example).

@garrettwrong
Copy link
Collaborator Author

Simulated abinitio reconstruction looks similar now with the noise var adjustment. Not quite as good as before, but the whitening was working too well before :). Merging.

@garrettwrong garrettwrong merged commit 11c3dca into develop Feb 18, 2022
@garrettwrong garrettwrong deleted the cls_avg_align_refactor_Reddy branch February 18, 2022 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cleanup enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants