segmentation#
Segmentation#
- class scportrait.pipeline.segmentation.segmentation.Segmentation(config, directory, nuc_seg_name, cyto_seg_name, _tmp_image_path, project_location, debug, overwrite, project, filehandler, from_project: bool = False, **kwargs)#
Bases:
ProcessingStepSegmentation helper class used for creating segmentation workflows.
- maps#
Segmentation workflows based on the
Segmentationclass can use maps for saving and loading checkpoints and perform operations. Maps can be array like structures, e.g. memory-mapped temp arrays.- Type:
dict(str)
- DEFAULT_FILTER_ADDTIONAL_FILE#
- Type:
str, default
filtered_classes.csv
- PRINT_MAPS_ON_DEBUG#
- Type:
bool, default
False
- identifier#
Only set if called by
ShardedSegmentation. Unique index of the shard.- Type:
int, default
None
- window#
Only set if called by
ShardedSegmentation. Defines the window which is assigned to the shard. The window will be applied to the input. The first element refers to the first dimension of the image and so on. For example use[(0,1000),(0,2000)]To crop the image to 1000 px height and 2000 px width from the top left corner.- Type:
list(tuple), default
None
- input_path#
Only set if called by
ShardedSegmentation. Location of the input hdf5 file. During sharded segmentation theShardedSegmentationderived helper class will save the input image in form of a hdf5 file. This makes the input image available for parallel reading by the segmentation processes.- Type:
str, default
None
Initialize a processing step and normalize configuration handling.
- Parameters:
config – Parsed configuration dictionary or path to a config file. If the top-level config contains a key matching the concrete step class name, that sub-dictionary is used as the step config.
directory – Working directory for this step.
project_location – Project root when running as part of
Project.debug – Enable verbose stdout logging in addition to file logging.
overwrite – If
True, existing step output may be removed before processing.project – Active
Projectinstance when this step is project-managed.filehandler – Shared SpatialData file handler for project-managed runs.
from_project – Whether this step is invoked from a project-managed execution context.
- process(input_image)#
Process the input image with the segmentation method.