# The bottom of the first picture is not closed. If you want to achieve the same effect as the second picture, how can vtk do it or can vtk achieve such a task?

**URL:** https://discourse.vtk.org/t/the-bottom-of-the-first-picture-is-not-closed-if-you-want-to-achieve-the-same-effect-as-the-second-picture-how-can-vtk-do-it-or-can-vtk-achieve-such-a-task/11492
**Category:** Support
**Tags:** python
**Created:** [May 19, 2023, 11:43am UTC](https://discourse.vtk.org/t/the-bottom-of-the-first-picture-is-not-closed-if-you-want-to-achieve-the-same-effect-as-the-second-picture-how-can-vtk-do-it-or-can-vtk-achieve-such-a-task/11492 "2023-05-19T11:43:23Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![649841458](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/6/cc9497/32.png) [@649841458](https://discourse.vtk.org/u/649841458)
#### Post date: [May 19, 2023, 11:43am UTC](https://discourse.vtk.org/t/the-bottom-of-the-first-picture-is-not-closed-if-you-want-to-achieve-the-same-effect-as-the-second-picture-how-can-vtk-do-it-or-can-vtk-achieve-such-a-task/11492/1 "2023-05-19T11:43:23Z")

</div>

![QQ图片20230519193536](https://discourse.vtk.org/uploads/default/original/2X/2/24b210988ba834dbed1ad6eb5cd08a93b604abff.png)  
 ![QQ图片20230519193546](https://discourse.vtk.org/uploads/default/original/2X/7/7dd9b18202f57ab3bf3c504c1395575dd272f9af.png)

---

<div class="post-metadata">

### Author: ![charly\_bollinger](https://discourse.vtk.org/user_avatar/discourse.vtk.org/charly_bollinger/32/6973_2.png) [@charly\_bollinger](https://discourse.vtk.org/u/charly_bollinger)
#### Post date: [May 22, 2023, 1:55pm UTC](https://discourse.vtk.org/t/the-bottom-of-the-first-picture-is-not-closed-if-you-want-to-achieve-the-same-effect-as-the-second-picture-how-can-vtk-do-it-or-can-vtk-achieve-such-a-task/11492/2 "2023-05-22T13:55:31Z")

</div>

Hello,

This looks like a camera clipping issue. I guess what you could do is either to move back the camera, or to modify its clipping range. If changing the clipping range doesn’t solve your issue, it means that you’re camera is placed “inside” your dataset and you must back it.

To modify the clipping range, you can use `vtkCamera::SetClippingRange(double, double)`. You can get the camera from your renderer with `vtkRenderer::GetActiveCamera()`.

In python, this should look like

```py
view = vtk.vtkContextView()
[...]
renderer = view.GetRenderer()
camera = renderer.GetActiveCamera()
camera.SetClippingRange(0.01, 1000) #default is [0.1, 1000]

```

---

<div class="post-metadata">

### Author: ![649841458](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/6/cc9497/32.png) [@649841458](https://discourse.vtk.org/u/649841458)
#### Post date: [May 22, 2023, 2:07pm UTC](https://discourse.vtk.org/t/the-bottom-of-the-first-picture-is-not-closed-if-you-want-to-achieve-the-same-effect-as-the-second-picture-how-can-vtk-do-it-or-can-vtk-achieve-such-a-task/11492/4 "2023-05-22T14:07:52Z")

</div>

Thank you, my second picture is the stl model generated by 3D Slicer, and the first picture is using vtk.vtkContourFilter() in vtk to extract the bone contours of each ct and combine them together. I found that I can’t just extract outline such that the middle of the model is empty

---

<div class="post-metadata">

### Author: ![charly\_bollinger](https://discourse.vtk.org/user_avatar/discourse.vtk.org/charly_bollinger/32/6973_2.png) [@charly\_bollinger](https://discourse.vtk.org/u/charly_bollinger)
#### Post date: [May 24, 2023, 7:45am UTC](https://discourse.vtk.org/t/the-bottom-of-the-first-picture-is-not-closed-if-you-want-to-achieve-the-same-effect-as-the-second-picture-how-can-vtk-do-it-or-can-vtk-achieve-such-a-task/11492/5 "2023-05-24T07:45:07Z")

</div>

Hello,

Not sure to understand. Did you solve your issue / understand it?  
Isn’t it a clipping range issue? Or are you saying that `vtkContourFilter` simply can’t achieve what you wanted?
