rexlib 0.1.0
Device-agnostic array computing library for CryoEM and CryoET image processing, with a pluggable backend architecture
Loading...
Searching...
No Matches
Public Member Functions | List of all members
rexlib::em::insert_slices_operation Class Referencefinal

Insert the spectra of projections into the spectrum of a volume. More...

#include <rexlib/em/ops/reconstruction/insert_slices_operation.hpp>

Inheritance diagram for rexlib::em::insert_slices_operation:
rexlib::trivial_operation< insert_slices_operation, insert_slices_operation_traits > rexlib::basic_operation< Derived, Traits > rexlib::operation

Public Member Functions

 insert_slices_operation (const gridding_window &window) noexcept
 Construct an insertion with a gridding window.
 
const gridding_window & get_window () const noexcept
 Get the gridding window.
 
- Public Member Functions inherited from rexlib::trivial_operation< insert_slices_operation, insert_slices_operation_traits >
const operation_signature & get_signature () const noexcept override
 Get the signature deciding the shape and data type of the operands of this operation.
 
- Public Member Functions inherited from rexlib::basic_operation< Derived, Traits >
const operation_descriptor & get_descriptor () const noexcept override
 Get the description of this operation.
 
operation_id get_id () const noexcept override
 Get the identifier of Derived.
 
- Public Member Functions inherited from rexlib::operation
 operation (const operation &other)=delete
 
 operation (operation &&other)=delete
 
operation & operator= (const operation &other)=delete
 
operation & operator= (operation &&other)=delete
 

Additional Inherited Members

- Public Types inherited from rexlib::basic_operation< Derived, Traits >
using traits_type = Traits
 
using shape_rule_type = typename Traits::shape_rule_type
 
using type_rule_type = typename Traits::type_rule_type
 
- Static Public Member Functions inherited from rexlib::basic_operation< Derived, Traits >
static const operation_descriptor & get_static_descriptor () noexcept
 Get the description shared by every instance.
 
- Static Public Attributes inherited from rexlib::basic_operation< Derived, Traits >
static REXLIB_CONST_CONSTEXPR std::size_t output_operand_count
 
static REXLIB_CONST_CONSTEXPR std::size_t input_operand_count
 

Detailed Description

Insert the spectra of projections into the spectrum of a volume.

Each slice is the half spectrum of a projection of a volume. By the central slice theorem, it is a central plane of the spectrum of the volume. The operation adds the slices to a numerator and their weights to a denominator. The numerator divided by the denominator estimates the half spectrum of the volume.

Operands
  • numerator and denominator: the accumulators, complex and real. They are half spectra of a cubic volume, with the core axes (N, N, N / 2 + 1).
  • slice: half spectra of square images, with the core axes (n, n / 2 + 1), as rfft2 returns them.
  • transform: 3x4 matrices [A | t], one per slice.
  • radial_weight: a weight per frequency shell, with the core axis (n / 2 + 1).

The outputs are the accumulators plus the insertions. Passing the accumulators as the outputs updates them in place. Any other overlap between an output and an input gives unspecified values.

Batches
The batch axes of all inputs broadcast together. The broadcast batch axes that an accumulator lacks, or holds with an extent of 1, are summed. For example, accumulators of batch (K, 1) and transforms of batch (K, B) insert B slices into each of K volumes.
Coordinates
The x axis is the last axis, y the one before it and z the one before that. The origin of an image or a volume of extent m lies at the index m / 2, rounded down, along each axis.
Geometry
The transform maps the point p = (x, y, z) of the volume, in voxels from its origin, to the point A p + t. Its first two coordinates are the (x, y) of the image, in pixels from its origin. The image is the projection of the volume along the third coordinate. Only the first two rows of the transform are read, and A need not be orthonormal.
Frequencies
A frequency is a signed index: numpy.fft.fftfreq times the extent along the y and z axes, and numpy.fft.rfftfreq times the extent along the x axis. The frequency k = (k_x, k_y) of a slice lands on the frequency K = (N / n) transpose(A2) k of the volume, where A2 holds the first two rows of A. An N larger than n therefore pads the volume.
Phases
The element X(k) of a slice enters as v = X(k) exp(2 pi i k . (c + t2) / n), where c = (n / 2, n / 2) rounded down and t2 holds the first two elements of t. A contribution to the voxel g is multiplied by exp(-2 pi i g . C / N), where C = (N / 2, N / 2, N / 2) rounded down. So the slices are the plain spectra of the images, and the inverse transform of the quotient is a volume with its origin at C.
Inserted frequencies
Every frequency of the full spectrum of a slice is inserted once. An element with k_x > 0 also stands for -k, which carries the conjugate of v. A frequency is not inserted when:
  • its shell, |k| rounded to the nearest integer with halves up, exceeds n / 2 rounded down;
  • n is even and its x or y frequency is n / 2 or -n / 2;
  • the radial weight of its shell is 0.
Accumulation
The value at K is spread over the voxels g with the weight kappa(g - K) of the gridding window. With r the radial weight of the shell of k:
  • numerator[g] += kappa(g - K) r v exp(-2 pi i g . C / N)
  • denominator[g] += kappa(g - K) r

The voxels g span the full spectrum of the volume. A contribution to a voxel with g_x < 0 goes, conjugated, to -g. A voxel beyond N / 2 in magnitude along any axis receives nothing. Along y and z of an even N, the frequencies N / 2 and -N / 2 are the same element. The order of the sums is unspecified.

See also
gridding_window

Constructor & Destructor Documentation

◆ insert_slices_operation()

rexlib::em::insert_slices_operation::insert_slices_operation ( const gridding_window &  window)
explicitnoexcept

Construct an insertion with a gridding window.

Parameters
windowThe window that spreads a sample over the voxels.

Member Function Documentation

◆ get_window()

const gridding_window & rexlib::em::insert_slices_operation::get_window ( ) const
noexcept

Get the gridding window.

Returns
const gridding_window& The window.

The documentation for this class was generated from the following file: