# Should updateLargestPossibleRegion re-read image

**URL:** https://discourse.itk.org/t/should-updatelargestpossibleregion-re-read-image/1817
**Category:** Engineering
**Created:** [April 29, 2019, 1:44pm UTC](https://discourse.itk.org/t/should-updatelargestpossibleregion-re-read-image/1817 "2019-04-29T13:44:16Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![finetjul](https://discourse.itk.org/user_avatar/discourse.itk.org/finetjul/32/538_2.png) [@finetjul](https://discourse.itk.org/u/finetjul)
#### Post date: [April 29, 2019, 1:44pm UTC](https://discourse.itk.org/t/should-updatelargestpossibleregion-re-read-image/1817/1 "2019-04-29T13:44:16Z")

</div>

Hi,

I would like to know if the following behavior is expected:

1. I instantiate an image reader (from disk)
2. I configure and update() the reader to read a file
3. I delete the file on disk used by the reader
4. I call UpdateLargestPossibleRegion() on the reader.

The reader attempts to read the deleted file.

So my question is, why does the reader try to read the file if it has already read it ?

Thanks,  
Julien.

---

<div class="post-metadata">

### Author: ![blowekamp](https://discourse.itk.org/user_avatar/discourse.itk.org/blowekamp/32/79_2.png) [@blowekamp](https://discourse.itk.org/u/blowekamp)
#### Post date: [April 29, 2019, 1:58pm UTC](https://discourse.itk.org/t/should-updatelargestpossibleregion-re-read-image/1817/2 "2019-04-29T13:58:02Z")

</div>

> [@finetjul](#):
>
> So my question is, why does the reader try to read the file if it has already read it ?

Are you explicitly providing an `ImageIO` to the reader?

A minimal example and the explicit error or stack trace you are encountering could explain why you are getting the error.

---

<div class="post-metadata">

### Author: ![finetjul](https://discourse.itk.org/user_avatar/discourse.itk.org/finetjul/32/538_2.png) [@finetjul](https://discourse.itk.org/u/finetjul)
#### Post date: [April 29, 2019, 2:29pm UTC](https://discourse.itk.org/t/should-updatelargestpossibleregion-re-read-image/1817/3 "2019-04-29T14:29:20Z")

</div>

Found it !

I had some code that was modifying the largest possible region of the reader output image as a side effect (because of a pointer/reference bug).

So the answer is no, UpdateLargestPossibleRegion() is not supposed to re-read the file if there is no reason to 🙂

Thanks!
