get_label_files#
- cellpose_omni.io.get_label_files(img_names, label_filter='_cp_masks', img_filter='', ext=None, dir_above=False, subfolder='', parent=None, flows=False, links=False)[source]#
Get the corresponding labels and flows for the given file images. If no extension is given, looks for TIF, TIFF, and PNG. If multiple are found, the first in the list is returned. If extension is given, no checks for file existence are made - useful for finding nonstandard output like txt or npy.
- Parameters
img_names (list, str) -- list of full image file paths
label_filter (str) -- the label filter sufix, defaults to _cp_masks can be _flows, _ncolor, etc.
ext (str) -- the label extension can be .tif, .png, .txt, etc.
img_filter (str) -- the image filter suffix, e.g. _img
dir_above (bool) -- whether or not masks are stored in the image parent folder
subfolder (str) -- the name of the subfolder where the labels are stored
parent (str) -- parent folder or list of folders where masks are stored, if different from images
flows (Bool) -- whether or not to search for and return stored flows
links (bool) -- whether or not to search for and return stored link files
- Return type
list of all absolute label paths (str)