mantidimaging.core.io.loader.loader module#

class mantidimaging.core.io.loader.loader.ImageParameters(file_group: FilenameGroup, log_file: Path | None = None, indices: Indices | None = None)[source]#

Bases: object

Dataclass to hold info about an image stack that is to be loaded. Used with LoadingParameters

file_group: FilenameGroup#
indices: Indices | None = None#
log_file: Path | None = None#
class mantidimaging.core.io.loader.loader.LoadingParameters(image_stacks: dict[~mantidimaging.core.utility.data_containers.FILE_TYPES, ~mantidimaging.core.io.loader.loader.ImageParameters] = <factory>, pixel_size: int = 0, name: str = '', dtype: str = 'float32', sinograms: bool = False)[source]#

Bases: object

Dataclass to hold info about a dataset that is about to be loaded. Used to transfer information from ImageLoadDialog to the loading code.

dtype: str = 'float32'#
image_stacks: dict[FILE_TYPES, ImageParameters]#
name: str = ''#
pixel_size: int = 0#
sinograms: bool = False#
mantidimaging.core.io.loader.loader.create_loading_parameters_for_file_path(file_path: Path) LoadingParameters | None[source]#
mantidimaging.core.io.loader.loader.get_loader(in_format: str) Callable[[Path | str], ndarray][source]#
mantidimaging.core.io.loader.loader.load(filename_group: FilenameGroup, dtype: npt.DTypeLike = <class 'numpy.float32'>, indices: list[int] | Indices | None = None, progress: Progress | None = None, log_file: Path | None = None) ImageStack[source]#

Loads a stack, including sample, white and dark images.

Parameters:
  • dtype – Default:np.float32, data type for the input images

  • filename_group – FilenameGroup to provided file names for loading

  • indices – Specify which indices are loaded from the found files. This DOES NOT check for the number in the image filename, but removes all indices from the filenames list that are not selected

  • progress – The progress reporting instance

Returns:

an ImageStack

mantidimaging.core.io.loader.loader.load_log(log_file: Path) InstrumentLog[source]#
mantidimaging.core.io.loader.loader.load_stack_from_group(group: FilenameGroup, progress: Progress | None = None) ImageStack[source]#
mantidimaging.core.io.loader.loader.load_stack_from_image_params(image_params: ImageParameters, progress: Progress | None = None, dtype: npt.DTypeLike = <class 'numpy.float32'>)[source]#
mantidimaging.core.io.loader.loader.read_image_dimensions(file_path: Path) tuple[int, int][source]#