mantidimaging.core.io.loader.stack_loader module¶
- mantidimaging.core.io.loader.stack_loader.do_stack_load_seq(data: ndarray, new_data: ndarray, img_shape: Tuple[int, ...], name: str, progress: Progress | None) ndarray [source]¶
Sequential version of loading the data. This performs faster locally, but parallel performs faster on SCARF
- Parameters:
data – shared array of data
new_data – the new data to be moved into the shared array
img_shape – The shape of the image
name – Name for the loading bar
- Returns:
the loaded data
- mantidimaging.core.io.loader.stack_loader.execute(load_func: Callable[[str], ndarray], file_name: str, dtype: npt.DTypeLike, name: str, indices: List[int] | Indices | None = None, progress: Progress | None = None) Images [source]¶
Load a single image FILE that is expected to be a stack of images.
Parallel execution can be slower depending on the storage system.
On HDD I’ve found it’s about 50% SLOWER, thus not recommended!
- Parameters:
file_name – list of image file paths given as strings
load_func – file name extension if fixed (to set the expected image format)
dtype – data type for the output numpy array
- Returns:
stack of images as a 3-elements tuple: numpy array with sample images, white image, and dark image.