tomodrgn.commands.subtomo2chimerax.generate_color_per_particle#
- generate_color_per_particle(ptcl_star: GenericStarfile, ptcl_block_name: str, labels_path: str | None = None, colormap: str | None = None)[source]#
Calculate an RGBA color for each particle’s unique label and store both labels and RGBA tuples in the particles star dataframe.
- Parameters:
ptcl_star – volume-series star file (each row refers to a unique particle)
ptcl_block_name – name of the star file data block containing per-particle data (e.g. data_particles)
labels_path – path to array of coloring labels from which to derive each particle’s color, shape (nptcls, 1)
colormap – matplotlib colormap to translate labels to RGBA tuples. If None, uses ChimeraX color palette (repeated as necessary)
- Returns:
None