Manager¶
- class cellector.manager.CellectorManager(root_dir: Path | str, exclude_features: List[str] | None = None, num_rois: int | None = None)[source]¶
Bases:
object- classmethod make_from_roi_processor(roi_processor: RoiProcessor, exclude_features: List[str] | None = None) CellectorManager[source]¶
Create a CellectorManager from an existing RoiProcessor.
CellectorManager is usually initialized from disk, but this method allows the user to create a new manager from an existing RoiProcessor object, which will include any features / criteria that are stored on disk and add any features that are in the RoiProcessor but not on disk yet. This is useful when pipelining the and using the CellectorManager class to store the results of processing a session
- Parameters:
roi_processor (RoiProcessor) – RoiProcessor object to include features from and define the root directory.
exclude_features (Optional[List[str]]) – List of feature names to exclude from selection criteria
- Returns:
Manager object with features and criteria from the RoiProcessor object.
- Return type:
- add_feature(feature_name, feature_values)[source]¶
Add a new feature to the manager.
- Parameters:
feature_name (str) – Name of the feature to add.
feature_values (np.ndarray) – Array of shape (num_rois,) with the feature values.
- compute_idx_meets_criteria()[source]¶
Compute the index of cells meeting the criteria defined by the features.
- update_criteria(feature: str, criterion: List | ndarray)[source]¶
Update the criteria for a particular feature.
- Parameters:
feature (str) – Feature name.
criterion (np.ndarray) – Array of shape (2,) with the minimum and maximum criteria or None for no criteria.