# ResampleImage for 4D data

**URL:** https://discourse.itk.org/t/resampleimage-for-4d-data/4710
**Category:** Beginner Questions
**Created:** [January 5, 2022, 4:03am UTC](https://discourse.itk.org/t/resampleimage-for-4d-data/4710 "2022-01-05T04:03:37Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Prathamesh\_Chopade](https://discourse.itk.org/user_avatar/discourse.itk.org/prathamesh_chopade/32/2476_2.png) [@Prathamesh\_Chopade](https://discourse.itk.org/u/Prathamesh_Chopade)
#### Post date: [January 5, 2022, 4:03am UTC](https://discourse.itk.org/t/resampleimage-for-4d-data/4710/1 "2022-01-05T04:03:37Z")

</div>

**My goal is to upsample datasets (both 3D and 4D). ResampleImage was able to upsample 3D data, but gave an error when i tried upsampling 4D data.**

\*\*Are there any solutions or alternatives for this?? \*\*

**The command i used was**

ResampleImage 4 BOLD\_roi.nii.gz BOLD\_roi\_rs.nii.gz 0.2x0.2x0.2 0 4

**and this was the error:**

terminate called after throwing an instance of ‘itk::ExceptionObject’  
what(): /usr/local/build/staging/include/ITK-5.2/itkImageFileWriter.hxx:254:  
itk::ERROR: itk::ERROR: ImageFileWriter(0x3432770): Largest possible region does not fully contain requested paste IO regionPaste IO region: ImageIORegion (0x7ffc34b78de0)  
Dimension: 4  
Index: 0 0 0 0  
Size: 0 0 0 0  
Largest possible region: ImageRegion (0x7ffc34b78e60)  
Dimension: 4  
Index: [0, 0, 0, 0]  
Size: [0, 0, 0, 0]

**Thank you**

---

<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: [January 5, 2022, 4:30pm UTC](https://discourse.itk.org/t/resampleimage-for-4d-data/4710/2 "2022-01-05T16:30:05Z")

</div>

Which `ResampleImage` code are you using?

---

<div class="post-metadata">

### Author: ![Prathamesh\_Chopade](https://discourse.itk.org/user_avatar/discourse.itk.org/prathamesh_chopade/32/2476_2.png) [@Prathamesh\_Chopade](https://discourse.itk.org/u/Prathamesh_Chopade)
#### Post date: [January 5, 2022, 11:42pm UTC](https://discourse.itk.org/t/resampleimage-for-4d-data/4710/3 "2022-01-05T23:42:31Z")

</div>

I think the one that cmes inbuilt with ANTs. I had recently updated, so I am sure that i running the latest version of ANTs

---

<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: [January 6, 2022, 2:19pm UTC](https://discourse.itk.org/t/resampleimage-for-4d-data/4710/4 "2022-01-06T14:19:08Z")

</div>

The ANTs GitHub is the right place for this question. I now see that you already [asked it there](https://github.com/ANTsX/ANTs/issues/1283), and it was answered too.
