> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bioptimus.com/llms.txt
> Use this file to discover all available pages before exploring further.

# bioptimus_mask

Remote tissue segmentation mask model.

Wraps a tissue segmentation `EndpointModel` as a `TissueMaskModel`, forwarding each `ModelRequest` to the remote tissue segmentation endpoint.

## BioptimusTissueMaskModel

```python theme={null}
class BioptimusTissueMaskModel(TissueMaskModel)
```

Tissue mask model backed by a segmentation endpoint.

Forwards each `ModelRequest` to the `EndpointModel` and returns the `ModelResponse`.

<ParamField body="backbone">
  An `EndpointModel` configured for tissue segmentation.
</ParamField>

**Example:**

```python theme={null}
from bioptimus.models.backbones import Backbone

backbone = Backbone("tissue-seg", base_url="http://localhost:8080")
model = BioptimusTissueMaskModel(backbone)
response = model.process(request)
```

#### tile\_spec

```python theme={null}
@property
def tile_spec() -> TileSpec | None
```

Returns the tile spec from the backbone's model spec.

#### process

```python theme={null}
def process(request: ModelRequest) -> ModelResponse
```

Sends a request to the remote tissue segmentation endpoint.

<ParamField body="request" type="ModelRequest" required>
  A `ModelRequest` containing the tile image and metadata.
</ParamField>

<ResponseField name="returns" type="ModelResponse">
  A `ModelResponse` with the segmentation output.
</ResponseField>

#### process\_async

```python theme={null}
async def process_async(request: ModelRequest,
                        session: Any = None) -> ModelResponse
```

Sends a request asynchronously to the segmentation endpoint.

<ParamField body="request" type="ModelRequest" required>
  A `ModelRequest` containing the tile image and metadata.
</ParamField>

<ParamField body="session" type="Any">
  An `ClientSession` for connection pooling.
</ParamField>

<ResponseField name="returns" type="ModelResponse">
  A `ModelResponse` with the segmentation output.
</ResponseField>
