mantidimaging.core.io.loader.stack_loader module¶
- mantidimaging.core.io.loader.stack_loader.do_stack_load_seq(data: numpy.ndarray, new_data: numpy.ndarray, img_shape: Tuple[int, ...], name: str, progress: Optional[mantidimaging.core.utility.progress_reporting.progress.Progress]) numpy.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], numpy.ndarray], file_name: str, dtype: npt.DTypeLike, name: str, indices: Optional[Union[List[int], mantidimaging.core.utility.data_containers.Indices]] = None, progress: Optional[mantidimaging.core.utility.progress_reporting.progress.Progress] = None) mantidimaging.core.data.images.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.