# how to get a vtkDataSet from the vtkSmartPointer

**URL:** https://discourse.vtk.org/t/how-to-get-a-vtkdataset-from-the-vtksmartpointer/2848
**Category:** Support
**Created:** [March 18, 2020, 11:40am UTC](https://discourse.vtk.org/t/how-to-get-a-vtkdataset-from-the-vtksmartpointer/2848 "2020-03-18T11:40:15Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![1116](https://discourse.vtk.org/user_avatar/discourse.vtk.org/1116/32/1506_2.png) [@1116](https://discourse.vtk.org/u/1116)
#### Post date: [March 18, 2020, 11:40am UTC](https://discourse.vtk.org/t/how-to-get-a-vtkdataset-from-the-vtksmartpointer/2848/1 "2020-03-18T11:40:15Z")

</div>

Hello,

I have a vtkSmartPointer such like this:  
vtkSmartPointer sphereSource = vtkSmartPointer::New();

How could I get a vtkDataSet from the sphereSource? It seems there is a vtkDataSet::SafeDownCast function, but I’m not sure what is the suitable input parameters for this function

Thanks a lot for your help!

---

<div class="post-metadata">

### Author: ![1116](https://discourse.vtk.org/user_avatar/discourse.vtk.org/1116/32/1506_2.png) [@1116](https://discourse.vtk.org/u/1116)
#### Post date: [March 18, 2020, 11:46am UTC](https://discourse.vtk.org/t/how-to-get-a-vtkdataset-from-the-vtksmartpointer/2848/2 "2020-03-18T11:46:15Z")

</div>

I answer it by myself, it seems this works for me:

vtkDataSet::SafeDownCast(sphereSource-\>GetOutput())
