CellColoc Documentationο
Β
CellColoc is a Python package for interactive, segmentation-based colocalization analysis in microscopy images. It combines reusable core analysis logic with project-specific user scripts that can be executed step by step in VS Code or notebook-like environments.
CellColoc supports both neural-network segmentation with Cellpose and classical threshold-based segmentation on a per-channel basis, including ROI- wise analysis, occupancy quantification, optional third-channel logic, fast post hoc refinement, and interactive napari inspection.
Contents
- Overview
- Installation
- Usage
- Example data set
- 2D data analysis tutorial
- Dataset used in this tutorial
- How to use this tutorial
- Imports and package bootstrap
- Project settings
- Load the analysis channels
- Optional: Draw ROIs interactively in napari
- Optional: Save drawn ROIs or load an existing ROI mask
- Run the ROI-wise segmentation and colocalization analysis
- Visualize the result in napari
- Optional: Refine Cellpose thresholds and inspect the updated result
- Optional: Reanalyze manually edited label layers from napari
- Export results
- Adapting this tutorial to your own data
- Understanding exported results
- 3D data analysis tutorial
- Dataset used in this tutorial
- How to use this tutorial
- Imports and package bootstrap
- Project settings
- Load the analysis channels
- Optional: Draw ROIs interactively in napari
- Optional: Save drawn ROIs or load an existing ROI mask
- Run the ROI-wise segmentation and colocalization analysis
- Visualize the result in napari
- Optionally set or update a global z-crop for subsequent refinement
- Optionally refine results and visualize the updated result
- Optionally reanalyze manually edited label layers from napari
- Export results
- Adapting this tutorial to your own data
- Three-channel analysis tutorial
- Dataset used in this tutorial
- How to use this tutorial
- Imports
- Project settings
- Load the analysis channels
- Optional ROI drawing and ROI reuse
- Run the ROI-wise three-channel segmentation and colocalization analysis
- Visualize the base result in napari
- Optional global z-crop for refinement
- Optionally refine all three channels and visualize the updated result
- Optional manual reanalysis after napari edits
- Visualize cells positive for channel 0 + channel 1
- Visualize cells positive for channel 0 + channel 2
- Visualize cells positive for channel 0 + channel 1 + channel 2
- Export results
- When to use this tutorial
- Three-channel analysis with z-projection tutorial
- Dataset used in this tutorial
- How to use this tutorial
- Imports
- Project settings
- Load the analysis channels
- Draw ROIs interactively in napari
- Save the drawn ROIs or load an existing ROI mask
- Run the ROI-wise three-channel segmentation and colocalization analysis
- Visualize the base result in napari
- Optionally refine the projected result and visualize the updated result
- Optionally reanalyze manually edited label layers from napari
- Visualize cells positive for channel 0 + channel 1
- Visualize cells positive for channel 0 + channel 2
- Visualize cells positive for channel 0 + channel 1 + channel 2
- Export results
- Single-channel analysis tutorial
- Dataset used in this tutorial
- How to use this tutorial
- Imports
- Project settings
- Load the analysis channel
- Optional: Draw ROIs interactively in napari
- Optional: Save drawn ROIs or load an existing ROI mask
- Run the ROI-wise single-channel segmentation and counting
- Visualize the result in napari
- Optional: Refine Cellpose thresholds and inspect the updated result
- Optional: Reanalyze manually edited label layers from napari
- Export results
- Result table: object_summary
- Result table: voxel_plausibility_check
- Result table: roi_overview
- Current usage topics
- Recommended starting point
- API Reference
- Top-level package
CellposeModelConfigChannelConfigColocalizationConfigColocalizationRunResultColocalizationTablesDisplayNamesLoadedImageChannelsLoadedSingleChannelImageOptionalRegionSegmentationConfigOptionalRegionSegmentationResultResultsPathsRuntimeConfigSingleChannelAnalysisConfigSingleChannelConfigSingleChannelDisplayNamesSingleChannelResultsPathsSingleChannelRunResultSingleChannelTablesanalyze_existing_masks()analyze_existing_single_channel_masks()build_positive_cell_mask()build_results_paths()build_single_channel_results_paths()create_cellpose_model()create_cellpose_models_for_channels()create_full_image_roi_labels()create_roi_drawing_viewer()create_single_channel_roi_drawing_viewer()evaluate_cellpose_model()export_analysis_outputs()export_single_channel_outputs()extract_label_masks_from_viewer()extract_single_channel_masks_from_viewer()filter_labels_by_size()get_available_cellpose_model_names()get_bbox_2d()get_cellpose_major_version()get_roi_label_points()get_runtime_cache_root()load_analysis_images()load_roi_labels()load_single_channel_image()prepare_loaded_images_for_analysis()prepare_loaded_single_channel_image_for_analysis()prepare_runtime_environment()rasterize_shapes_to_labelmask()refine_run_result_from_cellpose_cache()refine_single_channel_run_result_from_cellpose_cache()relabel_with_offset()run_roi_cellpose_colocalization()run_roi_single_channel_segmentation()save_roi_labels()save_roi_labels_from_shapes()segment_optional_region()show_analysis_results()show_optional_region_segmentation()show_single_channel_results()try_load_roi_labels()try_load_single_channel_roi_labels()
- Public API overview
- cellcoloc.CellposeModelConfig
- cellcoloc.ChannelConfig
- cellcoloc.ColocalizationConfig
- cellcoloc.DisplayNames
- cellcoloc.OptionalRegionSegmentationConfig
- cellcoloc.RuntimeConfig
- cellcoloc.ResultsPaths
- cellcoloc.LoadedImageChannels
- cellcoloc.OptionalRegionSegmentationResult
- cellcoloc.ColocalizationTables
- cellcoloc.ColocalizationRunResult
- cellcoloc.build_results_paths
- cellcoloc.load_analysis_images
- cellcoloc.save_roi_labels
- cellcoloc.load_roi_labels
- cellcoloc.try_load_roi_labels
- cellcoloc.export_analysis_outputs
- cellcoloc.analyze_existing_masks
- cellcoloc.prepare_loaded_images_for_analysis
- cellcoloc.prepare_runtime_environment
- cellcoloc.get_runtime_cache_root
- cellcoloc.create_full_image_roi_labels
- cellcoloc.rasterize_shapes_to_labelmask
- cellcoloc.create_roi_drawing_viewer
- cellcoloc.save_roi_labels_from_shapes
- cellcoloc.get_bbox_2d
- cellcoloc.get_roi_label_points
- cellcoloc.create_cellpose_model
- cellcoloc.create_cellpose_models_for_channels
- cellcoloc.evaluate_cellpose_model
- cellcoloc.relabel_with_offset
- cellcoloc.filter_labels_by_size
- cellcoloc.get_cellpose_major_version
- cellcoloc.get_available_cellpose_model_names
- cellcoloc.segment_optional_region
- cellcoloc.run_roi_cellpose_colocalization
- cellcoloc.refine_run_result_from_cellpose_cache
- cellcoloc.build_positive_cell_mask
- cellcoloc.extract_label_masks_from_viewer
- cellcoloc.show_optional_region_segmentation
- cellcoloc.show_analysis_results
- Top-level package
- Whatβs New?
- Contributing and Community Guidelines