scallops.io.to_label_crops
- scallops.io.to_label_crops(intensity_image, label_image, objects_df, output_dir, crop_size=(224, 224), output_format='tiff', centroid_cols=None, gaussian_sigma=None)
Export individual label crops as tiff or npy files.
- Parameters:
intensity_image (Array | Array) – Image data
label_image (Array | Array | None) – Label data. If supplied, image is masked by corresponding segmentation mask
objects_df (DataFrame) – DataFrame containing objects from find-objects.
crop_size (tuple[int, int]) – Size of label crop
output_dir (str) – Crop output directory
output_format (Literal['tiff', 'npy']) – Crop output format
centroid_cols (Sequence[str] | None) – Columns in objects_df containing y and x centroids.
gaussian_sigma (float | None) – If not None, apply gaussian-smoothed mask to isolate target mask
- Returns:
Objects dataframe (with objects at well edges removed)
- Return type:
DataFrame