# itkwidgets large images

**URL:** <https://discourse.itk.org/t/itkwidgets-large-images/5401>\
**Category:** Engineering\
**Tags:** itkwidgets\
**Created:** [October 9, 2022, 9:55pm UTC](https://discourse.itk.org/t/itkwidgets-large-images/5401 "2022-10-09T21:55:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![darrent1974](https://discourse.itk.org/user_avatar/discourse.itk.org/darrent1974/32/4570_2.png) [@darrent1974](https://discourse.itk.org/u/darrent1974)\
**Post date:** [October 9, 2022, 9:55pm UTC](https://discourse.itk.org/t/itkwidgets-large-images/5401/1 "2022-10-09T21:55:11Z")

</div>

Hi,

I’m currently using itkwidgets 1.0a6 and was wondering if there is any internal limit on displaying 2D images above a certain size?

In my current testing I’ve discovered that the view widget stops rendering images when the size \>= 520 pixels in x & y. See below. I’m wondering if this is some memory limit issue or is this something to do with the size of the widget itself. Any ideas to get it going would be much appreciated. BTW. I’m trying to render by 2D images and CT datasets (as 2D slices) up to 2560x2160 (float).

All good at 519x519

 ![Screenshot 2022-10-10 085331](https://discourse.itk.org/uploads/default/original/2X/d/dcb462ac1439226353cfeb62d49fe034fb0920b4.png)

Not so good at 520x520

 ![Screenshot 2022-10-10 085227](https://discourse.itk.org/uploads/default/original/2X/d/dc3028f2caafb4196cbace1fccf64828b6a1e807.png)

---

<div class="post-metadata">

**Author:** ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)\
**Post date:** [October 10, 2022, 1:58pm UTC](https://discourse.itk.org/t/itkwidgets-large-images/5401/2 "2022-10-10T13:58:40Z")

</div>

There are some limits, mostly imposed by Jupyter ecosystem, but all limits should be way above 500x500. @PaulHax do you have some advice for this case?

---

<div class="post-metadata">

**Author:** ![PaulHax](https://discourse.itk.org/user_avatar/discourse.itk.org/paulhax/32/2949_2.png) [@PaulHax](https://discourse.itk.org/u/PaulHax)\
**Post date:** [October 10, 2022, 7:02pm UTC](https://discourse.itk.org/t/itkwidgets-large-images/5401/3 "2022-10-10T19:02:37Z")

</div>

I think you found a bug. Thank you.

> <https://github.com/InsightSoftwareConsortium/itkwidgets/issues/554>
>
> With a notebook like this
> \`\`\`
> import sys
> !{sys.executable} -m pip install -q …"itkwidgets\[notebook\]\>=1.0a15"
> 
> import numpy as np
> from itkwidgets import view
> 
> points = np.random.uniform(high=100.0, size=(520,520)).astype(np.float32)
> 
> view(points)
> \`\`\`
> Getting error in browser console
> \`\`\`
> index.js:148 Traceback (most recent call last):
> File "/home/paul/src/itkwidgets/.venv/lib/python3.10/site-packages/imjoy\_rpc/rpc.py", line 404, in \_wait
> result = await result
> File "/home/paul/src/itkwidgets/.venv/lib/python3.10/site-packages/itkwidgets/viewer.py", line 87, in run
> result = \_get\_viewer\_image(data, label=False)
> File "/home/paul/src/itkwidgets/.venv/lib/python3.10/site-packages/itkwidgets/integrations/\_\_init\_\_.py", line 126, in \_get\_viewer\_image
> to\_ngff\_zarr(store, multiscales, chunk\_store=chunk\_store)
> File "/home/paul/src/itkwidgets/.venv/lib/python3.10/site-packages/ngff\_zarr/to\_ngff\_zarr.py", line 61, in to\_ngff\_zarr
> arr = dask.array.to\_zarr(
> File "/home/paul/src/itkwidgets/.venv/lib/python3.10/site-packages/dask/array/core.py", line 3700, in to\_zarr
> return arr.store(z, lock=False, compute=compute, return\_stored=return\_stored)
> File "/home/paul/src/itkwidgets/.venv/lib/python3.10/site-packages/dask/array/core.py", line 1770, in store
> r = store(\[self\], \[target\], \*\*kwargs)
> File "/home/paul/src/itkwidgets/.venv/lib/python3.10/site-packages/dask/array/core.py", line 1226, in store
> store\_dlyds = persist(\*store\_dlyds, \*\*kwargs)
> File "/home/paul/src/itkwidgets/.venv/lib/python3.10/site-packages/dask/base.py", line 901, in persist
> results = schedule(dsk, keys, \*\*kwargs)
> File "/home/paul/src/itkwidgets/.venv/lib/python3.10/site-packages/dask/threaded.py", line 89, in get
> results = get\_async(
> File "/home/paul/src/itkwidgets/.venv/lib/python3.10/site-packages/dask/local.py", line 511, in get\_async
> raise\_exception(exc, tb)
> File "/home/paul/src/itkwidgets/.venv/lib/python3.10/site-packages/dask/local.py", line 319, in reraise
> raise exc
> File "/home/paul/src/itkwidgets/.venv/lib/python3.10/site-packages/dask/local.py", line 224, in execute\_task
> result = \_execute\_task(task, data)
> File "/home/paul/src/itkwidgets/.venv/lib/python3.10/site-packages/dask/core.py", line 119, in \_execute\_task
> return func(\*(\_execute\_task(a, cache) for a in args))
> File "/home/paul/src/itkwidgets/.venv/lib/python3.10/site-packages/dask/array/core.py", line 4372, in store\_chunk
> return load\_store\_chunk(x, out, index, lock, return\_stored, False)
> File "/home/paul/src/itkwidgets/.venv/lib/python3.10/site-packages/dask/array/core.py", line 4354, in load\_store\_chunk
> out\[index\] = x
> File "/home/paul/src/itkwidgets/.venv/lib/python3.10/site-packages/zarr/core.py", line 1353, in \_\_setitem\_\_
> self.set\_basic\_selection(pure\_selection, value, fields=fields)
> File "/home/paul/src/itkwidgets/.venv/lib/python3.10/site-packages/zarr/core.py", line 1448, in set\_basic\_selection
> return self.\_set\_basic\_selection\_nd(selection, value, fields=fields)
> File "/home/paul/src/itkwidgets/.venv/lib/python3.10/site-packages/zarr/core.py", line 1746, in \_set\_basic\_selection\_nd
> indexer = BasicIndexer(selection, self)
> File "/home/paul/src/itkwidgets/.venv/lib/python3.10/site-packages/zarr/indexing.py", line 342, in \_\_init\_\_
> dim\_indexer = SliceDimIndexer(dim\_sel, dim\_len, dim\_chunk\_len)
> File "/home/paul/src/itkwidgets/.venv/lib/python3.10/site-packages/zarr/indexing.py", line 176, in \_\_init\_\_
> self.nchunks = ceildiv(self.dim\_len, self.dim\_chunk\_len)
> File "/home/paul/src/itkwidgets/.venv/lib/python3.10/site-packages/zarr/indexing.py", line 160, in ceildiv
> return math.ceil(a / b)
> ZeroDivisionError: division by zero
> \`\`\`
> Notebook works with 519x519 image.
> 
> Reported here:
> https://discourse.itk.org/t/itkwidgets-large-images/5401
