# Mirroring landmarks across midsagittal plane 

**URL:** <https://discourse.slicer.org/t/mirroring-landmarks-across-midsagittal-plane/41249>\
**Category:** Support\
**Created:** [January 23, 2025, 10:33pm UTC](https://discourse.slicer.org/t/mirroring-landmarks-across-midsagittal-plane/41249 "2025-01-23T22:33:26Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![sck84](https://avatars.discourse-cdn.com/v4/letter/s/898d66/32.png) [@sck84](https://discourse.slicer.org/u/sck84)\
**Post date:** [January 28, 2025, 8:50pm UTC](https://discourse.slicer.org/t/mirroring-landmarks-across-midsagittal-plane/41249/3 "2025-01-28T20:50:52Z")

</div>

> [@lassoan](#):
>
> First, you need to get a transformation matrix that transforms the midsagittal plane to a plane that is orthogonal to the world coordinate syatem left-right axis. Probably the easiest is to use the ACPC transform module for this (provided by SlicerNeuro extension). You don’t need to apply this transform to the image.
> 
> Then you place your landmarks and get them as a numpy array. To get the point coordinates mirrored to the midsagittal plane:
> 
> - add a row of 1.0 values to the numpy array that contains each point position in a column (the result is the homogenous coordinates of the landmark points)
> - multiply this matrix from the left with the mirroring transform (4x4 matrix)
> 
> You can compute the mirroring transform by a simple matrix multiplication: `inv(ACPC) * diag(-1,1,1,1) * ACPC` (where `ACPC` is the ACPC transform computed by the ACPC Transform module).
> 
> Probably Microsoft Copilot or ChatGPT can generate the Python script from this description. You can run the script by copying it into the Python console.

Wow… I was beginning to think it was impossible, but this worked. Thank you so much!!

---

_[View the full topic](https://discourse.slicer.org/t/mirroring-landmarks-across-midsagittal-plane/41249)._
