Pre-Registration Evaluation#

Orders the given stacks by likelihood of yielding a successful alignment when using phase-cross-correlation to align by translation

../../_images/2D_preeval.png

Parameters#

image_stacks

Image stacks as a dictionary of numpy arrays or list of HDF5 dataset URI’s

reference_stack

Most relevant stack name

Outputs#

image_stacks

Dictionary of image stacks (HDF5 or numpy) that require the same alignment

reference_stack

Most relevant stack name

ranked_stack_names

Stack names ordered from most to least relevant

Reg2DPreEvaluation#

Given several stacks of images requiring the same alignment, determine the stack which is most suitable to get a correct alignment.

Identifier:
ewoksndreg.tasks.reg2d_preeval.Reg2DPreEvaluation
Task type:
class
Inputs:
image_stacks* : ewoksndreg.io.input_stack.InputStacks | Dict[str, Sequence[numpy.ndarray]] | Dict[str, numpy.ndarray] | Sequence[str | silx.io.url.DataUrl] | Dict[str, str | silx.io.url.DataUrl]

Image stacks as a dictionary of numpy arrays or list of HDF5 dataset URI’s.

Examples:
  • {'stack1': '/path/to/file.h5::/entry/process/results/parameters/Ca-K', 'stack2': '/path/to/file.h5::/entry/process/results/parameters/Fe-K'}
  • {'stack1': [[0, 0, 0], [1, 1, 1], [2, 2, 2]]}
reference_stack : str | None= None

Force select stack.

Examples:
  • 'stack1'
  • 'stack2'
output_configuration : Dict[str, Any] | None= None

Registration configuration parameters to be saved.

Examples:
  • {'param1': 0, 'param2': 1}
skip : bool= False

Do not rank the stacks.

Outputs:
image_stacks : ewoksndreg.io.input_stack.InputStacks | Dict[str, Sequence[numpy.ndarray]] | Dict[str, numpy.ndarray] | Sequence[str | silx.io.url.DataUrl] | Dict[str, str | silx.io.url.DataUrl]

Dictionary of image stacks in memory or URIs.

reference_stack : str | None

Transformations of all stacks is based on the image registration of this stack.

Examples:
  • 'stack1'
  • 'stack2'
ranked_stack_names : List[str] | None

image_stacks keys ordered from best to worst.

output_configuration : Dict[str, Any] | None

Registration configuration parameters to be saved.

Examples:
  • {'param1': 0, 'param2': 1}

Notes#

This ranking is only relevant for images requiring translations and does not have meaningful output in other cases.

The ranking is based on the phase-cross-correlation algorithm. The cross-correlogram between the first and every other image is calculated, which has a peak corresponding to the shift between the images. By taking the ratio of the peak value and the mean, we can examine how sure this method would be and how much the two images correspond to a pure translation