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: ndarray
class mantidimaging.core.utility.data_containers.Degrees(value: float)[source]

Bases: SingleValue

value: float
class mantidimaging.core.utility.data_containers.ImageParameters(input_path: str, format: str, prefix: str, indices: mantidimaging.core.utility.data_containers.Indices | None = None, log_file: str | None = None)[source]

Bases: object

format: str
indices: Indices | None = None
input_path: str
log_file: str | None = None
prefix: str
class mantidimaging.core.utility.data_containers.Indices(start, end, step)

Bases: tuple

end

Alias for field number 1

start

Alias for field number 0

step

Alias for field number 2

class mantidimaging.core.utility.data_containers.LoadingParameters[source]

Bases: object

dark_after: ImageParameters | None = None
dark_before: ImageParameters | None = None
dtype: str
flat_after: ImageParameters | None = None
flat_before: ImageParameters | None = None
name: str
pixel_size: int
proj_180deg: ImageParameters | None = None
sample: ImageParameters
sinograms: bool
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: ndarray
class mantidimaging.core.utility.data_containers.ReconstructionParameters(algorithm: str, filter_name: str, num_iter: int = 1, cor: mantidimaging.core.utility.data_containers.ScalarCoR | None = None, tilt: mantidimaging.core.utility.data_containers.Degrees | None = None, pixel_size: float = 0.0, alpha: float = 0.0, max_projection_angle: float = 360.0, beam_hardening_coefs: List[float] | None = None)[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
num_iter: int = 1
pixel_size: float = 0.0
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: float)[source]

Bases: object

value: float
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