delta.utilities.singlecell_features¶
- delta.utilities.singlecell_features(contour: ndarray, mask: ndarray[Any, dtype[uint8]], features: Tuple[str, ...] = ('length', 'width', 'area', 'perimeter', 'edges'), fluo_frames: Optional[ndarray] = None, roi_box: Optional[CroppingBox] = None) Dict[str, Any]¶
Extract features for a single cell
- Parameters
- contourlist
Single cell contour from cv2 findcontours.
- mask2D numpy array of bool
Mask of the region to extract (typically a single cell).
- featureslist of str, optional
Features to extract. Valid features are ‘length’,’width’,’area’, ‘perimeter’,’edges’,’fluo1’,’fluo2’,…,’fluoN’. The default is (‘length’,’width’,’area’,’perimeter’,’edges’).
- fluo_frames3D array, optional
Fluorescent images to extract fluo from. Dimensions are (channels, size_y, size_x). The default is None.
- roi_boxdict, optional
Cropping box dictionary (see cropbox())to apply shift when looking at full-frame fluo images. The default is None.
- Returns
- features_dictdict
Dictionary of requested features.
- Raises
- ValueError
If the number of fluo frames provided is different from the number of fluo features to extract.