# Aligning a surface model and volume rendering of the same skull

**URL:** <https://discourse.slicer.org/t/aligning-a-surface-model-and-volume-rendering-of-the-same-skull/36024>\
**Category:** Support\
**Created:** [May 9, 2024, 12:17pm UTC](https://discourse.slicer.org/t/aligning-a-surface-model-and-volume-rendering-of-the-same-skull/36024 "2024-05-09T12:17:18Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![paleomariomm](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/paleomariomm/32/68475_2.png) [@paleomariomm](https://discourse.slicer.org/u/paleomariomm)\
**Post date:** [May 9, 2024, 12:17pm UTC](https://discourse.slicer.org/t/aligning-a-surface-model-and-volume-rendering-of-the-same-skull/36024/1 "2024-05-09T12:17:18Z")

</div>

Hi community.

I have the DICOM files of a skull and the Surface model (in PLY format) separately.

When I load both into Slicer, and do the volume rendering of the DICOM files, I can see that they are NOT aligned.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/2/b/2bd485588bc91026f02d402c0eb31bd80af23774.jpeg)

How can I align/superimpose both (volume rendering and surface model)?

Thanks

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [May 9, 2024, 1:12pm UTC](https://discourse.slicer.org/t/aligning-a-surface-model-and-volume-rendering-of-the-same-skull/36024/2 "2024-05-09T13:12:55Z")

</div>

> [@paleomariomm](#):
>
> do the volume rendering of the DICOM files, I can see that they are NOT aligned.

This seems like RAS vs LPS coordinate issue. What happens when you choose the coordinate system for your 3d Model explicitly during the load.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/8/7/87a6344d531ce4bc4f28b462a7f28898da91a916.png)

---

<div class="post-metadata">

**Author:** ![paleomariomm](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/paleomariomm/32/68475_2.png) [@paleomariomm](https://discourse.slicer.org/u/paleomariomm)\
**Post date:** [May 9, 2024, 1:33pm UTC](https://discourse.slicer.org/t/aligning-a-surface-model-and-volume-rendering-of-the-same-skull/36024/3 "2024-05-09T13:33:09Z")

</div>

Thats perfect. By changing to RAS the surface model load it was perfectly aligned. Thanks

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/e/3/e30b4eb9b90c791a6634fbb2e9cdc8379d2ebc56.jpeg)

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [May 9, 2024, 1:47pm UTC](https://discourse.slicer.org/t/aligning-a-surface-model-and-volume-rendering-of-the-same-skull/36024/4 "2024-05-09T13:47:40Z")

</div>

> [@paleomariomm](#):
>
> Thats perfect. By changing to RAS the surface model load it was perfectly aligned. Thanks

Where did you do this segmentation? If this was done in slicer, this shouldn’t have happened.

---

<div class="post-metadata">

**Author:** ![paleomariomm](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/paleomariomm/32/68475_2.png) [@paleomariomm](https://discourse.slicer.org/u/paleomariomm)\
**Post date:** [May 9, 2024, 1:49pm UTC](https://discourse.slicer.org/t/aligning-a-surface-model-and-volume-rendering-of-the-same-skull/36024/5 "2024-05-09T13:49:50Z")

</div>

Yes, I did my segmentation in Slicer. My flow was:

1. Load the skull and segment it entirely.
2. Export model to PLY format.
3. Load the DICOM files and do volume rendering.
4. Load the exported PLY file.

Best

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [May 9, 2024, 5:58pm UTC](https://discourse.slicer.org/t/aligning-a-surface-model-and-volume-rendering-of-the-same-skull/36024/6 "2024-05-09T17:58:37Z")

</div>

> [@paleomariomm](#):
>
> - Load the skull and segment it entirely.
> - Export model to PLY format.

Can you share a one dataset of dicom and segmentaiton. This should not have happened, if you exported from Slicer.

@pieper @lassoan

---

<div class="post-metadata">

**Author:** ![bserrano](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/bserrano/32/17034_2.png) [@bserrano](https://discourse.slicer.org/u/bserrano)\
**Post date:** [August 29, 2024, 12:02pm UTC](https://discourse.slicer.org/t/aligning-a-surface-model-and-volume-rendering-of-the-same-skull/36024/7 "2024-08-29T12:02:01Z")

</div>

Hi all,

I’m facing the same problem. I export a segment as stl using:

```auto
slicer.modules.segmentations.logic().ExportSegmentsClosedSurfaceRepresentationToFiles(saveResults_path,segmentationNode,segmentIDsVTK, 'STL',False,1.0,False)

```

Following the documentation ([link](https://apidocs.slicer.org/master/classvtkSlicerSegmentationsModuleLogic.html)) it should save the geometry in RAS coordinates.

I need to load this geometry in slicer automatically. I tried:

```auto
modelNode = slicer.util.loadModel(path)

```

But it seems that it is loading the model in LPS.

When I do it manually and selecting RAS it loads the model correctly.  
 ![imagen](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/5/d/5d3cd71ea3f252f3f9c7f49201b20f235920456e.png)

How can I automate this process?
