# How to resize a 3D image

**URL:** https://discourse.itk.org/t/how-to-resize-a-3d-image/2379
**Category:** Algorithms
**Created:** [November 5, 2019, 9:23pm UTC](https://discourse.itk.org/t/how-to-resize-a-3d-image/2379 "2019-11-05T21:23:19Z")
**Posts on this page:** 1
**Showing post:** 2

<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 5, 2019, 9:35pm UTC](https://discourse.itk.org/t/how-to-resize-a-3d-image/2379/2 "2019-11-05T21:35:59Z")

</div>

You should not modify the scale of the transform, you want identity transform. What you need to modify is the size and spacing of the `output_size_image`. Also take a look at a previous discussion:

> [@Resample 3D images](https://discourse.itk.org/t/resample-3d-images/1258/):
>
> Hello everyone, I try to resample (resize) 3d images with dimensions [171, 127, 411] to [256, 256, 411]. For this, I tried to use itk::ResampleImageFilter but with no success: either I have an my previous image and some black borders (at the right and bottom) or I have a black image. The following code show you how I (mis)used ResampleImageFilter: typedef typename Image::SizeType SizeType; typedef itk::IdentityTransform\<double, 3\> TransformType; typedef itk::ResampleImageFilter\<Image, Image\> …

---

_[View the full topic](https://discourse.itk.org/t/how-to-resize-a-3d-image/2379)._
