Mirror to Plane
The Mirror to Plane tool performs a geometric reflection of surfaces, masks, or both across a user-defined plane. This operation updates the selected objects in-place, transforming the geometry to its mirrored status. To ensure data integrity for segmentation masks that may reflect outside the original volume boundaries, the tool offers an optional automatic padding mechanism.
Overview
Plane mirroring is a fundamental geometric transformation defined by a reflection across a plane in 3D Euclidean space. Mathematically, for any point and a plane defined by a point and a unit normal vector , the reflected point is given by the Householder transformation:
Distances are preserved and orientation is reversed.
Key Applications
- Symmetry Restoration & Analysis: Reflecting healthy anatomy to reconstruct defective contralateral sides in craniomaxillofacial (CMF) surgery.
- Implant Design: Generating contralateral templates for patient-specific implants.
- Data Augmentation: Expanding training datasets for deep learning by generating mirrored variations of segmented structures a.
- Geometric Validation: Assessing asymmetry by overlaying mirrored geometry onto original anatomy.
Accessing the Tool
- Navigate to the Surface ribbon tab.
- Locate the Edit section.
- Click the Additional dropdown menu.
- Select Mirror to Plane.
Target Object(s) Specification
The tool supports batch processing of surfaces and masks. Select the desired scope from the Target object(s) dropdown:
| Target Scope | Description |
|---|---|
| Active Surface | Mirror only the active surface. |
| Selected Surfaces | Mirror all selected surfaces in the Data Manager. |
| Visible Surfaces | Mirror all surfaces visible in the 3D view. |
| All Surfaces | Mirror all surfaces in the project. |
| Active Mask | Mirror only the active mask. |
| Selected Masks | Mirror all selected masks in the Scene Object Tree. |
| Visible Masks | Mirror all masks visible in the 3D view. |
| All Masks | Mirror all masks in the project. |
| Visible Masks and Visible Surfaces | Mirror all visible masks and visible surfaces. |
| All Masks and All Surfaces | Mirror all masks and all surfaces. |
The tool does not create copies. Duplicate objects first if you need both original and mirrored geometry.
This tool mirrors entire objects. It does not support region-of-interest selection.
Plane Configuration
The reflection plane is defined by an Origin () and a Normal ().
Interactive Visualization
Enable Show plane to visualize the reflection plane in the 3D viewport. The plane widget can be manipulated interactively to fine-tune the reflection axis relative to the anatomical structures.
Plane Parameters
- Origin (mm): Specifies a point on the plane () with up to 9 decimal places precision. This determines the position of the plane but not its orientation.
- Normal: Specifies the vector perpendicular to the plane () with up to 9 decimal places precision. This determines the orientation of the reflection.
The input normal vector is automatically normalized to unit length () during the operation. A zero vector is invalid and will prevent execution.
The plane normal must not be zero. If all normal components are zero, the operation is aborted.
Quick Alignment Buttons
Quick alignment buttons set the plane normal to standard anatomical axes:
- X-axis (): Corresponds to the Sagittal plane. Reflects Left Right.
- Y-axis (): Corresponds to the Coronal plane. Reflects Anterior Posterior.
- Z-axis (): Corresponds to the Axial plane. Reflects Superior Inferior.
These buttons set the normal direction while preserving the current origin position.
Reset
The Reset button recalculates the plane placement based on the bounding box of the current target objects. If no valid target bounds are available, it falls back to the active surface or active mask.
Output Behavior
- Surfaces are updated in place. The mirror operation reflects vertices and then recomputes triangle orientation and normals.
- Masks are updated in place. Reflected voxels are written into the same mask objects.
Mask mirroring requires valid 3D mask previews. If a mask has no preview surface, the operation stops and prompts you to generate previews.
Other Options
Padding Volume (Optional)
When mirroring objects that extend beyond current volume bounds, enable Pad images to cover mirrored region in the Other options section:
| Option | Description |
|---|---|
| Pad images to cover mirrored region | Pads the project's image data so mirrored geometry remains inside volume bounds |
Padding is calculated from the mirrored bounds of the selected surfaces and mask previews. The active volume provides the spacing for the padding calculation, and all volumes/masks in the project are padded together.
Enable padding when mirroring masks close to the volume boundary to avoid clipped voxels.
Always enable padding when mirroring masks that are not strictly centered or when reflecting across a plane far from the volume center. This ensures the integrity of the segmentation is preserved.
How the Mirror Operation Works
Mathematical Foundation
The mirror operation uses Householder reflection to transform each point:
Where:
- is the original point position
- is the reflected position
- is the plane origin
- is the unit normal vector
- represents the dot product
Surface Processing
For surface meshes:
- Vertex reflection: Each vertex is reflected using the Householder formula
- Cell winding reversal: Triangle winding order is reversed to maintain correct orientation
- Normal recomputation: Surface normals are recalculated for proper rendering and shading
This preserves the geometric properties while reversing the orientation.
Mask Processing
For segmentation masks:
- Voxel transformation: Each voxel is reflected to its mirrored position using nearest-neighbor interpolation
- Label preservation: Nearest-neighbor interpolation preserves discrete label values
- Volume expansion: If padding is enabled, the volume is expanded before reflection
- Preview regeneration: 3D mask previews are invalidated and regenerated after the operation
Practical Applications
Bilateral Reconstruction (Surface or Mask)
- Duplicate the source object.
- Set Target object(s) to Active Surface or Active Mask (with the duplicate active).
- Click X-axis for a sagittal reflection.
- Set Origin X at the anatomical midline.
- Enable Show plane to confirm alignment.
- If mirroring a mask, enable Pad images to cover mirrored region.
- Click Apply.
Creating Contralateral Implants
Use case: Design a left implant from a right-side template.
- Import or create the right-side implant surface
- Set normal to (1, 0, 0) for sagittal reflection
- Position the origin at the anatomical midline
- Mirror the surface
- The result is a geometrically accurate left-side implant
Symmetry Validation
Use case: Assess anatomical symmetry by overlaying original and mirrored structures.
- Create a surface of one side
- Mirror it across the anatomical midline
- Use color coding or transparency to compare original and mirrored sides
- Measure distances to quantify asymmetries
Mask Augmentation
Use case: Expand a segmentation dataset by creating mirrored versions.
- Select the mask to mirror
- Configure the appropriate reflection plane
- Enable padding if needed
- Apply the mirror
- The mask now contains both original and reflected regions
Technical Considerations
Surface Orientation
Mirrored surfaces have their triangle winding order reversed automatically. This ensures:
- Correct surface normals (pointing outward)
- Proper rendering (front face culling works correctly)
- Accurate volume calculations in subsequent operations
You do not need to manually fix normals after mirroring.
Mask Padding Requirements
Masks are constrained to the volume extents. If a mirrored mask would extend beyond the current volume:
- Without padding: Voxels outside the volume are discarded (data loss)
- With padding: The volume is automatically expanded to accommodate all data
Always check volume dimensions before mirroring masks without padding enabled.
Volume Expansion Direction
When padding is enabled, the volume expands in the direction needed to contain the mirrored geometry. The expansion is calculated based on:
- The bounding boxes of surfaces/masks to be mirrored
- The mirror plane position and normal
- The current volume boundaries
The original data remains in the same location; only the volume extents change.
Memory Considerations
Mirroring operations with padding may significantly increase memory usage if:
- Large masks are mirrored
- The padding expands the volume substantially
- Multiple high-resolution datasets are open
Monitor system memory when working with large datasets.
Workflow Examples
Example 1: Sagittal Skull Reconstruction
Objective: Complete a hemiskull scan by mirroring across the sagittal plane.
1. Import the hemiskull surface or create a mask
2. Click "X-axis" to set normal to (1, 0, 0)
3. Adjust origin X to align with the midline
4. Enable "Show plane" to verify alignment
5. Enable **Pad images to cover mirrored region** if working with masks
6. Click "Apply"
Result: A complete bilateral skull.
Example 2: Mirroring Multiple Masks
Objective: Mirror several segmented structures together.
1. Select the masks you want to mirror in the object list or 3D view
2. Set **Target object(s)** to **Selected Masks**
3. Configure the mirror plane
4. Enable **Pad images to cover mirrored region**
5. Click "Apply"
Result: All selected masks are mirrored into the same mask objects.
Example 3: Surface and Mask Combined Mirroring
Objective: Mirror both surface models and segmentation masks in one operation.
1. Select the surfaces and masks you want to mirror
2. Set **Target object(s)** to **Visible Masks and Visible Surfaces** or **All Masks and All Surfaces**
3. Configure the mirror plane appropriately
4. Enable **Pad images to cover mirrored region** to ensure masks remain in bounds
5. Click "Apply"
Result: Surfaces and masks are updated in place.
Example 4: Angled Reflection Plane
Objective: Mirror an object across a custom-angled plane (not axis-aligned).
1. Enter the desired normal vector components (e.g., [0.707, 0.707, 0.0])
2. Set the origin to the desired intersection point
3. Enable "Show plane" to verify orientation
4. Apply the mirror operation
Result: Reflection across a plane at 45 degrees between X and Y axes.
Scripting API
The mirroring functionality is exposed via the Python Scripting API for automation.
Surface Mirroring
import ScriptingApi as api
app = api.Application()
surface_operations = app.get_surface_operations()
# Mirror surfaces across a plane
surface_operations.mirror_to_plane(
['Surface_1', 'Surface_2'], # surfaceNames
[50.0, 0.0, 0.0], # planeOrigin [x, y, z]
[1.0, 0.0, 0.0] # planeNormal [x, y, z]
)
Mask Mirroring
import ScriptingApi as api
app = api.Application()
mask_operations = app.get_mask_operations()
# Mirror masks across a plane
mask_operations.mirror_to_plane(
['Mask_1', 'Mask_2'], # maskNames
[50.0, 0.0, 0.0], # planeOrigin [x, y, z]
[1.0, 0.0, 0.0] # planeNormal [x, y, z]
)
Volume Padding
import ScriptingApi as api
app = api.Application()
volume_operations = app.get_volume_operations()
# Pad project's image data to accommodate mirrored geometry
volume_operations.pad(
'Volume_1', # volumeName to calculate required padding
['Surface_1'], # surfaceNames to consider
['Mask_1'], # maskNames to consider
[50.0, 0.0, 0.0], # planeOrigin [x, y, z]
[1.0, 0.0, 0.0] # planeNormal [x, y, z]
)
Best Practices
- Use Reset first to center the plane, then adjust only the axis and offset you need.
- Duplicate objects before mirroring if you need side-by-side comparison.
- When mirroring masks, enable padding unless you are certain the reflected region stays within the volume.
- For symmetry analysis, mirror once, then use transparency or distance measurements to quantify differences.
Common Issues and Solutions
| Issue | Likely Cause | Solution |
|---|---|---|
| Mirrored mask appears cut off | Exceeded volume bounds without padding | Enable Pad images to cover mirrored region and reapply |
| Surface appears inside-out | Corrupted surface before mirroring | Run Diagnostics and Fixes before mirroring |
| Padding creates a very large volume | Plane positioned far from data | Move the plane closer to the target objects |
| Cannot see preview surface for mask | Mask preview not generated | Regenerate mask preview or toggle mask visibility |
| Mirrored objects overlap original | Plane positioned through the object | Expected behavior; adjust plane if separation is needed |
| Wrong reflection direction | Incorrect normal vector | Use quick alignment buttons or verify values |
Related Tools
- Project to Plane: Flatten geometry onto a plane instead of mirroring
- Surface Transform - Mirror: Mirror along standard X, Y, or Z axes