segment_cells_2d
Segment cells in 2D microscopy images with adjustable parameters for model type, diameter, and thresholds. Provide an image path to get cell counts and mask output.
Instructions
Segment cells in a 2D microscopy image using Cellpose.
Args: image_path: Path to input image file (TIFF, PNG, etc.) model_type: Cellpose model type (cyto, cyto2, cyto3, nuclei, etc.) diameter: Expected cell diameter in pixels (0 = model default) channels: Channel specification [cyto, nuclei] or None for grayscale flow_threshold: Flow error threshold (lower = more masks, may be worse quality) cellprob_threshold: Cell probability threshold (higher = fewer masks) min_size: Minimum cell size in pixels gpu: Whether to use GPU acceleration augment: Use test-time augmentation (flip/rotate) normalize: Normalize image intensities invert: Invert image intensities (for bright background) output_path: Optional path to save masks (default: image_path with _masks suffix)
Returns
Dictionary with segmentation results including cells_detected, output_path, diameter, mask_shapeInput Schema
| Name | Required | Description | Default |
|---|---|---|---|
| gpu | No | ||
| invert | No | ||
| augment | No | ||
| channels | No | ||
| diameter | No | ||
| min_size | No | ||
| normalize | No | ||
| image_path | Yes | ||
| model_type | No | cyto3 | |
| output_path | No | ||
| flow_threshold | No | ||
| cellprob_threshold | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||