tomodrgn.dataset.load_particles#
- load_particles(mrcs_txt_star: str, lazy: bool = False, datadir: str | None = None, source_software: Literal['auto', 'warp', 'cryosrpnt', 'nextpyp', 'cistem', 'warptools', 'relion'] | None = None) ndarray | list[LazyImage] | list[LazyImageStack] [source]#
Load particle stack from a .mrcs file, a .star file, or a .txt file containing paths to .mrcs files
- Parameters:
mrcs_txt_star – path to .mrcs, .star, or .txt file referencing images to load. If using a star file, should be an image-series star file (if using Warp/M or NextPYP), or an optimisation set star file (if using WarpTools or RELION v5)’).
lazy – whether to load particle images now in memory (False) or later on-the-fly (True)
datadir – relative or absolute path to overwrite path to particle image .mrcs specified in the STAR file
source_software – type of source software used to create the star file, used to indicate the appropriate star file handling class to instantiate. Default of ‘auto’ tries to infer the appropriate star file handling class based on whether
star_path
is an optimisation set star file.
- Returns:
numpy array of particle images of shape (n_images, boxsize+1, boxsize+1), or list of LazyImage or LazyImageStack objects