# vtkNIFTIImageReader cannot read the origin of NIFTI Image

**URL:** https://discourse.vtk.org/t/vtkniftiimagereader-cannot-read-the-origin-of-nifti-image/10420
**Category:** Support
**Created:** [January 11, 2023, 3:12am UTC](https://discourse.vtk.org/t/vtkniftiimagereader-cannot-read-the-origin-of-nifti-image/10420 "2023-01-11T03:12:50Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![nnzzll](https://discourse.vtk.org/user_avatar/discourse.vtk.org/nnzzll/32/6126_2.png) [@nnzzll](https://discourse.vtk.org/u/nnzzll)
#### Post date: [January 11, 2023, 3:12am UTC](https://discourse.vtk.org/t/vtkniftiimagereader-cannot-read-the-origin-of-nifti-image/10420/1 "2023-01-11T03:12:50Z")

</div>

I create a NIFTI image file by using `SimpleITK` and saved as `.nii.gz` file.  
However, when I load it by `vtkNIFTIImageReader`, the origin of the output `vtkImageData` turns out to be `(0, 0, 0)`, which is not what I had set in `SimpleITK`’s method.  
I tried to load the `.nii.gz` file in other ways like `3DSlicer` and `SimpleITK`, they all read the right `origin` parameters.  
Why does `vtkNIFTIImageReader` cannot get the right infomation?

---

<div class="post-metadata">

### Author: ![dgobbi](https://discourse.vtk.org/user_avatar/discourse.vtk.org/dgobbi/32/18_2.png) [@dgobbi](https://discourse.vtk.org/u/dgobbi)
#### Post date: [January 11, 2023, 5:34pm UTC](https://discourse.vtk.org/t/vtkniftiimagereader-cannot-read-the-origin-of-nifti-image/10420/2 "2023-01-11T17:34:19Z")

</div>

The vtkNIFTIImageReader stores that information in `SFormMatrix` and `QFormMatrix`.

For more information see [vtkNIFTIImageReader.h](https://gitlab.kitware.com/vtk/vtk/-/blob/ac76fe16364c22f1af7b79f223850dc491898e00/IO/Image/vtkNIFTIImageReader.h#L120) and [vtkNIFTIImageReader.cxx](https://gitlab.kitware.com/vtk/vtk/-/blob/ac76fe16364c22f1af7b79f223850dc491898e00/IO/Image/vtkNIFTIImageReader.cxx#L706)
