# Adding Image/Polydata in HyperTreeGrid

**URL:** https://discourse.paraview.org/t/adding-image-polydata-in-hypertreegrid/5229
**Category:** Development
**Tags:** vtk
**Created:** [August 31, 2020, 3:09pm UTC](https://discourse.paraview.org/t/adding-image-polydata-in-hypertreegrid/5229 "2020-08-31T15:09:09Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![Yohann\_Bearzi](https://discourse.paraview.org/user_avatar/discourse.paraview.org/yohann_bearzi/32/1894_2.png) [@Yohann\_Bearzi](https://discourse.paraview.org/u/Yohann_Bearzi)
#### Post date: [August 31, 2020, 4:16pm UTC](https://discourse.paraview.org/t/adding-image-polydata-in-hypertreegrid/5229/2 "2020-08-31T16:16:52Z")

</div>

HyperTreeGrids (htgs) are under heavy code refactoring. When everything is clean and stable, we’ll add some examples. As for now, you can look at how the htgs are being created from scratch in a plugin of ParaView. Look for `vtkResampleToHyperTreeGrid.cxx` in the master branch, and in particular at method `vtkResampleToHyperTreeGrid::GenerateTrees`.

I can also point you to a code example I posted [here](https://discourse.paraview.org/t/vtkhypertreegrid-paraview-example-in-2d/4122/12).

In short, you need to initialize a cursor that allows you to subdivide htg leaves and recursively walk in the trees. You can get a global index from the cursors that you can map to you scalar fields (see `vtkResampleToHyperTreeGrid::SubdivideLeaves` for an example).

If you need any more help to get started, please let me know, I’ll be happy to help.

---

_[View the full topic](https://discourse.paraview.org/t/adding-image-polydata-in-hypertreegrid/5229)._
