# Padding without extending image size to increase the field of view

**URL:** https://discourse.itk.org/t/padding-without-extending-image-size-to-increase-the-field-of-view/3163
**Category:** Uncategorized
**Created:** [June 10, 2020, 11:31am UTC](https://discourse.itk.org/t/padding-without-extending-image-size-to-increase-the-field-of-view/3163 "2020-06-10T11:31:58Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![isuruwi](https://discourse.itk.org/letter_avatar_proxy/v4/letter/i/c0e974/32.png) [@isuruwi](https://discourse.itk.org/u/isuruwi)
#### Post date: [June 10, 2020, 11:31am UTC](https://discourse.itk.org/t/padding-without-extending-image-size-to-increase-the-field-of-view/3163/1 "2020-06-10T11:31:58Z")

</div>

I’m trying to add an uniform margin to a 3D CT volume using itk::ConstantPadImageFilter and then resize into original image size.  
My ultimate goal is ,for example, to transform the bottom image to the image at the top to increase the field of view without changing the original image size.

 ![Old_vampire_CT](https://discourse.itk.org/uploads/default/original/2X/3/3cfc3d0d44be24a64987a6ba57aee8dc02b71760.jpeg) ![CT_vol_image](https://discourse.itk.org/uploads/default/original/2X/4/423c66b260891b04b39af16c146625d3cf4d60fa.jpeg)

---

<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: [June 10, 2020, 1:43pm UTC](https://discourse.itk.org/t/padding-without-extending-image-size-to-increase-the-field-of-view/3163/2 "2020-06-10T13:43:40Z")

</div>

> [@isuruwi](#):
>
> resize into original image size

This can be accomplished using [resample filter](https://itk.org/Doxygen/html/classitk_1_1ResampleImageFilter.html). Setting the original image as the reference should work well for your case. But you will need a transform with some scaling, in order to have non-trivial effect.

---

<div class="post-metadata">

### Author: ![isuruwi](https://discourse.itk.org/letter_avatar_proxy/v4/letter/i/c0e974/32.png) [@isuruwi](https://discourse.itk.org/u/isuruwi)
#### Post date: [June 10, 2020, 2:02pm UTC](https://discourse.itk.org/t/padding-without-extending-image-size-to-increase-the-field-of-view/3163/3 "2020-06-10T14:02:15Z")

</div>

No. I don’t have two images. I only have set of images like in the bottom image and I need to transform a way that it appears with a large field of view. I tried by adding extra black pixels to the original image but the original image size become increasing in that case. I then need to pass this 3D volume to the SiddonJacobRay tracing algorithm to generate DRR images by capturing the whole chest. Any solution for that ?

---

<div class="post-metadata">

### Author: ![isuruwi](https://discourse.itk.org/letter_avatar_proxy/v4/letter/i/c0e974/32.png) [@isuruwi](https://discourse.itk.org/u/isuruwi)
#### Post date: [June 15, 2020, 4:15pm UTC](https://discourse.itk.org/t/padding-without-extending-image-size-to-increase-the-field-of-view/3163/4 "2020-06-15T16:15:36Z")

</div>

Any solution for this please ?

---

<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: [June 15, 2020, 4:25pm UTC](https://discourse.itk.org/t/padding-without-extending-image-size-to-increase-the-field-of-view/3163/5 "2020-06-15T16:25:13Z")

</div>

Hello,

It’s still sounds like @dzenanz answer is still appropriate. Perhaps reviewing some of ITK Image, Transform and resampling concepts will help:

[https://simpleitk.readthedocs.io/en/master/fundamentalConcepts.html](https://simpleitk.readthedocs.io/en/master/fundamentalConcepts.html)
