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

# Get SEM Mask

> Retrieve the RLE-encoded segmentation mask for an SEM image

Returns the detected segmentation mask for an SEM image, encoded using run-length encoding (RLE). The mask identifies the features segmented from the image during processing.

<ParamField path="data_id" type="string" required>
  The data entry UUID for the SEM image
</ParamField>

## Response

<ResponseField name="mask_rle" type="string">
  Run-length encoded mask data
</ResponseField>

<ResponseField name="mask_height" type="integer">
  Height of the mask in pixels
</ResponseField>

<ResponseField name="mask_width" type="integer">
  Width of the mask in pixels
</ResponseField>

<ResponseField name="color" type="array">
  RGBA color for visualizing the mask
</ResponseField>

<RequestExample>
  ```python Python theme={null}
  import requests

  response = requests.get(
      "https://api.atomscale.ai/sem/images/d290f1ee-6c54-4b01-90e6-d701748f0851/mask",
      headers={"X-API-KEY": "YOUR_API_KEY"}
  )
  mask = response.json()
  ```

  ```bash cURL theme={null}
  curl "https://api.atomscale.ai/sem/images/d290f1ee-6c54-4b01-90e6-d701748f0851/mask" \
    -H "X-API-KEY: YOUR_API_KEY"
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "mask_rle": "0 100 1 50 0 200 ...",
    "mask_height": 1024,
    "mask_width": 1024,
    "color": [0, 0, 255, 0.2]
  }
  ```
</ResponseExample>
