> ## 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 RHEED Mask

> Retrieve the RLE-encoded mask for a RHEED image

Returns the automatically detected mask for a RHEED image, encoded using run-length encoding (RLE). The mask identifies relevant diffraction regions in the RHEED pattern.

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

## Response

<ResponseField name="data_id" type="string">
  Data entry UUID
</ResponseField>

<ResponseField name="processed_data_id" type="string">
  Processed data entry UUID
</ResponseField>

<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>

<RequestExample>
  ```python SDK theme={null}
  from atomscale import Client

  client = Client(api_key="YOUR_API_KEY")
  results = client.get(data_ids="d290f1ee-6c54-4b01-90e6-d701748f0851")
  image = results[0]  # RHEEDImageResult
  mask = image.mask  # numpy array
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      "https://api.atomscale.ai/rheed/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/rheed/images/d290f1ee-6c54-4b01-90e6-d701748f0851/mask" \
    -H "X-API-KEY: YOUR_API_KEY"
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "data_id": "d290f1ee-6c54-4b01-90e6-d701748f0851",
    "processed_data_id": "a1b2c3d4-5678-90ab-cdef-1234567890ab",
    "mask_rle": "0 100 1 50 0 200 ...",
    "mask_height": 512,
    "mask_width": 512
  }
  ```
</ResponseExample>
