Tomographic Slices

Generate slices from 3D intensity distributions for given orientations.

Module containing class to generate tomographic slices.

class dragonfly.utils.py_src.slices.SliceGenerator(config_fname)[source]

Bases: object

Class to generate slices from 3D intensity distribution for given orientation.

Requires config file from an EMC reconstruction.

Note

This produces the tomogram for the most likely orientation only.

Parameters:

config_fname (str) – Path to configuration file.

Example

>>> gen = SliceGenerator('config.ini')
>>> tomo, info = gen.get_slice(10, 5)
get_slice(iteration, num, raw=False, **kwargs)[source]

Get tomographic slice for given iteration and frame number.

Parameters:
  • iteration (int) – Reconstruction iteration number.

  • num (int) – Frame number.

  • raw (bool) – Whether to return unassembled slice. Defaults to False.

  • **kwargs – Additional arguments passed to assemble_frame.

Returns:

(numpy.ndarray, float) - assembled detector

slice and mutual information, or (raw slice, mutual information) if raw=True.

Return type:

tuple

get_quat(iteration, num)[source]

Return best match quaternion for given iteration and frame number.

Parameters:
  • iteration (int) – Reconstruction iteration number.

  • num (int) – Frame number.

Returns:

Quaternion as 5 floats.

Return type:

tuple

Example

from dragonfly.utils.py_src.slices import SliceGenerator

gen = SliceGenerator('config.ini')
tomo, info = gen.get_slice(10, 5)