# Boundary Missing on OpenVDB

**URL:** https://discourse.paraview.org/t/boundary-missing-on-openvdb/12930
**Category:** ParaView Support
**Created:** [September 26, 2023, 3:15am UTC](https://discourse.paraview.org/t/boundary-missing-on-openvdb/12930 "2023-09-26T03:15:25Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![fashing](https://discourse.paraview.org/user_avatar/discourse.paraview.org/fashing/32/12357_2.png) [@fashing](https://discourse.paraview.org/u/fashing)
#### Post date: [September 26, 2023, 3:15am UTC](https://discourse.paraview.org/t/boundary-missing-on-openvdb/12930/1 "2023-09-26T03:15:25Z")

</div>

Hi Paraview,  
I was testing a tiny structure and found something weird.  
This [cube.vdb](https://discourse.paraview.org/uploads/short-url/wQ5DjN2rtX9h8Y5STIXjgcVW0WZ.vdb) is a 3x3 cube with all values set as 1 while the center set as 0.

> [[[1, 1, 1], [1, 1, 1], [1, 1, 1]]  
> [[1, 1, 1], [1, 0, 1], [1, 1, 1]]  
> [[1, 1, 1], [1, 1, 1], [1, 1, 1]]]

I expect to see a solid cube with single color in surface representation, but it looks like this.

 ![image](https://discourse.paraview.org/uploads/default/original/2X/3/3e44dabb74b5f4e8a3e5329bbbb765b7a238bec7.png)  
And the data statistics also looks wrong.  
 ![image](https://discourse.paraview.org/uploads/default/original/2X/d/d44a8010035139daee4cdf42f7de840c265594d9.png)

It seems that OpenVDBReader shrinks the maximum boundary while loading vdb into partitioned dataset collection.  
Is it an intended behavior? If so, is there a way to avoid it? Thank you!

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [September 26, 2023, 9:14am UTC](https://discourse.paraview.org/t/boundary-missing-on-openvdb/12930/2 "2023-09-26T09:14:11Z")

</div>

> Is it an intended behavior?

Yes, but it is a limiting behavior that should be improved

> If so, is there a way to avoid it?

You can use RessampleToImage after the reader

---

<div class="post-metadata">

### Author: ![fashing](https://discourse.paraview.org/user_avatar/discourse.paraview.org/fashing/32/12357_2.png) [@fashing](https://discourse.paraview.org/u/fashing)
#### Post date: [October 25, 2023, 7:14am UTC](https://discourse.paraview.org/t/boundary-missing-on-openvdb/12930/3 "2023-10-25T07:14:19Z")

</div>

Hi @mwestphal,  
I found the issue in my other post ([Unpredictable behavior of paraview-lite - ParaView Support - ParaView](https://discourse.paraview.org/t/unpredictable-behavior-of-paraview-lite/13067)) is actually due to this boundary missing of VDB reader.  
And it cannot be solved by the `RessampleToImage`, since I want to apply contouring on the source.

Is there a way to modify the VDB reader directly? Thank you!

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [October 25, 2023, 7:15am UTC](https://discourse.paraview.org/t/boundary-missing-on-openvdb/12930/4 "2023-10-25T07:15:50Z")

</div>

please share your data

---

<div class="post-metadata">

### Author: ![fashing](https://discourse.paraview.org/user_avatar/discourse.paraview.org/fashing/32/12357_2.png) [@fashing](https://discourse.paraview.org/u/fashing)
#### Post date: [October 25, 2023, 8:32am UTC](https://discourse.paraview.org/t/boundary-missing-on-openvdb/12930/5 "2023-10-25T08:32:21Z")

</div>

Sure, this is a simplified example containing two grids. [test.vdb](https://discourse.paraview.org/uploads/short-url/yd9wUsXC4JXOWTZB07uFO7oPdlM.vdb) (990.9 KB)

Setting up two contours that contour by each grid, the view should be like:

 ![image](https://discourse.paraview.org/uploads/default/original/2X/0/0d5315e4ea98e0cc09470da0480110623e1eadd9.png)

And after checking the `Merge Image Volumes` on VDB reader, the contour function gets `Bounds` from the whole structure. So the opening surfaces are closed.

 ![image](https://discourse.paraview.org/uploads/default/original/2X/4/4048a3a7eb09037402a57916cc0d7136846a2424.png)

I would like to know if there’s a way to make contouring use the un-shrunken bounds without merging image volume. Thank you!

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [October 25, 2023, 8:56am UTC](https://discourse.paraview.org/t/boundary-missing-on-openvdb/12930/6 "2023-10-25T08:56:36Z")

</div>

I’m not sure to follow, what do you mean by “un-shrunken bounds” ?

---

<div class="post-metadata">

### Author: ![fashing](https://discourse.paraview.org/user_avatar/discourse.paraview.org/fashing/32/12357_2.png) [@fashing](https://discourse.paraview.org/u/fashing)
#### Post date: [October 25, 2023, 9:13am UTC](https://discourse.paraview.org/t/boundary-missing-on-openvdb/12930/7 "2023-10-25T09:13:02Z")

</div>

In this testcase, the test1 grid has `Bounds` (0, 139, 0, 287, 239, 257) and test2 grid has `Bounds` (0, 140, 0, 288, 289, 296). However, in the vdb file, the boundary of test1 is (0,140, 0, 288, 239, 258) and that of test2 is (0, 141, 0, 289, 289, 297). Which has been confirmed an intended behavior by your previous reply.

However, I found out `merge image volume` helps because the `Bounds` of merged grid became (0, 140, 0, 288, 239, 296) and the contour function can then count on the missing surface. And hence I realize Paraview do load the data, but it shrinks the `Bounds` for safety purpose.

So what I mean here is: can I tell the function to consider larger `Bounds` to count on the missing part.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [October 25, 2023, 9:19am UTC](https://discourse.paraview.org/t/boundary-missing-on-openvdb/12930/8 "2023-10-25T09:19:18Z")

</div>

> [@fashing](#):
>
> can I tell the function to consider larger `Bounds` to count on the missing part.

Which function of the contour is impacted by the bounds ?

---

<div class="post-metadata">

### Author: ![fashing](https://discourse.paraview.org/user_avatar/discourse.paraview.org/fashing/32/12357_2.png) [@fashing](https://discourse.paraview.org/u/fashing)
#### Post date: [October 25, 2023, 9:25am UTC](https://discourse.paraview.org/t/boundary-missing-on-openvdb/12930/9 "2023-10-25T09:25:48Z")

</div>

My suspect is that, while doing contouring, it considers the `Bounds` of the contourby element. And merge image volume make it consider the `Bounds` of the whole structure (also shrunken, but large enough) instead of the shrunken `Bounds` of the grid itself.

The `Bounds` of the `Contour1` **without** merge image volume:

```auto
0 to 139 (delta: 139)
0 to 287 (delta: 287)
240.286 to 256.761 (delta: 16.4751)

```

The `Bounds` of the `Contour1` **with** merge image volume:

```auto
0 to 140 (delta: 140)
0 to 288 (delta: 288)
240.286 to 256.761 (delta: 16.4751)

```

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [October 25, 2023, 9:43am UTC](https://discourse.paraview.org/t/boundary-missing-on-openvdb/12930/10 "2023-10-25T09:43:17Z")

</div>

Ok, I see it now. To me it looks like the “correct” result is the one with the smaller bounds. ParaView is just adding data on the side that causes this “closing” effect in your contour, but, in truth, it should not be closed. Closing the surface itself is more in the realms of the Vespa project @Charles_Gueunet

---

<div class="post-metadata">

### Author: ![fashing](https://discourse.paraview.org/user_avatar/discourse.paraview.org/fashing/32/12357_2.png) [@fashing](https://discourse.paraview.org/u/fashing)
#### Post date: [October 25, 2023, 9:55am UTC](https://discourse.paraview.org/t/boundary-missing-on-openvdb/12930/11 "2023-10-25T09:55:26Z")

</div>

Yes, I agree the opening surface is the “correct” behavior of paraview. However, I want to point out that the structure should be closed according to the .vdb file. It is open due to the intended shrink on the boundary. It would be helpful if you can provide any clue about the following questions.

- How to “fake” bounds to cheat contour filter?
- Is there another contouring way that can close opening surface itself?

Appreciate a lot for your time!

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [October 25, 2023, 9:57am UTC](https://discourse.paraview.org/t/boundary-missing-on-openvdb/12930/12 "2023-10-25T09:57:10Z")

</div>

> [@fashing](#):
>
> How to “fake” bounds to cheat contour filter?

Ressample with an image with a slightly bigger bounds.
