# Cannot get Sphere VTK example to work.

**URL:** https://discourse.vtk.org/t/cannot-get-sphere-vtk-example-to-work/1428
**Category:** Support
**Created:** [July 27, 2019, 10:25am UTC](https://discourse.vtk.org/t/cannot-get-sphere-vtk-example-to-work/1428 "2019-07-27T10:25:38Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![mkhalil](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/m/838e76/32.png) [@mkhalil](https://discourse.vtk.org/u/mkhalil)
#### Post date: [July 27, 2019, 10:25am UTC](https://discourse.vtk.org/t/cannot-get-sphere-vtk-example-to-work/1428/1 "2019-07-27T10:25:38Z")

</div>

Hi All!!

So, I am new to VTK. I want to use VTK to visualize and volume render MRI DICOM images.

I have been trying to make the sphere example work ([https://vtk.org/Wiki/VTK/Examples/Cxx/GeometricObjects/Sphere](https://vtk.org/Wiki/VTK/Examples/Cxx/GeometricObjects/Sphere)). But with no luck!

I was first trying to make it work on windows. I am using the latest VTK and Cmake versions. I follow the configuration and build steps on the VTK website.

 ![Screenshot%20from%202019-07-27%2011-48-19](https://discourse.vtk.org/uploads/default/original/1X/2a74502d12013f433a68b3e4241a7db7689aee3d.png)

I don’t understand what is happening. I configured and generated the VTK correctly (I think). I checked the VTK\_examples.

Could someone help me please :)?

Best regards,  
Khalil

---

<div class="post-metadata">

### Author: ![lorensen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lorensen/32/20_2.png) [@lorensen](https://discourse.vtk.org/u/lorensen)
#### Post date: [July 28, 2019, 12:44am UTC](https://discourse.vtk.org/t/cannot-get-sphere-vtk-example-to-work/1428/2 "2019-07-28T00:44:57Z")

</div>

Did you build VTK? I see the ccmake but did you build VTK afterward?

Otherwise, your commands look correct. It works for me…

Bill

---

<div class="post-metadata">

### Author: ![lorensen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lorensen/32/20_2.png) [@lorensen](https://discourse.vtk.org/u/lorensen)
#### Post date: [July 28, 2019, 12:50am UTC](https://discourse.vtk.org/t/cannot-get-sphere-vtk-example-to-work/1428/3 "2019-07-28T00:50:04Z")

</div>

You need to build VTK. I just tried building Sphere against a VTK that has been configured but not built. I get the same bad results you get.

---

<div class="post-metadata">

### Author: ![mkhalil](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/m/838e76/32.png) [@mkhalil](https://discourse.vtk.org/u/mkhalil)
#### Post date: [July 28, 2019, 7:24am UTC](https://discourse.vtk.org/t/cannot-get-sphere-vtk-example-to-work/1428/4 "2019-07-28T07:24:33Z")

</div>

Hi Bill!

Thank you for your reply!

I actually start building the VTK, but I am getting an error that I dont understand:

 ![Screenshot%20from%202019-07-28%2009-22-33](https://discourse.vtk.org/uploads/default/original/1X/7ddf7d50302321c5c7033b7a63f2521798967d0d.png)

---

<div class="post-metadata">

### Author: ![amaclean](https://discourse.vtk.org/user_avatar/discourse.vtk.org/amaclean/32/224_2.png) [@amaclean](https://discourse.vtk.org/u/amaclean)
#### Post date: [July 28, 2019, 11:08am UTC](https://discourse.vtk.org/t/cannot-get-sphere-vtk-example-to-work/1428/5 "2019-07-28T11:08:03Z")

</div>

There is a problem with the current VTK build. If you are using cmake-gui you need to configure VTK as shown here:

 ![ADIOS2](https://discourse.vtk.org/uploads/default/original/1X/3c5f72293736cf876c1081c8a2e30fe4a494c4ca.png)

Once you do this the build will work.

Also please use: [Sphere](https://lorensen.github.io/VTKExamples/site/Cxx/GeometricObjects/Sphere/) the link you mentioned has been superseded by the new VTK Examples site.

---

<div class="post-metadata">

### Author: ![amaclean](https://discourse.vtk.org/user_avatar/discourse.vtk.org/amaclean/32/224_2.png) [@amaclean](https://discourse.vtk.org/u/amaclean)
#### Post date: [July 30, 2019, 3:56am UTC](https://discourse.vtk.org/t/cannot-get-sphere-vtk-example-to-work/1428/6 "2019-07-30T03:56:23Z")

</div>

The problem with ADIOS2 seems to have been fixed now. So you can set the above value back to DEFAULT.

---

<div class="post-metadata">

### Author: ![mkhalil](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/m/838e76/32.png) [@mkhalil](https://discourse.vtk.org/u/mkhalil)
#### Post date: [July 31, 2019, 10:15am UTC](https://discourse.vtk.org/t/cannot-get-sphere-vtk-example-to-work/1428/7 "2019-07-31T10:15:44Z")

</div>

Thank you guys for the help, really!

I got the Sphere example to work now I can move on with my project.

---

<div class="post-metadata">

### Author: ![amaclean](https://discourse.vtk.org/user_avatar/discourse.vtk.org/amaclean/32/224_2.png) [@amaclean](https://discourse.vtk.org/u/amaclean)
#### Post date: [July 31, 2019, 10:52am UTC](https://discourse.vtk.org/t/cannot-get-sphere-vtk-example-to-work/1428/8 "2019-07-31T10:52:29Z")

</div>

That’s good news. Do keep in mind the [VTK Examples](https://lorensen.github.io/VTKExamples/site/) for inspiration and ideas.
