# Unable to Load big VTI files in VTK.JS

**URL:** https://discourse.vtk.org/t/unable-to-load-big-vti-files-in-vtk-js/7888
**Category:** Web
**Created:** [February 22, 2022, 9:46am UTC](https://discourse.vtk.org/t/unable-to-load-big-vti-files-in-vtk-js/7888 "2022-02-22T09:46:34Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![simplyvish](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/s/e47774/32.png) [@simplyvish](https://discourse.vtk.org/u/simplyvish)
#### Post date: [February 22, 2022, 9:46am UTC](https://discourse.vtk.org/t/unable-to-load-big-vti-files-in-vtk-js/7888/1 "2022-02-22T09:46:34Z")

</div>

Hi, I’m trying to load VTI files with size around 700MB. The error screenshot is attached for reference. The loading is tried with online VolumeViewer example ([https://kitware.github.io/vtk-js/examples/VolumeViewer/VolumeViewer.html](https://kitware.github.io/vtk-js/examples/VolumeViewer/VolumeViewer.html)) and another one locally developed following the online example. The browser used is Chrome (Version 97.0.4692.71).

![image](https://discourse.vtk.org/uploads/default/original/2X/2/28b10498625e583ae496500f8822dd76a52129cb.png)

---

<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: [February 22, 2022, 4:28pm UTC](https://discourse.vtk.org/t/unable-to-load-big-vti-files-in-vtk-js/7888/2 "2022-02-22T16:28:15Z")

</div>

Can you share your data? What is the dimensions (512 x 512 x 512) of your volume and type of field (float32, float64, …)?

---

<div class="post-metadata">

### Author: ![simplyvish](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/s/e47774/32.png) [@simplyvish](https://discourse.vtk.org/u/simplyvish)
#### Post date: [February 24, 2022, 10:56am UTC](https://discourse.vtk.org/t/unable-to-load-big-vti-files-in-vtk-js/7888/3 "2022-02-24T10:56:19Z")

</div>

Hi, my volume dimensions are 690 x 550 x 990 and the field type is unsigned int32. It’ll not be possible for sharing the data. Now I’m able to load it in Mozilla Firefox browser. Chrome is still having issue. However, with firefox as well I’m facing issue with volume files of size greater than ~850MB. Any suggestions what can I do here ?

---

<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: [February 24, 2022, 3:38pm UTC](https://discourse.vtk.org/t/unable-to-load-big-vti-files-in-vtk-js/7888/4 "2022-02-24T15:38:10Z")

</div>

Did you try various version of vti encoding to reduce some decoding burden to see if that helps?

The issue is most likely a browser limitation. Other format can maybe offer ways to reduce any overhead that could lead to allocation issue within browser.

HTH,

Seb

---

<div class="post-metadata">

### Author: ![simplyvish](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/s/e47774/32.png) [@simplyvish](https://discourse.vtk.org/u/simplyvish)
#### Post date: [March 1, 2022, 9:16am UTC](https://discourse.vtk.org/t/unable-to-load-big-vti-files-in-vtk-js/7888/5 "2022-03-01T09:16:10Z")

</div>

Hi Seb, actually the vti file source is not in my control. I have to handle the data whatever is received. If it’s a browser limitation which most likely is then can I do something on implementation to render big images ?

---

<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: [March 1, 2022, 3:38pm UTC](https://discourse.vtk.org/t/unable-to-load-big-vti-files-in-vtk-js/7888/6 "2022-03-01T15:38:26Z")

</div>

If you are getting close to the browser limit, the only thing you can do, is to prevent unnecessary data conversion and reallocation. That’s why I was asking if you could change the format to something with less overhead for the web.

---

<div class="post-metadata">

### Author: ![simplyvish](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/s/e47774/32.png) [@simplyvish](https://discourse.vtk.org/u/simplyvish)
#### Post date: [March 2, 2022, 2:13pm UTC](https://discourse.vtk.org/t/unable-to-load-big-vti-files-in-vtk-js/7888/7 "2022-03-02T14:13:05Z")

</div>

I tried to reduce the object copies in my application but not much improvement. One thing I observed is that during that image loading the application takes up to 6 times memory of the size of the vti file and after few minutes it got stable to 2.5 to 3 times memory usage of vti file size. Same was observed with the online VolumeViewer example application. I’m still exploring what is consuming this much memory.

---

<div class="post-metadata">

### Author: ![simplyvish](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/s/e47774/32.png) [@simplyvish](https://discourse.vtk.org/u/simplyvish)
#### Post date: [March 22, 2022, 4:05am UTC](https://discourse.vtk.org/t/unable-to-load-big-vti-files-in-vtk-js/7888/8 "2022-03-22T04:05:37Z")

</div>

Just for update on last status. We are rewriting the XML reader API as per our requirement as there were multiple data copies were created. Till now we are able to load 1GB of image with our XML reader. It’s not complete replacement of internal VTK XML reader but includes only the functionalities required by us.

---

<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: [March 22, 2022, 3:52pm UTC](https://discourse.vtk.org/t/unable-to-load-big-vti-files-in-vtk-js/7888/9 "2022-03-22T15:52:44Z")

</div>

I’m glad you managed to streamline the XML reader for your usage to remove as much overhead as you could.

If what you are trying to do client side is becoming too limiting, you might be interested at looking at **[trame](https://kitware.github.io/trame/)** to allow either server side processing and/or rendering.

---

<div class="post-metadata">

### Author: ![simplyvish](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/s/e47774/32.png) [@simplyvish](https://discourse.vtk.org/u/simplyvish)
#### Post date: [March 23, 2022, 6:14am UTC](https://discourse.vtk.org/t/unable-to-load-big-vti-files-in-vtk-js/7888/10 "2022-03-23T06:14:15Z")

</div>

Thanks @Sebastien_Jourdain will try that.

---

<div class="post-metadata">

### Author: ![simplyvish](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/s/e47774/32.png) [@simplyvish](https://discourse.vtk.org/u/simplyvish)
#### Post date: [April 12, 2022, 6:47am UTC](https://discourse.vtk.org/t/unable-to-load-big-vti-files-in-vtk-js/7888/11 "2022-04-12T06:47:33Z")

</div>

I tried trame and able to load and render images. I wanted to know if I can merge existing VTK.JS bases application with it. We had created one application there and then moved to trame for POC. Instead of developing whole application again we are planning if merging is possible. I found [this](https://kitware.github.io/trame/docs/getting_started.html#Calling-JS-methods) link but getting error in importing “js\_call” module.

I have following queries:

1. Should we merge VTK.JS with trame
2. If yes then can anyone refer to some guide for same

---

<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: [April 12, 2022, 2:48pm UTC](https://discourse.vtk.org/t/unable-to-load-big-vti-files-in-vtk-js/7888/12 "2022-04-12T14:48:50Z")

</div>

How is your current vtk.js application built?

1. Vanilla JavaScript
2. Vue.js version 2
3. React, Angular, Vue3…

How much GUI do you have? Which widget library are you using? What kind of visualization were you doing with vtk.js? …

With little to no knowledge of your code base it is hard to advice one way or another. All of the paths are possible. It is just a matter of finding the one that make sense.

Are you sure that trame is the way to go for you? Do you understand the deployment constraints?

If need be Kitware can help in those decisions and even development. Between an NDA and a support contract we can really help you to choose the best path for your needs while properly understanding the possible drawback or limitations of those choices.

---

<div class="post-metadata">

### Author: ![simplyvish](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/s/e47774/32.png) [@simplyvish](https://discourse.vtk.org/u/simplyvish)
#### Post date: [April 13, 2022, 4:57am UTC](https://discourse.vtk.org/t/unable-to-load-big-vti-files-in-vtk-js/7888/13 "2022-04-13T04:57:10Z")

</div>

I’m using Vanilla JavaScript for developing a reusable library for our application. On the GUI side I will be doing rendering with other common operations like zooming, panning, measurements, cropping, color filtering etc. I had implemented various functionalities in JavaScript but faced issue with big images and image quality. So. I tried trame as per suggestion for PoC. I’m still analyzing the difference to decide the way ahead.

---

<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: [April 13, 2022, 2:41pm UTC](https://discourse.vtk.org/t/unable-to-load-big-vti-files-in-vtk-js/7888/14 "2022-04-13T14:41:48Z")

</div>

It is still hard to tell with the information provided but it sounds like it won’t be a smooth transition as things will start shifting to the server side and your JS code will be useless at that point.

---

<div class="post-metadata">

### Author: ![simplyvish](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/s/e47774/32.png) [@simplyvish](https://discourse.vtk.org/u/simplyvish)
#### Post date: [April 14, 2022, 4:51am UTC](https://discourse.vtk.org/t/unable-to-load-big-vti-files-in-vtk-js/7888/15 "2022-04-14T04:51:00Z")

</div>

Thanks for help. Will be checking more details of both framework i.e. VTK.JS and VTK Trame to decide which will be more suitable for me.
