> ## 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.preprocess.wsi.models.bioptimus_mask

Remote tissue segmentation mask model.

Wraps a tissue segmentation [`EndpointModel`](/sdk-reference/models/endpoint_model#endpointmodel) as a [`TissueMaskModel`](/sdk-reference/preprocess/wsi/models/base#tissuemaskmodel), forwarding each `ModelRequest` to the remote tissue segmentation endpoint.

## BioptimusTissueMaskModel

```python theme={null}
class BioptimusTissueMaskModel(backbone: EndpointModel)
```

Tissue mask model backed by a segmentation endpoint.

Forwards each [`ModelRequest`](/sdk-reference/inference/schemas#modelrequest) to the [`EndpointModel`](/sdk-reference/models/endpoint_model#endpointmodel) and returns the [`ModelResponse`](/sdk-reference/inference/schemas#modelresponse).

<ParamField body="backbone">
  An [`EndpointModel`](/sdk-reference/models/endpoint_model#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">
  A [`ModelRequest`](/sdk-reference/inference/schemas#modelrequest) containing the tile image and metadata.
</ParamField>

**Returns**:

A [`ModelResponse`](/sdk-reference/inference/schemas#modelresponse) with the segmentation output.

***

#### 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">
  A [`ModelRequest`](/sdk-reference/inference/schemas#modelrequest) containing the tile image and metadata.
</ParamField>

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

**Returns**:

A [`ModelResponse`](/sdk-reference/inference/schemas#modelresponse) with the segmentation output.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.