Python Implementation of Alignment methods for nanotomography with deep subpixel accuracy
A python implemenation of the projection matching method (PMA) developed by the Paul Scherrer Institute (PSI). When I created this repository, there was no python implementation available, which limited the capability of aligning large datasets with supercomupting resources. Although there is an official Matlab implementation, this is an available Python package that is a useful platform to test and develop more advanced alignment algorithms.
To build the alignment package, first build the tomo_TV reconstruction package. Once the reconstruction package is available, we can build tomoalign with pip install:
git clone https://github.com/jtschwar/projection_refinement.git
cd projection_refinement
pip install -e . To run the alignment script, we simply need to provide the the tilt series and tilt angles from the experiment.
from tomoalign.aligner import AlignmentWorkflow
from tomoalign import load_demo
# Initialize the Alignment Class
(tiltSeries, tiltAngles) = load_demo()
aligner = AlignmentWorkflow(tiltSeries, tiltAngles)
# We can play with different reconstruction algorithms
# (1) aligner.params['alg'] = 'sart'; aligner.params['initAlg'] = 'sequential'
# (2) aligner.params['alg'] = 'sirt'; aligner.params['initAlg'] = None
# (3) aligner.params['alg'] = 'wbp'; aligner.params['initAlg'] = 'ram-lak'
# Results is a dictionary with the aligned sinogram, measured shifts, and parameters metadata.
aligner.run(binning_factors=[4,2,1])
# Apply the measured shifts to secondary datasets
eels_data = {'Ca': ca_tilt_series, 'Ni': ni_tilt_series, 'C': c_tilt_series}
aligned_eels = aligner.apply_alignments(eels_data, eels_angles)
# Save the Results to the given h5 file name.
aligner.save('aligned.h5')If you use tomoalign for your research, we would appreciate it if you cite to the following papers:
- Alignment methods for nanotomography with deep subpixel accuracy
- Real-time 3D analysis during electron tomography using tomviz
- Imaging 3D Chemistry at 1 nm resolution with fused multi-modal electron tomography
email: [email protected] website: https://jtschwar.github.io