# SetSize, SetIndex Python

**URL:** <https://discourse.itk.org/t/setsize-setindex-python/2413>\
**Category:** Algorithms\
**Created:** [November 15, 2019, 3:18pm UTC](https://discourse.itk.org/t/setsize-setindex-python/2413 "2019-11-15T15:18:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![fraca](https://discourse.itk.org/letter_avatar_proxy/v4/letter/f/f19dbf/32.png) [@fraca](https://discourse.itk.org/u/fraca)\
**Post date:** [November 15, 2019, 3:18pm UTC](https://discourse.itk.org/t/setsize-setindex-python/2413/1 "2019-11-15T15:18:09Z")

</div>

There’s a way to set the size and the index of an image in python? Because commands

> processedVolumeRegion.SetSize(processedVolumeSize)  
> processedVolumeRegion.SetIndex(processedVolumeStart)

report this error: `AttributeError: 'itkImageF3' object has no attribute 'SetSize'`

---

<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:** [November 15, 2019, 3:42pm UTC](https://discourse.itk.org/t/setsize-setindex-python/2413/2 "2019-11-15T15:42:54Z")

</div>

Size and Index are properties or a Region. Image has three regions: Requested, Buffered and LargestPossible. Setting an Index directly is supported, but size cannot be changed this way. Only perhaps reducing the size along the slowest-changing axis will not lead to disastrous effect. It looks like you want to use [ExtractImageFilter](https://itk.org/Doxygen/html/classitk_1_1ExtractImageFilter.html).
