Docs /Templates/ sinapsis-generic-data-tools

MaskNonROIs

sinapsis-generic-data-toolscommunitysegmentationmaskimageregion_of_interest

Python template · sinapsis_generic_data_tools.templates.mask_non_roi

Overview

Template that assigns segmentation masks to non-regions of interest. The template assigns a zero to all the pixels not in the roi and returns an image where non-zero pixels correspond to the actual roi mask.

Capabilities

Capabilities: not set

Installation

Install the published package using pip or uv.

Terminalbash
pip install sinapsis-generic-data-tools==1.0.0
uv pip install sinapsis-generic-data-tools==1.0.0
uv add sinapsis-generic-data-tools==1.0.0

Configuration

Effective fields from the inspector schema, including nested Pydantic model fields.

metadata
sinapsis_core.template_base.base_models.TemplateMetadata | None
Optional
Default: null
rois_to_keepRequired

- roi: - x: 657 y: 619 - x: 1220 y: 580 - x: 1343 y: 733 - x: 682 y: 789 - roi: -x ....;

list[sinapsis_generic_data_tools.templates.mask_non_roi.RegionOfInterest]
Required
Default: null
return_as_mask
bool
Optional
Default: false
return_in_generic
bool
Optional
Default: false
rois_to_keep[]
object
Optional
Default: Not specified
roiRequired
list[sinapsis_core.data_containers.annotations.KeyPoint]
Required
Default: null

Configuration example

Example from the Python docstring:

yaml
agent:
  name: my_test_agent
templates:
- template_name: InputTemplate
  class_name: InputTemplate
  attributes: {}
- template_name: MaskNonROIs
  class_name: MaskNonROIs
  template_input: InputTemplate
  attributes:
    rois_to_keep:
        - roi:
        - x: 657
            y: 619
        - x: 1220
            y: 580
        - x: 1343
            y: 733
        - x: 682
            y: 789
        - roi:
            -x ....;
    return_in_generic: false
    return_as_mask: false
Show schema-based configuration skeleton
yaml
templates:
  - template_name: "MaskNonROIs"
    class_name: "MaskNonROIs"
    attributes:
      rois_to_keep: "<required>"
      return_as_mask: false
      return_in_generic: false
      rois_to_keep[]:
        roi: "<required>"

Inheritance

Immediate parent: sinapsis_core.template_base.template.Template

Environment variables

Environment definitions belong to their canonical Python modules.

No directly related environment variables listed.