Skip to content

Add a standalone for motion correction

Context

Asked initially by ID19.

Goal

The goal if this widget is to determine the movement of the sample within time.

Movements can happen from motor positions, gravity... In this case we only consider rigid movements. Not non-rigid. We have one scalar value per projection.

A description of the motion correction in nabu can be found here

Projections are paired together. For each pair we can determine a relative movement.

As we have several parameters to determine we need to have n pairs to do the fit.

GUI

This first fit can produce a curve. One value per rotation and the display of the curve.

This will produce fits for x, y and z. This shift can be presented either from the sample point of view (x, y, z) or from the detector point of view (u, v). Nabu include a function to convert from one space to the other.

Users want to have the information relative to the detector space. In nabu.estimation.motion.MotionEstimation. This is also the class doing the processing.

There is already some plot mechanism using matplotlib.

Today this calculation are done nabu-estimate-motion

The GUI should allow to set:

  • basic options
    • deg_xy
    • deg_z
    • model (poly)
  • advanced options

Once the fit is done we display:

  • measured phase correlation vs fit (should display n_proj / 2): two curves. Most important.
  • movement vs projection angle either (single curve):
    • using sample space: x, y, z
    • using detector space: u, v (default one)

Editing points

The issue with the fitting is usually that some points can be 'False' / misleading. This is why we would like to have an interactive mode (or edit mode) to select / remove some points from the fit. Nabu class can be updated to improve communication.

Finding the shift manually

In some cases the correlation between a pair of image must be done from eye / manually. A dedicated interface must be given to the user to allow defining the u, v shift. It could reuse the 'tomwer cor shift widget'. Some proposal could be given here to improve this part.

Edited by payno
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information