Skip to content

Add automatic laminography alignment tool#2259

Merged
hrobarts merged 21 commits intomasterfrom
laminography_alignment
Mar 11, 2026
Merged

Add automatic laminography alignment tool#2259
hrobarts merged 21 commits intomasterfrom
laminography_alignment

Conversation

@hrobarts
Copy link
Contributor

@hrobarts hrobarts commented Jan 23, 2026

Changes

Add automatic laminography alignment tool.
Projection matching method to optimise laminography reconstruction by searching tilt and centre of rotation offset

  • Bins projection data with coarse_binning and final_binning
  • Reduces angles to Nyquist or angle_binning
  • Searches a range of tilt and CoR defined by parameter_bounds starting with an initial guess initial_parameters.
  • Reconstructs at each geometry guess, either reconstructs a full volume or a user defined reduced_volume
  • Forward projects and compares to measured projections. Residual is real minus reprojected data, loss is high pass and Sobel filtered
  • Minimises for tilt and CoR using the Powell method

Testing you performed

New demo script: TomographicImaging/CIL-Demos#280
Test data for this tool is available on the tomography shared drive /mnt/share/ALC_laminography/folder/

Related issues/links

Checklist

  • I have performed a self-review of my code
  • I have added docstrings in line with the guidance in the developer guide
  • I have updated the relevant documentation
  • I have implemented unit tests that cover any new or modified functionality
  • CHANGELOG.md has been updated with any functionality change
  • Request review from all relevant developers

@github-project-automation github-project-automation bot moved this to Todo in UM 2026 Jan 29, 2026
@casperdcl casperdcl moved this from Todo to In Progress in UM 2026 Jan 29, 2026
@hrobarts hrobarts requested a review from gfardell February 2, 2026 13:52
@hrobarts hrobarts self-assigned this Feb 2, 2026
@hrobarts hrobarts linked an issue Feb 10, 2026 that may be closed by this pull request
Copy link
Contributor Author

@hrobarts hrobarts left a comment

Choose a reason for hiding this comment

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

Comments from code review meeting

@hrobarts
Copy link
Contributor Author

@gfardell I think I've addressed all the comments from the code review meeting and also added a test with the simulated data

Copy link
Member

@gfardell gfardell left a comment

Choose a reason for hiding this comment

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

This will be a great tool.

My major comments are:

  • Backend selection and compatibility

    • Consistency with FDK and CoR would be to accept a backend parameter
    • I know it's only astra for now but could it be written in a way that would extend it to tigre for free once #2238 is in?
    • A concern is that as ASTRA is GPL2, so we keep it as an optional import at runtime so the user is in control. This means code shouldn't silently depend on astra and it should be a user choice.
  • Documentation and doc strings

    • Add a section in the documentation explaining the geometry and tested cases. Not everyone will have the same definition of the angle as "tilt" for example.
    • Internal methods should start with _ and need docstrings and clear parameter names.
  • Memory use

    • We need to think about reducing and reusing buffers where we can, both in terms of peak RAM and not reallocating memory each iteration where we could reuse it.
    • For the acquisition and image data especially we need to be clear how many copies are used, this could be part of the documentation.
    • We need to balance the cost of storing results with recomputing i.e. when we filter, or for the reference volume.

Overall it looks solid and well structured. Let me know when you need me to look again/talk it through.

I have not looked at tests yet.

Copy link
Member

@lauramurgatroyd lauramurgatroyd left a comment

Choose a reason for hiding this comment

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

Hi @hrobarts, this is an awesome addition to CIL, I just suggested some changes to prints and docs really and messed around inputting some silly parameters!

hrobarts and others added 2 commits March 9, 2026 10:25
Co-authored-by: Laura Murgatroyd <60604372+lauramurgatroyd@users.noreply.github.com>
Signed-off-by: Hannah Robarts <77114597+hrobarts@users.noreply.github.com>
@gfardell gfardell self-requested a review March 10, 2026 16:56
Copy link
Member

@gfardell gfardell left a comment

Choose a reason for hiding this comment

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

This looks great! Thanks for getting it in.

hrobarts and others added 2 commits March 11, 2026 08:35
Co-authored-by: Hannah Robarts <77114597+hrobarts@users.noreply.github.com>
Signed-off-by: Hannah Robarts <77114597+hrobarts@users.noreply.github.com>
@hrobarts hrobarts merged commit 090bb98 into master Mar 11, 2026
11 checks passed
@hrobarts hrobarts deleted the laminography_alignment branch March 11, 2026 16:14
@github-project-automation github-project-automation bot moved this from In Progress to Done in UM 2026 Mar 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Automatic laminography alignment algorithm

3 participants