# Displaying custom VTK class inherited from \`vtkDataSet\`

**URL:** <https://discourse.slicer.org/t/displaying-custom-vtk-class-inherited-from-vtkdataset/20350>\
**Category:** Development\
**Created:** [October 26, 2021, 1:19am UTC](https://discourse.slicer.org/t/displaying-custom-vtk-class-inherited-from-vtkdataset/20350 "2021-10-26T01:19:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![keri](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/keri/32/11618_2.png) [@keri](https://discourse.slicer.org/u/keri)\
**Post date:** [October 26, 2021, 1:19am UTC](https://discourse.slicer.org/t/displaying-custom-vtk-class-inherited-from-vtkdataset/20350/1 "2021-10-26T01:19:12Z")

</div>

Hi,

I’m implementing a class inherited directly from `vtkDataSet`.

When displayng it looks like in the picture (I do not explicitely set all the points but rather XYZ surface and Z spacings vector and thus I save RAM):  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/1/1/116cb3e518253720979430b3312100a9b9e8f68f.jpeg)

Now I’m looking for a way to display it in SlicerCAT. It seems that neither `vtkMRMLModelNode` nor `vtkVolumeNode` is able to add custom vtk dataset to the scene.

If I inherit from `vtkMRMLDisplayableNode` will I be able to visualize this custom class?

P.S. I’m also looking for a way to inherit from concrete vtk class (instead of abstract vtkDataSet) like vtkPointSet, vtkPolyData or vtkImageData. In this case I expect it would be easier to add to the Slicer

---

<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:** [October 26, 2021, 3:56am UTC](https://discourse.slicer.org/t/displaying-custom-vtk-class-inherited-from-vtkdataset/20350/2 "2021-10-26T03:56:00Z")

</div>

It is extremely limited what you can do with a custom vtkDataSet-derived object in VTK. I would recommend to derive from vtkPolyData, vtkUnstructuredGrid, or vtkImageData instead.
