mantidimaging.core.utility.data_containers module#

Containers for data. They don’t do much apart from storing the data, and optionally provide helpful operations.

The biggest benefit is explicitly marking what the value represents (e.g. Degrees), and helps the type hints to tell you that you might be passing the wrong value (e.g. ScalarCoR to a VectorCoR), while they’re both Float underneath and the value can be used, it just will produce nonsense.

class mantidimaging.core.utility.data_containers.Counts(value: 'numpy.ndarray')[source]#

Bases: SingleValue

value: numpy.ndarray#
class mantidimaging.core.utility.data_containers.Degrees(value: 'float')[source]#

Bases: SingleValue

value: float#
class mantidimaging.core.utility.data_containers.FILE_TYPES(value)[source]#

Bases: Enum

An enumeration.

DARK_AFTER = ('Dark', 'After', 'images')#
DARK_BEFORE = ('Dark', 'Before', 'images')#
FLAT_AFTER = ('Flat', 'After', 'images')#
FLAT_AFTER_LOG = ('Flat After Log', '', 'log')#
FLAT_BEFORE = ('Flat', 'Before', 'images')#
FLAT_BEFORE_LOG = ('Flat Before Log', '', 'log')#
PROJ_180 = ('180 degree', '', '180')#
SAMPLE = ('Sample', '', 'sample')#
SAMPLE_LOG = ('Sample Log', '', 'log')#
property fname: str#
class mantidimaging.core.utility.data_containers.Indices(start, end, step)#

Bases: tuple

end: int#

Alias for field number 1

start: int#

Alias for field number 0

step: int#

Alias for field number 2

class mantidimaging.core.utility.data_containers.Micron(value: 'int')[source]#

Bases: SingleValue

value: int#
class mantidimaging.core.utility.data_containers.ProjectionAngles(value: 'numpy.ndarray')[source]#

Bases: SingleValue

value: numpy.ndarray#
class mantidimaging.core.utility.data_containers.ReconstructionParameters(algorithm: 'str', filter_name: 'str', num_iter: 'int' = 1, cor: 'ScalarCoR | None' = None, tilt: 'Degrees | None' = None, pixel_size: 'float' = 0.0, alpha: 'float' = 0.0, non_negative: 'bool' = False, max_projection_angle: 'float' = 360.0, beam_hardening_coefs: 'list[float] | None' = None, stochastic: 'bool' = False, projections_per_subset: 'int' = 50, regularisation_percent: 'int' = 30)[source]#

Bases: object

algorithm: str#
alpha: float = 0.0#
beam_hardening_coefs: list[float] | None = None#
cor: ScalarCoR | None = None#
filter_name: str#
max_projection_angle: float = 360.0#
non_negative: bool = False#
num_iter: int = 1#
pixel_size: float = 0.0#
projections_per_subset: int = 50#
regularisation_percent: int = 30#
stochastic: bool = False#
tilt: Degrees | None = None#
to_dict() dict[source]#
class mantidimaging.core.utility.data_containers.ScalarCoR(value: 'float')[source]#

Bases: SingleValue

to_vec(detector_width)[source]#
value: float#
class mantidimaging.core.utility.data_containers.SingleValue(value: 'Any')[source]#

Bases: object

value: Any#
class mantidimaging.core.utility.data_containers.Slope(value: 'float')[source]#

Bases: SingleValue

value: float#
class mantidimaging.core.utility.data_containers.VectorCoR(value: 'float')[source]#

Bases: SingleValue

to_scalar(detector_width)[source]#
value: float#