# vtk.js data structure please explain please help

**URL:** https://discourse.vtk.org/t/vtk-js-data-structure-please-explain-please-help/6376
**Category:** Development
**Created:** [August 14, 2021, 4:29am UTC](https://discourse.vtk.org/t/vtk-js-data-structure-please-explain-please-help/6376 "2021-08-14T04:29:26Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![gzt036](https://discourse.vtk.org/user_avatar/discourse.vtk.org/gzt036/32/5960_2.png) [@gzt036](https://discourse.vtk.org/u/gzt036)
#### Post date: [August 14, 2021, 4:29am UTC](https://discourse.vtk.org/t/vtk-js-data-structure-please-explain-please-help/6376/1 "2021-08-14T04:29:26Z")

</div>

Please explain the vtk.js data structure, expecially how ‘model’ is used. For example, const range = imageData.getPointData().getScalars().getRange();  
if you go through debugger, you can see imageData is a bunch of useless public APIs with no data provided,  
if you step into getPointData() function, you will get this line  
publicAPI[`get${capitalize(field)}`] = () =\> model[field];  
, I tried and tried but couldn’t understand where model[] is defined, and how does macro.js thing work, please help! Please give some tips, thank you!

---

<div class="post-metadata">

### Author: ![Sebastien\_Jourdain](https://discourse.vtk.org/user_avatar/discourse.vtk.org/sebastien_jourdain/32/100_2.png) [@Sebastien\_Jourdain](https://discourse.vtk.org/u/Sebastien_Jourdain)
#### Post date: [August 14, 2021, 9:53pm UTC](https://discourse.vtk.org/t/vtk-js-data-structure-please-explain-please-help/6376/2 "2021-08-14T21:53:58Z")

</div>

What is exactly the question?

- What is the VTK API ? You can learn about VTK via the [free pdf book](https://kitware.github.io/vtk-js/api/)
- How to create VTK code yourself? [Guide](https://kitware.github.io/vtk-js/docs/develop_class.html)
- The usage of closures to provide protected/private members via `model` and a separate public API container that we freeze to prevent any alteration?
- The fact that we generate methods to prevent developer mistakes?

---

<div class="post-metadata">

### Author: ![Tran\_Phong](https://discourse.vtk.org/user_avatar/discourse.vtk.org/tran_phong/32/3749_2.png) [@Tran\_Phong](https://discourse.vtk.org/u/Tran_Phong)
#### Post date: [August 15, 2021, 3:14am UTC](https://discourse.vtk.org/t/vtk-js-data-structure-please-explain-please-help/6376/3 "2021-08-15T03:14:50Z")

</div>

Hi Sebastien,  
The link to download pdf book ([https://www.kitware.com/products/books/VTKTextbook.pdf](https://www.kitware.com/products/books/VTKTextbook.pdf)) seems not working. Can you please help to resend it here ?

---

<div class="post-metadata">

### Author: ![will.schroeder](https://discourse.vtk.org/user_avatar/discourse.vtk.org/will.schroeder/32/233_2.png) [@will.schroeder](https://discourse.vtk.org/u/will.schroeder)
#### Post date: [August 15, 2021, 10:03am UTC](https://discourse.vtk.org/t/vtk-js-data-structure-please-explain-please-help/6376/4 "2021-08-15T10:03:56Z")

</div>

Check out the examples: [https://kitware.github.io/vtk-examples/site/](https://kitware.github.io/vtk-examples/site/)

These include a link to the LaTeX/pdf version of the textbook: [https://gitlab.kitware.com/vtk/textbook/raw/master/VTKBook/VTKTextBook.pdf](https://gitlab.kitware.com/vtk/textbook/raw/master/VTKBook/VTKTextBook.pdf)

---

<div class="post-metadata">

### Author: ![Sebastien\_Jourdain](https://discourse.vtk.org/user_avatar/discourse.vtk.org/sebastien_jourdain/32/100_2.png) [@Sebastien\_Jourdain](https://discourse.vtk.org/u/Sebastien_Jourdain)
#### Post date: [August 16, 2021, 4:10pm UTC](https://discourse.vtk.org/t/vtk-js-data-structure-please-explain-please-help/6376/5 "2021-08-16T16:10:34Z")

</div>

The link you provided is working for me when clicked in the US. Not sure I know how to solve the problem you are running into.
