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

# Compare RHEED Images

> Compare two RHEED images to measure changes in spot count, strain, and mask

Compares two RHEED images and reports how the diffraction pattern changed between them, including the difference in spot count, the referenced strain, and the mask regions gained or lost.

**data\_id\_1** `string` *required*

The data entry UUID for the first (initial) RHEED image

**data\_id\_2** `string` *required*

The data entry UUID for the second (final) RHEED image

## Response

**data\_id\_1** `string`

Data entry UUID for the first image

**data\_id\_2** `string`

Data entry UUID for the second image

**referenced\_strain** `number`

Strain of the second image referenced against the first

**spot\_count** `object`

Change in the number of detected diffraction spots between the two images.

**properties**

**initial** `number`

Spot count in the first image

**final** `number`

Spot count in the second image

**percent\_change** `number`

Percent change in spot count from the first image to the second

**mask\_gained** `object`

Mask region present in the second image but not the first, encoded using run-length encoding (RLE). Null if no region was gained.

**properties**

**mask\_rle** `string`

Run-length encoded mask data

**mask\_height** `integer`

Height of the mask in pixels

**mask\_width** `integer`

Width of the mask in pixels

**mask\_lost** `object`

Mask region present in the first image but not the second, encoded using run-length encoding (RLE). Null if no region was lost.

**properties**

**mask\_rle** `string`

Run-length encoded mask data

**mask\_height** `integer`

Height of the mask in pixels

**mask\_width** `integer`

Width of the mask in pixels

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

response = requests.get(
    "https://api.atomscale.ai/rheed/images/compare/",
    headers={"X-API-KEY": "YOUR_API_KEY"},
    params={
        "data_id_1": "d290f1ee-6c54-4b01-90e6-d701748f0851",
        "data_id_2": "a1b2c3d4-5678-90ab-cdef-1234567890ab"
    }
)
comparison = response.json()
```

```bash cURL theme={null}
curl "https://api.atomscale.ai/rheed/images/compare/?data_id_1=d290f1ee-6c54-4b01-90e6-d701748f0851&data_id_2=a1b2c3d4-5678-90ab-cdef-1234567890ab" \
  -H "X-API-KEY: YOUR_API_KEY"
```

```json 200 theme={null}
{
  "data_id_1": "d290f1ee-6c54-4b01-90e6-d701748f0851",
  "data_id_2": "a1b2c3d4-5678-90ab-cdef-1234567890ab",
  "referenced_strain": 0.42,
  "spot_count": {
    "initial": 12,
    "final": 18,
    "percent_change": 50.0
  },
  "mask_gained": {
    "mask_rle": "0 100 1 50 0 200 ...",
    "mask_height": 512,
    "mask_width": 512
  },
  "mask_lost": null
}
```


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