jhennies / amst

Alignment to Median Smoothed Template for FIB-SEM data
GNU General Public License v3.0
8 stars 2 forks source link

Saving transformations #3

Closed rixjilli closed 2 years ago

rixjilli commented 2 years ago

Hello,

Thanks for making this code available! I'm working on aligning a set of slices, and have two stacks each taken with a different detector. One has much sharper features, so I'm running AMST on that stack and having good success. Is there a way for me to save the transformations/translations that AMST performs so I can apply them to the stack taken with the other detector?

Thanks!

jhennies commented 2 years ago

Hi!

This is currently not implemented, but it should be feasible to write out all transformations and then run the workflow on another dataset with exactly the same transformations. I can have a look at this in the coming days.

Cheers, Julian

rixjilli commented 2 years ago

Hi Julian,

That would be really helpful, thanks very much for getting back to me!

Best, Jillian

jhennies commented 2 years ago

I implemented that AMST saves all transformations when run initially. Then as a second step you can now run these transformations on a second dataset. Only requirement: both datasets need to be the same shape and pixel size.

You find it in the branch pre_align_workflow, it is not added to the master branch yet.

Now you can run the amst_align() function as before (Note: you have to compute your dataset again, the earlier version did not store the required transformations). Afterwards run the apply_amst_transformations() function for the other dataset. Make sure that the "target_folder" is the same folder for both runs (it will create subfolders for the respective results).

For a bit more information have a look at the scripts folder and, in particular, here: https://github.com/jhennies/amst/blob/pre_align_workflow/scripts/run_amst.py

and here: https://github.com/jhennies/amst/blob/pre_align_workflow/scripts/run_amst_transforms.py

Let me know if I can help you with anything or if you run into further issues!

rixjilli commented 2 years ago

Great, thanks so much! I look forward to implementing this.