# Display model in slice viewer

**URL:** <https://discourse.slicer.org/t/display-model-in-slice-viewer/208>\
**Category:** Development\
**Created:** [April 27, 2017, 11:28am UTC](https://discourse.slicer.org/t/display-model-in-slice-viewer/208 "2017-04-27T11:28:36Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [April 27, 2017, 12:29pm UTC](https://discourse.slicer.org/t/display-model-in-slice-viewer/208/2 "2017-04-27T12:29:43Z")

</div>

You can only see the intersection of the polydata with a slice, so the polydata has to be a 3D surface (theoretically it could be possible to have a 2D surface that is exactly aligned with the slice viewer, but in practice perfect alignment is often impossible to achieve).  
Fortunately, the `Markups to model` module in SlicerIGT extension does extactly that. It has several options for generating closed surface from a set of markups. It can do simple convex hull or smoothed contour with various options for making it more robust or accurate.

Simple quasi-planar surface generation:

 ![](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/1X/d145e35e9961e306dc31b7ff1753f2118627283e.jpg)

Smooth 3D surface generation:

 ![](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/1X/f0df0ce5445878118e78fe55c6e4b443275d89ab.jpg)

To generate the contours from your own module, you just need to add a vtkMRMLMarkupsToModelNode in your scene and set up its inputs and outputs. At minimum, call SetAndObserveMarkupsNodeID and SetAndObserveModelNodeID. See all methods and options at:  
[https://github.com/SlicerIGT/SlicerIGT/blob/master/MarkupsToModel/MRML/vtkMRMLMarkupsToModelNode.h](https://github.com/SlicerIGT/SlicerIGT/blob/master/MarkupsToModel/MRML/vtkMRMLMarkupsToModelNode.h)

---

_[View the full topic](https://discourse.slicer.org/t/display-model-in-slice-viewer/208)._
